jodit-pro 4.1.14 → 4.1.22

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 +1379 -547
  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 +1365 -547
  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 +1362 -547
  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 +1362 -547
  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 +1411 -483
  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
package/es2015/jodit.js CHANGED
@@ -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.14
4
+ * Version: v4.1.22
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -966,6 +966,28 @@ class Config {
966
966
  : null);
967
967
  /**
968
968
  * Shadow root if Jodit was created in it
969
+ *
970
+ * ```html
971
+ * <div id="editor"></div>
972
+ * ```
973
+ *
974
+ * ```js
975
+ * const app = document.getElementById('editor');
976
+ * app.attachShadow({ mode: 'open' });
977
+ * const root = app.shadowRoot;
978
+ *
979
+ * root.innerHTML = `
980
+ * <link rel="stylesheet" href="./build/jodit.css"/>
981
+ * <h1>Jodit example in Shadow DOM</h1>
982
+ * <div id="edit"></div>
983
+ * `;
984
+ *
985
+ * const editor = Jodit.make(root.getElementById('edit'), {
986
+ * globalFullSize: false,
987
+ * shadowRoot: root
988
+ * });
989
+ * editor.value = '<p>start</p>';
990
+ * ```
969
991
  */
970
992
  this.shadowRoot = null;
971
993
  /**
@@ -1716,6 +1738,7 @@ Config.prototype.controls = {};
1716
1738
  /* harmony export */ });
1717
1739
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67259);
1718
1740
  /* harmony import */ var jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98761);
1741
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54306);
1719
1742
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(41959);
1720
1743
  /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72558);
1721
1744
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(47903);
@@ -1724,7 +1747,7 @@ Config.prototype.controls = {};
1724
1747
  /* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74197);
1725
1748
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28712);
1726
1749
  /* 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__);
1727
- /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(30126);
1750
+ /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(30126);
1728
1751
  /*!
1729
1752
  * Jodit Editor (https://xdsoft.net/jodit/)
1730
1753
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -1740,6 +1763,7 @@ Config.prototype.controls = {};
1740
1763
 
1741
1764
 
1742
1765
 
1766
+
1743
1767
  class Async {
1744
1768
  constructor() {
1745
1769
  var _a, _b, _c, _d, _e;
@@ -1858,6 +1882,11 @@ class Async {
1858
1882
  ? (...args) => {
1859
1883
  const promise = this.promise(res => {
1860
1884
  promises.push(res);
1885
+ }).catch((e) => {
1886
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1887
+ return null;
1888
+ }
1889
+ throw e;
1861
1890
  });
1862
1891
  onFire(...args);
1863
1892
  return promise;
@@ -1929,7 +1958,7 @@ class Async {
1929
1958
  promise(executor) {
1930
1959
  let rejectCallback = () => { };
1931
1960
  const promise = new Promise((resolve, reject) => {
1932
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1961
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1933
1962
  this.promisesRejections.add(rejectCallback);
1934
1963
  executor(resolve, reject);
1935
1964
  });
@@ -2414,7 +2443,7 @@ __webpack_require__.r(__webpack_exports__);
2414
2443
  * Released under MIT see LICENSE.txt in the project root for license information.
2415
2444
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
2416
2445
  */
2417
- const APP_VERSION = "4.1.14";
2446
+ const APP_VERSION = "4.1.22";
2418
2447
  // prettier-ignore
2419
2448
  const ES = "es2015";
2420
2449
  const IS_ES_MODERN = true;
@@ -7427,6 +7456,7 @@ const offset = (elm, jodit, doc, recurse = false) => {
7427
7456
  * Calculate screen element position
7428
7457
  */
7429
7458
  function position(elm, jodit, recurse = false) {
7459
+ var _a, _b;
7430
7460
  const rect = elm.getBoundingClientRect();
7431
7461
  let xPos = rect.left, yPos = rect.top;
7432
7462
  if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__/* .isJoditObject */ .y)(jodit) &&
@@ -7440,8 +7470,8 @@ function position(elm, jodit, recurse = false) {
7440
7470
  return {
7441
7471
  left: Math.round(xPos),
7442
7472
  top: Math.round(yPos),
7443
- width: Math.round(elm.offsetWidth),
7444
- height: Math.round(elm.offsetHeight)
7473
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
7474
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
7445
7475
  };
7446
7476
  }
7447
7477
 
@@ -9479,9 +9509,9 @@ const getXPathByElement = (element, root) => {
9479
9509
  * Find all `ref` or `data-ref` elements inside HTMLElement
9480
9510
  */
9481
9511
  const refs = (root) => {
9482
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
9483
- // root = root.container;
9484
- // }
9512
+ if ('container' in root) {
9513
+ root = root.container;
9514
+ }
9485
9515
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
9486
9516
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
9487
9517
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13998,7 +14028,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13998
14028
  view.o.showTooltip &&
13999
14029
  !view.o.useNativeTooltip) {
14000
14030
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
14001
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
14031
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
14002
14032
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
14003
14033
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
14004
14034
  capture: true
@@ -14014,6 +14044,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
14014
14044
  const view = this.j;
14015
14045
  view.e
14016
14046
  .on(view.ow, 'scroll.tooltip', this.__hide)
14047
+ .on(view.ow, 'joditCloseDialog', this.__hide)
14017
14048
  .on(view.container, 'mouseleave.tooltip', this.__hide)
14018
14049
  .on([
14019
14050
  'escape.tooltip',
@@ -16003,7 +16034,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
16003
16034
  }
16004
16035
  let pe = this.parentElement;
16005
16036
  while (pe) {
16006
- if (checkView(j)) {
16037
+ if (checkView(pe.j)) {
16007
16038
  return;
16008
16039
  }
16009
16040
  if (pe.container.style.zIndex) {
@@ -16095,7 +16126,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
16095
16126
  }
16096
16127
  return strategy;
16097
16128
  };
16098
- // Try find match position inside Jodit.container
16129
+ // Try to find match position inside Jodit.container
16099
16130
  let strategy = getMatchStrategy((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.position)(this.j.container, this.j));
16100
16131
  // If not found or is not inside window view
16101
16132
  if (!strategy || !Popup.boxInView(getPointByStrategy(strategy), view)) {
@@ -18580,6 +18611,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18580
18611
  * Fired when dialog box is started moving
18581
18612
  */
18582
18613
  this.e.fire(this, 'startMove');
18614
+ this.e.fire('closeAllPopups');
18583
18615
  }
18584
18616
  }
18585
18617
  onMouseMove(e) {
@@ -19897,6 +19929,9 @@ let DataProvider = class DataProvider {
19897
19929
  this.o.permissions.data.source = source;
19898
19930
  if (this.o.permissions.url) {
19899
19931
  return this.get('permissions').then(resp => {
19932
+ if (this.parent.isInDestruct) {
19933
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19934
+ }
19900
19935
  let process = this.o.permissions.process;
19901
19936
  if (!process) {
19902
19937
  process = this.o.ajax.process;
@@ -20518,10 +20553,18 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
20518
20553
  this.__updateToolbarButtons();
20519
20554
  this._dialog.open(this.browser, header);
20520
20555
  this.e.fire('sort.filebrowser', this.state.sortBy);
20521
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
20556
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
20557
+ .then(resolve, reject)
20558
+ .finally(() => {
20559
+ var _a;
20560
+ if (this.isInDestruct) {
20561
+ return;
20562
+ }
20563
+ (_a = this === null || this === void 0 ? void 0 : this.e) === null || _a === void 0 ? void 0 : _a.fire('fileBrowserReady.filebrowser');
20564
+ });
20522
20565
  })
20523
20566
  .catch((e) => {
20524
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
20567
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
20525
20568
  throw e;
20526
20569
  }
20527
20570
  });
@@ -22391,11 +22434,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
22391
22434
  const form = (editor, o) => {
22392
22435
  const i = editor.i18n.bind(editor);
22393
22436
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
22394
- <label>${i(label)}</label>
22395
-
22396
- <label class='jodit-switcher'>
22397
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
22398
- <span class="jodit-switcher__slider"></span>
22437
+ <label class="jodit-switcher-wrapper">
22438
+ <span class='jodit-switcher'>
22439
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
22440
+ <span class="jodit-switcher__slider"></span>
22441
+ </span>
22442
+ <span>${i(label)}</span>
22399
22443
  </label>
22400
22444
  </div>`;
22401
22445
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -25461,11 +25505,13 @@ const TabsWidget = (jodit, tabs, state) => {
25461
25505
  return;
25462
25506
  }
25463
25507
  buttonList.forEach(b => {
25508
+ b.state.variant = 'initial';
25464
25509
  b.state.activated = false;
25465
25510
  });
25466
25511
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
25467
25512
  a.classList.remove('jodit-tab_active');
25468
25513
  });
25514
+ nameToTab[tab].button.state.variant = 'outline';
25469
25515
  nameToTab[tab].button.state.activated = true;
25470
25516
  nameToTab[tab].tab.classList.add('jodit-tab_active');
25471
25517
  };
@@ -25494,7 +25540,7 @@ const TabsWidget = (jodit, tabs, state) => {
25494
25540
  content.call(jodit);
25495
25541
  }
25496
25542
  if (state) {
25497
- state.__activeTab = name;
25543
+ state.activeTab = name;
25498
25544
  }
25499
25545
  return false;
25500
25546
  });
@@ -25510,20 +25556,20 @@ const TabsWidget = (jodit, tabs, state) => {
25510
25556
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
25511
25557
  a.style.width = (100 / tabCount).toFixed(10) + '%';
25512
25558
  });
25513
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
25559
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
25514
25560
  ? firstTab
25515
- : state.__activeTab;
25561
+ : state.activeTab;
25516
25562
  setActive(tab);
25517
25563
  if (state) {
25518
- let __activeTab = state.__activeTab;
25519
- Object.defineProperty(state, '__activeTab', {
25564
+ let activeTab = state.activeTab;
25565
+ Object.defineProperty(state, 'activeTab', {
25520
25566
  configurable: true,
25521
25567
  enumerable: false,
25522
25568
  get() {
25523
- return __activeTab;
25569
+ return activeTab;
25524
25570
  },
25525
25571
  set(value) {
25526
- __activeTab = value;
25572
+ activeTab = value;
25527
25573
  setActive(value);
25528
25574
  }
25529
25575
  });
@@ -25938,7 +25984,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25938
25984
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25939
25985
  }
25940
25986
  /** @override */
25941
- afterInit(jodit) { }
25987
+ afterInit() { }
25942
25988
  onGenerateAiAssistantForm(prompt) {
25943
25989
  this.__dialog.open(this.__container, 'AI Assistant');
25944
25990
  this.__container.setPrompt(prompt);
@@ -31811,9 +31857,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31811
31857
  * Released under MIT see LICENSE.txt in the project root for license information.
31812
31858
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31813
31859
  */
31814
- /**
31815
- * @module plugins/image-properties
31816
- */
31817
31860
 
31818
31861
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31819
31862
  dialogWidth: 600,
@@ -31843,18 +31886,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31843
31886
 
31844
31887
  "use strict";
31845
31888
  /* unused harmony export imageProperties */
31846
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31889
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31847
31890
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53557);
31848
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51431);
31849
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
31850
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64962);
31851
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35102);
31852
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60485);
31853
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21391);
31854
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(61115);
31855
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98231);
31856
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9118);
31857
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85480);
31891
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23545);
31892
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51431);
31893
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9596);
31894
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67141);
31895
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64962);
31896
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(61115);
31897
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91675);
31898
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77137);
31899
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91852);
31900
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61566);
31901
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48570);
31858
31902
  /*!
31859
31903
  * Jodit Editor (https://xdsoft.net/jodit/)
31860
31904
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31886,55 +31930,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31886
31930
  * });
31887
31931
  * ```
31888
31932
  */
31889
- const normalSizeToString = (value) => {
31890
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31891
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31892
- };
31893
- const normalSizeFromString = (value) => {
31894
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31895
- ? parseFloat(value.toString())
31896
- : value;
31897
- };
31898
31933
  /**
31899
31934
  * Show dialog with image's options
31900
31935
  */
31901
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31936
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31902
31937
  constructor() {
31903
31938
  super(...arguments);
31904
31939
  this.state = {
31905
31940
  image: new Image(),
31941
+ sourceImage: new Image(),
31906
31942
  get ratio() {
31907
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31943
+ const { naturalWidth, naturalHeight } = this.image;
31944
+ return naturalWidth / naturalHeight || 1;
31908
31945
  },
31909
31946
  sizeIsLocked: true,
31910
- marginIsLocked: true
31947
+ marginIsLocked: true,
31948
+ values: {
31949
+ style: '',
31950
+ imageSrc: '',
31951
+ borderRadius: 0,
31952
+ imageTitle: '',
31953
+ imageAlt: '',
31954
+ imageLink: '',
31955
+ imageLinkOpenInNewTab: false,
31956
+ imageWidth: 0,
31957
+ imageHeight: 0,
31958
+ marginTop: 0,
31959
+ marginRight: 0,
31960
+ marginBottom: 0,
31961
+ marginLeft: 0,
31962
+ classes: '',
31963
+ id: '',
31964
+ align: ''
31965
+ }
31911
31966
  };
31912
31967
  this.activeTabState = {
31913
- __activeTab: 'Image'
31968
+ activeTab: 'Image'
31914
31969
  };
31915
31970
  }
31916
- onChangeMarginIsLocked() {
31917
- if (!this.form) {
31918
- return;
31919
- }
31920
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31921
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31922
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31971
+ get form() {
31972
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31973
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31974
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31923
31975
  });
31924
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31925
31976
  }
31926
- onChangeSizeIsLocked() {
31927
- if (!this.form) {
31928
- return;
31929
- }
31930
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31931
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31932
- lockSize.classList.remove('jodit-properties__lock');
31933
- lockSize.classList.remove('jodit-properties__unlock');
31934
- lockSize.classList.add(this.state.sizeIsLocked
31935
- ? 'jodit-properties__lock'
31936
- : 'jodit-properties__unlock');
31937
- this.j.e.fire(imageWidth, 'change');
31977
+ /**
31978
+ * Dialog for form
31979
+ */
31980
+ get dialog() {
31981
+ const { j } = this;
31982
+ const dialog = j.dlg({
31983
+ minWidth: Math.min(400, screen.width),
31984
+ minHeight: 590,
31985
+ buttons: ['fullsize', 'dialog.close']
31986
+ });
31987
+ const buttons = this.__buttons;
31988
+ buttons.check.onAction(() => {
31989
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31990
+ j.synchronizeValues();
31991
+ dialog.close();
31992
+ });
31993
+ buttons.remove.onAction(() => {
31994
+ j.s.removeNode(this.state.sourceImage);
31995
+ dialog.close();
31996
+ });
31997
+ buttons.cancel.onAction(() => {
31998
+ dialog.close();
31999
+ });
32000
+ dialog.setHeader(j.i18n('Image properties'));
32001
+ dialog.setContent(this.form);
32002
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
32003
+ j.e.on(dialog, 'afterClose', () => {
32004
+ if (this.state.image.parentNode &&
32005
+ j.o.image.selectImageAfterClose) {
32006
+ j.s.select(this.state.sourceImage);
32007
+ }
32008
+ });
32009
+ dialog.setSize(j.o.image.dialogWidth);
32010
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
32011
+ return dialog;
32012
+ }
32013
+ get __buttons() {
32014
+ const { j } = this;
32015
+ return {
32016
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
32017
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
32018
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
32019
+ };
31938
32020
  }
31939
32021
  /**
31940
32022
  * Open dialog editing image properties
@@ -31951,358 +32033,28 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31951
32033
  * ```
31952
32034
  */
31953
32035
  open() {
31954
- this.makeForm();
31955
- this.activeTabState.__activeTab = 'Image';
31956
- this.j.e.fire('hidePopup');
31957
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31958
- this.state.marginIsLocked = true;
31959
- this.state.sizeIsLocked = true;
31960
- this.onChangeMarginIsLocked();
31961
- this.onChangeSizeIsLocked();
31962
- this.updateValues();
32036
+ this.activeTabState.activeTab = 'Image';
32037
+ this.__lock();
31963
32038
  this.dialog.open().setModal(true).setPosition();
31964
- return false;
31965
- }
31966
- /**
31967
- * Create form for edit image properties
31968
- */
31969
- makeForm() {
31970
- if (this.dialog) {
31971
- return;
31972
- }
31973
- this.dialog = this.j.dlg({
31974
- minWidth: Math.min(400, screen.width),
31975
- minHeight: 590,
31976
- buttons: ['fullsize', 'dialog.close']
31977
- });
31978
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31979
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31980
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31981
- };
31982
- editor.e.on(this.dialog, 'afterClose', () => {
31983
- if (this.state.image.parentNode &&
31984
- opt.image.selectImageAfterClose) {
31985
- editor.s.select(this.state.image);
31986
- }
31987
- });
31988
- buttons.remove.onAction(() => {
31989
- editor.s.removeNode(this.state.image);
31990
- this.dialog.close();
31991
- });
31992
- const { dialog } = this;
31993
- dialog.setHeader(i18n('Image properties'));
31994
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31995
- this.form = mainForm;
31996
- dialog.setContent(mainForm);
31997
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31998
- if (tabsBox) {
31999
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
32000
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
32001
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
32002
- ], this.activeTabState));
32003
- }
32004
- buttons.check.onAction(this.onApply);
32005
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
32006
- editor.e.on(changeImage, 'click', this.openImagePopup);
32007
- if (opt.image.useImageEditor) {
32008
- editor.e.on(editImage, 'click', this.openImageEditor);
32009
- }
32010
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
32011
- if (lockSize) {
32012
- editor.e.on(lockSize, 'click', () => {
32013
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
32014
- });
32015
- }
32016
- editor.e.on(lockMargin, 'click', (e) => {
32017
- this.state.marginIsLocked = !this.state.marginIsLocked;
32018
- e.preventDefault();
32019
- });
32020
- const changeSizes = (event) => {
32021
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
32022
- return;
32023
- }
32024
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
32025
- if (event.target === imageWidth) {
32026
- imageHeight.value = Math.round(w / this.state.ratio).toString();
32027
- }
32028
- else {
32029
- imageWidth.value = Math.round(h * this.state.ratio).toString();
32030
- }
32031
- };
32032
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
32033
- if (!this.state.sizeIsLocked) {
32034
- return;
32035
- }
32036
- editor.async.setTimeout(changeSizes.bind(this, event), {
32037
- timeout: editor.defaultTimeout,
32038
- label: 'image-properties-changeSize'
32039
- });
32040
- });
32041
- dialog.setFooter([buttons.remove, buttons.check]);
32042
- dialog.setSize(this.j.o.image.dialogWidth);
32043
- }
32044
- /**
32045
- * Set input values from image
32046
- */
32047
- updateValues() {
32048
- const opt = this.j.o;
32049
- const { image } = this.state;
32050
- 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);
32051
- const updateLock = () => {
32052
- lockMargin.checked = this.state.marginIsLocked;
32053
- lockSize.checked = this.state.sizeIsLocked;
32054
- }, updateAlign = () => {
32055
- if (image.style.cssFloat &&
32056
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
32057
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
32058
- }
32059
- else {
32060
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
32061
- image.style.marginLeft === 'auto' &&
32062
- image.style.marginRight === 'auto') {
32063
- align.value = 'center';
32064
- }
32065
- }
32066
- }, updateBorderRadius = () => {
32067
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
32068
- }, updateId = () => {
32069
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
32070
- }, updateStyle = () => {
32071
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
32072
- }, updateClasses = () => {
32073
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
32074
- }, updateMargins = () => {
32075
- if (!opt.image.editMargins) {
32076
- return;
32077
- }
32078
- let equal = true, wasEmptyField = false;
32079
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
32080
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
32081
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
32082
- if (!value) {
32083
- wasEmptyField = true;
32084
- elm.value = '';
32085
- return;
32086
- }
32087
- if (/^[0-9]+(px)?$/.test(value)) {
32088
- value = parseInt(value, 10);
32089
- }
32090
- elm.value = value.toString() || '';
32091
- if ((wasEmptyField && elm.value) ||
32092
- (equal &&
32093
- id !== 'marginTop' &&
32094
- elm.value !== marginTop.value)) {
32095
- equal = false;
32096
- }
32097
- });
32098
- this.state.marginIsLocked = equal;
32099
- }, updateSizes = () => {
32100
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
32101
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
32102
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
32103
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
32104
- false;
32105
- imageWidth.value =
32106
- width !== false
32107
- ? normalSizeFromString(width).toString()
32108
- : image.offsetWidth.toString();
32109
- imageHeight.value =
32110
- height !== false
32111
- ? normalSizeFromString(height).toString()
32112
- : image.offsetHeight.toString();
32113
- this.state.sizeIsLocked = (() => {
32114
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
32115
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
32116
- return false;
32117
- }
32118
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
32119
- return Math.abs(w - h * this.state.ratio) < 1;
32120
- })();
32121
- }, updateText = () => {
32122
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
32123
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
32124
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
32125
- if (a) {
32126
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
32127
- imageLinkOpenInNewTab.checked =
32128
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
32129
- }
32130
- else {
32131
- imageLink.value = '';
32132
- imageLinkOpenInNewTab.checked = false;
32133
- }
32134
- }, updateSrc = () => {
32135
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
32136
- if (imageViewSrc) {
32137
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
32138
- }
32139
- };
32140
- updateLock();
32141
- updateSrc();
32142
- updateText();
32143
- updateSizes();
32144
- updateMargins();
32145
- updateClasses();
32146
- updateId();
32147
- updateBorderRadius();
32148
- updateAlign();
32149
- updateStyle();
32150
- }
32151
- /**
32152
- * Apply form's values to image
32153
- */
32154
- onApply() {
32155
- 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);
32156
- const opt = this.j.o;
32157
- const { image } = this.state;
32158
- // styles
32159
- if (opt.image.editStyle) {
32160
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
32161
- }
32162
- // Src
32163
- if (imageSrc.value) {
32164
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
32165
- }
32166
- else {
32167
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
32168
- this.dialog.close();
32169
- return;
32170
- }
32171
- // Border radius
32172
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
32173
- image.style.borderRadius = borderRadius.value + 'px';
32174
- }
32175
- else {
32176
- image.style.borderRadius = '';
32177
- }
32178
- // Title
32179
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
32180
- // Alt
32181
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
32182
- // Link
32183
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
32184
- if (imageLink.value) {
32185
- if (!link) {
32186
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
32187
- }
32188
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
32189
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
32190
- }
32191
- else {
32192
- if (link && link.parentNode) {
32193
- link.parentNode.replaceChild(image, link);
32194
- }
32195
- }
32196
- // Size
32197
- if (imageWidth.value !== image.offsetWidth.toString() ||
32198
- imageHeight.value !== image.offsetHeight.toString()) {
32199
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
32200
- ? normalSizeToString(imageWidth.value)
32201
- : null;
32202
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
32203
- ? normalSizeToString(imageHeight.value)
32204
- : null;
32205
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
32206
- width: updatedtWidth,
32207
- height: updatedHeight
32208
- });
32209
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
32210
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
32211
- }
32212
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
32213
- if (opt.image.editMargins) {
32214
- if (!this.state.marginIsLocked) {
32215
- margins.forEach((margin) => {
32216
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
32217
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
32218
- });
32219
- }
32220
- else {
32221
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
32222
- }
32223
- }
32224
- if (opt.image.editClass) {
32225
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
32226
- }
32227
- if (opt.image.editId) {
32228
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
32229
- }
32230
- if (opt.image.editAlign) {
32231
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
32232
- }
32233
- this.j.synchronizeValues();
32234
- this.dialog.close();
32235
- }
32236
- /**
32237
- * Open image editor dialog
32238
- */
32239
- openImageEditor() {
32240
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
32241
- if (a.host !== location.host) {
32242
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32243
- if (yes && this.j.uploader) {
32244
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32245
- this.j.alert('The image has been successfully uploaded to the host!', () => {
32246
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
32247
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
32248
- resp.newfilename);
32249
- this.updateValues();
32250
- }
32251
- });
32252
- }, error => {
32253
- this.j.alert('There was an error loading %s', error.message);
32254
- });
32255
- }
32256
- });
32257
- return;
32039
+ this.async
32040
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
32041
+ .catch((e) => {
32042
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
32043
+ this.dialog.message.error(e.message);
32258
32044
  }
32259
- };
32260
- a.href = url;
32261
- this.j.filebrowser.dataProvider
32262
- .getPathByUrl(a.href.toString())
32263
- .then(resp => {
32264
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32265
- const timestamp = new Date().getTime();
32266
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
32267
- (url.indexOf('?') !== -1 ? '' : '?') +
32268
- '&_tmp=' +
32269
- timestamp.toString());
32270
- this.updateValues();
32271
- }, error => {
32272
- this.j.alert(error.message);
32273
- });
32274
32045
  })
32275
- .catch(error => {
32276
- this.j.alert(error.message, loadExternal);
32277
- });
32046
+ .finally(() => this.__unlock());
32047
+ return false;
32278
32048
  }
32279
- /**
32280
- * Open popup with filebrowser/uploader buttons for image
32281
- */
32282
- openImagePopup(event) {
32283
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
32284
- popup.setZIndex(this.dialog.getZIndex() + 1);
32285
- popup
32286
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
32287
- upload: (data) => {
32288
- if (data.files && data.files.length) {
32289
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
32290
- }
32291
- this.updateValues();
32292
- popup.close();
32293
- },
32294
- filebrowser: (data) => {
32295
- if (data &&
32296
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
32297
- data.files.length) {
32298
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
32299
- popup.close();
32300
- this.updateValues();
32301
- }
32302
- }
32303
- }, this.state.image, popup.close))
32304
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
32305
- event.stopPropagation();
32049
+ __lock() {
32050
+ this.dialog.lock();
32051
+ this.form.setMod('lock', true);
32052
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
32053
+ }
32054
+ __unlock() {
32055
+ this.dialog.unlock();
32056
+ this.form.setMod('lock', false);
32057
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
32306
32058
  }
32307
32059
  /** @override **/
32308
32060
  afterInit(editor) {
@@ -32313,7 +32065,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
32313
32065
  .off(editor.editor, '.imageproperties')
32314
32066
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
32315
32067
  const image = e.target;
32316
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
32068
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
32317
32069
  return;
32318
32070
  }
32319
32071
  if (editor.o.image.openOnDblClick) {
@@ -32321,7 +32073,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
32321
32073
  false) {
32322
32074
  return;
32323
32075
  }
32324
- self.state.image = image;
32076
+ self.state.sourceImage = image;
32077
+ self.state.image = image.cloneNode(true);
32325
32078
  if (!editor.o.readonly) {
32326
32079
  e.stopImmediatePropagation();
32327
32080
  e.preventDefault();
@@ -32335,206 +32088,1267 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
32335
32088
  });
32336
32089
  })
32337
32090
  .on('openImageProperties.imageproperties', (image) => {
32338
- this.state.image = image;
32091
+ self.state.sourceImage = image;
32092
+ this.state.image = image.cloneNode(true);
32339
32093
  this.open();
32340
32094
  });
32341
32095
  }
32096
+ onStateValuesImageSrcChange() {
32097
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
32098
+ const { image, values } = this.state;
32099
+ if (!image.src) {
32100
+ return;
32101
+ }
32102
+ try {
32103
+ this.__lock();
32104
+ yield image.decode();
32105
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
32106
+ const w = parseFloat(values.imageWidth.toString());
32107
+ values.imageHeight = Math.round(w / this.state.ratio);
32108
+ }
32109
+ this.j.e.fire('updateImageProperties.imageproperties', image);
32110
+ }
32111
+ catch (e) {
32112
+ this.j.alert(e.message);
32113
+ }
32114
+ finally {
32115
+ this.__unlock();
32116
+ }
32117
+ });
32118
+ }
32342
32119
  /** @override */
32343
32120
  beforeDestruct(editor) {
32344
- this.dialog && this.dialog.destruct();
32121
+ var _a, _b, _c;
32122
+ Object.values((_a = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
32123
+ (_b = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
32124
+ (_c = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
32345
32125
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
32346
32126
  }
32347
32127
  }
32348
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32349
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
32350
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
32351
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32352
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
32353
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
32354
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32355
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
32356
- ], imageProperties.prototype, "onApply", null);
32357
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32358
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
32359
- ], imageProperties.prototype, "openImageEditor", null);
32360
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32361
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
32362
- ], imageProperties.prototype, "openImagePopup", null);
32363
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
32128
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32129
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
32130
+ ], imageProperties.prototype, "form", null);
32131
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32132
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
32133
+ ], imageProperties.prototype, "dialog", null);
32134
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32135
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
32136
+ ], imageProperties.prototype, "__buttons", null);
32137
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32138
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
32139
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
32140
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
32364
32141
 
32365
32142
 
32366
32143
  /***/ }),
32367
32144
 
32368
- /***/ 98231:
32145
+ /***/ 81091:
32369
32146
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32370
32147
 
32371
32148
  "use strict";
32372
32149
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32373
- /* harmony export */ Z: function() { return /* binding */ form; }
32150
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
32374
32151
  /* harmony export */ });
32375
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32152
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4401);
32153
+ /*!
32154
+ * Jodit Editor (https://xdsoft.net/jodit/)
32155
+ * Released under MIT see LICENSE.txt in the project root for license information.
32156
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32157
+ */
32158
+
32159
+ /** @private */
32160
+ function readAlign(image, values) {
32161
+ // Align
32162
+ if (image.style.cssFloat &&
32163
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
32164
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
32165
+ }
32166
+ else {
32167
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
32168
+ image.style.marginLeft === 'auto' &&
32169
+ image.style.marginRight === 'auto') {
32170
+ values.align = 'center';
32171
+ }
32172
+ else {
32173
+ values.align = '';
32174
+ }
32175
+ }
32176
+ }
32177
+
32178
+
32179
+ /***/ }),
32180
+
32181
+ /***/ 61566:
32182
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32183
+
32184
+ "use strict";
32185
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32186
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
32187
+ /* harmony export */ });
32188
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
32189
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32190
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81091);
32191
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33756);
32192
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51462);
32193
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60225);
32194
+ /*!
32195
+ * Jodit Editor (https://xdsoft.net/jodit/)
32196
+ * Released under MIT see LICENSE.txt in the project root for license information.
32197
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32198
+ */
32199
+
32200
+
32201
+
32202
+
32203
+
32204
+
32205
+ /**
32206
+ * Read values from image and set it to state
32207
+ * @private
32208
+ */
32209
+ function readValuesFromImage(j, state) {
32210
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
32211
+ const { sourceImage: image, values } = state;
32212
+ (0,_align__WEBPACK_IMPORTED_MODULE_4__/* .readAlign */ .g)(image, values);
32213
+ // Border radius
32214
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
32215
+ // Id
32216
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
32217
+ // Title
32218
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
32219
+ // Alt
32220
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
32221
+ // Style
32222
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
32223
+ // Classes
32224
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
32225
+ // Margins
32226
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__/* .readMargins */ .E)(image, values, state);
32227
+ // Link
32228
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
32229
+ // Src
32230
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
32231
+ // Image size
32232
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
32233
+ });
32234
+ }
32235
+
32236
+
32237
+ /***/ }),
32238
+
32239
+ /***/ 33756:
32240
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32241
+
32242
+ "use strict";
32243
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32244
+ /* harmony export */ X: function() { return /* binding */ readLink; }
32245
+ /* harmony export */ });
32246
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
32247
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97099);
32248
+ /*!
32249
+ * Jodit Editor (https://xdsoft.net/jodit/)
32250
+ * Released under MIT see LICENSE.txt in the project root for license information.
32251
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32252
+ */
32253
+
32254
+
32255
+ /** @private */
32256
+ function readLink(state, j, values) {
32257
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
32258
+ if (a) {
32259
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
32260
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
32261
+ }
32262
+ else {
32263
+ values.imageLink = '';
32264
+ values.imageLinkOpenInNewTab = false;
32265
+ }
32266
+ }
32267
+
32268
+
32269
+ /***/ }),
32270
+
32271
+ /***/ 51462:
32272
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32273
+
32274
+ "use strict";
32275
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32276
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
32277
+ /* harmony export */ });
32278
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18014);
32376
32279
  /*!
32377
32280
  * Jodit Editor (https://xdsoft.net/jodit/)
32378
32281
  * Released under MIT see LICENSE.txt in the project root for license information.
32379
32282
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32380
32283
  */
32381
32284
 
32382
- function form(editor) {
32383
- 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);
32384
- return editor.c.fromHTML(`<form class="jodit-properties">
32285
+ /** @private */
32286
+ function readMargins(image, values, state) {
32287
+ // Margins
32288
+ let equal = true, wasEmptyField = false;
32289
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
32290
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
32291
+ if (!value) {
32292
+ wasEmptyField = true;
32293
+ values[id] = 0;
32294
+ return;
32295
+ }
32296
+ if (/^[0-9]+(px)?$/.test(value)) {
32297
+ value = parseInt(value, 10);
32298
+ }
32299
+ values[id] = value;
32300
+ if ((wasEmptyField && values[id]) ||
32301
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
32302
+ equal = false;
32303
+ }
32304
+ });
32305
+ state.marginIsLocked = equal;
32306
+ }
32307
+
32308
+
32309
+ /***/ }),
32310
+
32311
+ /***/ 60225:
32312
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32313
+
32314
+ "use strict";
32315
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32316
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
32317
+ /* harmony export */ });
32318
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
32319
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59372);
32320
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32321
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4401);
32322
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10926);
32323
+ /*!
32324
+ * Jodit Editor (https://xdsoft.net/jodit/)
32325
+ * Released under MIT see LICENSE.txt in the project root for license information.
32326
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32327
+ */
32328
+
32329
+
32330
+
32331
+
32332
+
32333
+ /** @private */
32334
+ function readSizes(image, values, state) {
32335
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
32336
+ yield image.decode();
32337
+ 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_3__/* .css */ .A)(image, 'width', true) || false;
32338
+ 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_3__/* .css */ .A)(image, 'height', true) || false;
32339
+ values.imageWidth =
32340
+ width !== false
32341
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
32342
+ : image.offsetWidth || image.naturalWidth;
32343
+ values.imageHeight =
32344
+ height !== false
32345
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
32346
+ : image.offsetHeight || image.naturalHeight;
32347
+ const { imageWidth, imageHeight } = values;
32348
+ const w = parseFloat(imageWidth.toString());
32349
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_4__/* .isNumeric */ .k)(imageHeight)) {
32350
+ state.sizeIsLocked = false;
32351
+ return;
32352
+ }
32353
+ if (height === false) {
32354
+ values.imageHeight = Math.round(w / state.ratio);
32355
+ state.sizeIsLocked = true;
32356
+ return;
32357
+ }
32358
+ const h = parseFloat(imageHeight.toString());
32359
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
32360
+ });
32361
+ }
32362
+
32363
+
32364
+ /***/ }),
32365
+
32366
+ /***/ 91675:
32367
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32368
+
32369
+ "use strict";
32370
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32371
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
32372
+ /* harmony export */ });
32373
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
32374
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53557);
32375
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12222);
32376
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9596);
32377
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1530);
32378
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80004);
32379
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21391);
32380
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26282);
32381
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26180);
32382
+ /*!
32383
+ * Jodit Editor (https://xdsoft.net/jodit/)
32384
+ * Released under MIT see LICENSE.txt in the project root for license information.
32385
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32386
+ */
32387
+
32388
+
32389
+
32390
+
32391
+
32392
+
32393
+
32394
+
32395
+
32396
+
32397
+ /** @private */
32398
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
32399
+ className() {
32400
+ return 'UIImagePropertiesForm';
32401
+ }
32402
+ appendChildToContainer() { }
32403
+ getElm(elementName) {
32404
+ const selfElm = super.getElm(elementName);
32405
+ if (selfElm) {
32406
+ return selfElm;
32407
+ }
32408
+ for (const child of this.elements) {
32409
+ const elm = child.getElm(elementName);
32410
+ if (elm) {
32411
+ return elm;
32412
+ }
32413
+ }
32414
+ return null;
32415
+ }
32416
+ constructor(jodit, state, activeTabState, handlers) {
32417
+ super(jodit);
32418
+ this.state = state;
32419
+ this.handlers = handlers;
32420
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
32421
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
32422
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
32423
+ { name: 'Image', content: this.__mainTab },
32424
+ { name: 'Advanced', content: this.__positionTab }
32425
+ ], activeTabState));
32426
+ this.setMod('lock-size', this.state.sizeIsLocked);
32427
+ this.append(this.__mainTab).append(this.__positionTab);
32428
+ }
32429
+ render() {
32430
+ return `<form>
32385
32431
  <div class="jodit-grid jodit-grid_xs-column">
32386
32432
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
32387
- <div class="jodit-properties_view_box">
32388
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
32389
- <img data-ref="imageViewSrc" src="" alt=""/>
32433
+ <div class="&__view-box">
32434
+ <div class="&__imageView">
32435
+ <img class="&__imageViewSrc" src="" alt=""/>
32390
32436
  </div>
32391
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
32392
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
32393
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
32394
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
32437
+ <div class="jodit-form__group &__imageSizes">
32438
+ <input type="text" class="jodit-input &__imageWidth"/>
32439
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
32440
+ <input type="text" class="&__imageHeight jodit-input"/>
32395
32441
  </div>
32396
32442
  </div>
32397
32443
  </div>
32398
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
32444
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
32399
32445
  </div>
32400
- </form>`);
32401
- }
32446
+ </form>`;
32447
+ }
32448
+ onChangeSizeIsLocked() {
32449
+ const lockSize = this.getElm('lockSize');
32450
+ const imageWidth = this.getElm('imageWidth');
32451
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
32452
+ this.setMod('lock-size', this.state.sizeIsLocked);
32453
+ this.j.e.fire(imageWidth, 'change');
32454
+ }
32455
+ onLockSizeClick() {
32456
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
32457
+ }
32458
+ onStateValuesSizeChange() {
32459
+ const imageWidth = this.getElm('imageWidth');
32460
+ const imageHeight = this.getElm('imageHeight');
32461
+ if (imageWidth !== this.j.od.activeElement) {
32462
+ imageWidth.value = this.state.values.imageWidth.toString();
32463
+ }
32464
+ if (imageHeight !== this.j.od.activeElement) {
32465
+ imageHeight.value = this.state.values.imageHeight.toString();
32466
+ }
32467
+ }
32468
+ onImageWidthChange(e) {
32469
+ const imageWidth = this.getElm('imageWidth');
32470
+ const imageHeight = this.getElm('imageHeight');
32471
+ if (!this.state.sizeIsLocked ||
32472
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
32473
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
32474
+ this.state.values.imageWidth = imageWidth.value;
32475
+ this.state.values.imageHeight = imageHeight.value;
32476
+ return;
32477
+ }
32478
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
32479
+ if (e.target === imageWidth) {
32480
+ this.state.values.imageWidth = w;
32481
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
32482
+ }
32483
+ else {
32484
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
32485
+ this.state.values.imageHeight = h;
32486
+ }
32487
+ }
32488
+ onStateValuesImageSrcChange() {
32489
+ const { imageSrc } = this.state.values;
32490
+ if (!imageSrc) {
32491
+ return;
32492
+ }
32493
+ const imageViewSrc = this.getElm('imageViewSrc');
32494
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
32495
+ const image = new Image();
32496
+ image.src = imageSrc;
32497
+ this.state.image = image;
32498
+ }
32499
+ hideFieldByOptions() {
32500
+ const opt = this.j.o.image;
32501
+ [
32502
+ ['editSize', 'imageSizes'],
32503
+ ['showPreview', 'imageView']
32504
+ ].forEach(([optKey, elmKey]) => {
32505
+ const elm = this.getElm(elmKey);
32506
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
32507
+ });
32508
+ }
32509
+ };
32510
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32511
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
32512
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
32513
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
32514
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32515
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
32516
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
32517
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32518
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
32519
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
32520
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
32521
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32522
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
32523
+ 'imageWidth:change',
32524
+ 'imageHeight:change',
32525
+ 'imageWidth:keydown',
32526
+ 'imageHeight:keydown',
32527
+ 'imageWidth:mousedown',
32528
+ 'imageHeight:mousedown',
32529
+ 'imageWidth:paste',
32530
+ 'imageHeight:paste'
32531
+ ]),
32532
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
32533
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
32534
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32535
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
32536
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
32537
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
32538
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32539
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
32540
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
32541
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32542
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
32543
+ ], UIImagePropertiesForm);
32544
+
32402
32545
 
32403
32546
 
32404
32547
  /***/ }),
32405
32548
 
32406
- /***/ 9118:
32549
+ /***/ 26282:
32407
32550
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32408
32551
 
32409
32552
  "use strict";
32410
32553
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32411
- /* harmony export */ J: function() { return /* binding */ mainTab; }
32554
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
32412
32555
  /* harmony export */ });
32413
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32556
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
32557
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12222);
32558
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27582);
32559
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24014);
32560
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
32561
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1530);
32414
32562
  /*!
32415
32563
  * Jodit Editor (https://xdsoft.net/jodit/)
32416
32564
  * Released under MIT see LICENSE.txt in the project root for license information.
32417
32565
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32418
32566
  */
32419
32567
 
32420
- function mainTab(editor) {
32421
- 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;
32422
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
32423
- <label>${i18n('Src')}</label>
32568
+
32569
+
32570
+
32571
+
32572
+
32573
+ /** @private */
32574
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
32575
+ className() {
32576
+ return 'UIImageMainTab';
32577
+ }
32578
+ appendChildToContainer() {
32579
+ // Do nothing
32580
+ }
32581
+ constructor(view, state, handlers) {
32582
+ super(view);
32583
+ this.state = state;
32584
+ this.handlers = handlers;
32585
+ }
32586
+ render() {
32587
+ return `<div class="jodit-form__group &__editSrc">
32588
+ <label>~Src~</label>
32424
32589
  <div class="jodit-input_group">
32425
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
32426
- <div
32427
- class="jodit-input_group-buttons"
32428
- style="${hasFbUrl ? '' : 'display: none'}"
32429
- >
32430
- <a
32431
- data-ref="changeImage"
32432
- class="jodit-button"
32433
- >${gi('image')}</a>
32434
- <a
32435
- data-ref="editImage"
32436
- class="jodit-button"
32437
- style="${hasEditor ? '' : 'display: none'}"
32438
- >${gi('crop')}</a>
32590
+ <input class="jodit-input &__imageSrc" type="text"/>
32591
+ <div class="jodit-input_group-buttons &__fixImage">
32592
+ <a class="jodit-button &__changeImage">*image*</a>
32593
+ <a class="jodit-button &__editImage">*crop*</a>
32439
32594
  </div>
32440
32595
  </div>
32441
32596
  </div>
32442
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
32443
- <label>${i18n('Title')}</label>
32444
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
32597
+ <div class="jodit-form__group &__editTitle">
32598
+ <label>~Title~</label>
32599
+ <input type="text" class="jodit-input &__imageTitle"/>
32445
32600
  </div>
32446
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
32447
- <label>${i18n('Alternative')}</label>
32448
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
32601
+ <div class="jodit-form__group &__editAlt">
32602
+ <label>~Alternative~</label>
32603
+ <input type="text" class="jodit-input &__imageAlt"/>
32449
32604
  </div>
32450
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
32451
- <label>${i18n('Link')}</label>
32452
- <input data-ref="imageLink" type="text" class="jodit-input"/>
32605
+ <div class="jodit-form__group &__editLink">
32606
+ <label>~Link~</label>
32607
+ <input type="text" class="jodit-input &__imageLink"/>
32453
32608
  </div>
32454
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
32609
+ <div class="jodit-form__group &__editLinkTarget">
32455
32610
  <label class="jodit_vertical_middle">
32456
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
32457
- <span>${i18n('Open link in new tab')}</span>
32611
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
32612
+ <span>~Open link in new tab~</span>
32458
32613
  </label>
32459
- </div>`);
32460
- }
32614
+ </div>`;
32615
+ }
32616
+ onStateImageSrcChange() {
32617
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
32618
+ const imageSrc = this.getElm('imageSrc');
32619
+ imageSrc.value = this.state.values.imageSrc;
32620
+ });
32621
+ }
32622
+ onImageSrcChange() {
32623
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
32624
+ }
32625
+ /**
32626
+ * Open image editor
32627
+ */
32628
+ onEditImageClick(e) {
32629
+ this.handlers.openImageEditor();
32630
+ e.stopPropagation();
32631
+ }
32632
+ /**
32633
+ * Open popup with filebrowser/uploader buttons for image
32634
+ */
32635
+ onChangeImageClick(e) {
32636
+ this.handlers.openImagePopup(this.getElm('changeImage'));
32637
+ e.stopPropagation();
32638
+ }
32639
+ onStateTitleChange() {
32640
+ const title = this.getElm('imageTitle');
32641
+ title.value = this.state.values.imageTitle;
32642
+ }
32643
+ onTitleChange() {
32644
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
32645
+ }
32646
+ onStateAltChange() {
32647
+ const alt = this.getElm('imageAlt');
32648
+ alt.value = this.state.values.imageAlt;
32649
+ }
32650
+ onAltChange() {
32651
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
32652
+ }
32653
+ onStateImageLinkChange() {
32654
+ const imageLink = this.getElm('imageLink');
32655
+ imageLink.value = this.state.values.imageLink;
32656
+ }
32657
+ onImageLinkChange() {
32658
+ this.state.values.imageLink = this.getElm('imageLink').value;
32659
+ }
32660
+ onStateImageLinkOpenInNewTabChange() {
32661
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
32662
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
32663
+ }
32664
+ onImageLinkOpenInNewTabChange() {
32665
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
32666
+ }
32667
+ hideFieldByOptions() {
32668
+ const o = this.j.o;
32669
+ const opt = o.image;
32670
+ [
32671
+ ['editSrc', 'editSrc'],
32672
+ ['editTitle', 'editTitle'],
32673
+ ['editAlt', 'editAlt'],
32674
+ ['editLink', 'editLink'],
32675
+ ['editLink', 'editLinkTarget'],
32676
+ ['useImageEditor', 'editImage']
32677
+ ].forEach(([optKey, elmKey]) => {
32678
+ const elm = this.getElm(elmKey);
32679
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32680
+ });
32681
+ const changeImage = this.getElm('changeImage');
32682
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
32683
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
32684
+ const editImage = this.getElm('editImage');
32685
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
32686
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
32687
+ const fixImage = this.getElm('fixImage');
32688
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
32689
+ }
32690
+ };
32691
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32692
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
32693
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
32694
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32695
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
32696
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
32697
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32698
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
32699
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
32700
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32701
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
32702
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
32703
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32704
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
32705
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
32706
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32707
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
32708
+ ], UIImageMainTab.prototype, "onTitleChange", null);
32709
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32710
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
32711
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
32712
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32713
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
32714
+ ], UIImageMainTab.prototype, "onAltChange", null);
32715
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32716
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
32717
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
32718
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32719
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
32720
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
32721
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32722
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
32723
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
32724
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32725
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
32726
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
32727
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32728
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32729
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
32730
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32731
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
32732
+ ], UIImageMainTab);
32733
+
32461
32734
 
32462
32735
 
32463
32736
  /***/ }),
32464
32737
 
32465
- /***/ 85480:
32738
+ /***/ 26180:
32466
32739
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32467
32740
 
32468
32741
  "use strict";
32469
32742
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32470
- /* harmony export */ b: function() { return /* binding */ positionTab; }
32743
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
32471
32744
  /* harmony export */ });
32472
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32745
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
32746
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12222);
32747
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27582);
32748
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24014);
32749
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
32750
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26986);
32751
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97099);
32752
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65685);
32753
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80004);
32754
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10926);
32473
32755
  /*!
32474
32756
  * Jodit Editor (https://xdsoft.net/jodit/)
32475
32757
  * Released under MIT see LICENSE.txt in the project root for license information.
32476
32758
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32477
32759
  */
32478
32760
 
32479
- function positionTab(editor) {
32480
- 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);
32481
- const classInput = [];
32482
- if (opt.image.availableClasses.length > 0) {
32483
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
32484
- opt.image.availableClasses.forEach(item => {
32485
- if (typeof item === 'string') {
32486
- classInput.push(`<option value="${item}">${item}</option>`);
32487
- }
32488
- else {
32489
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32490
- }
32491
- });
32492
- classInput.push('</select>');
32761
+
32762
+
32763
+
32764
+
32765
+
32766
+
32767
+
32768
+
32769
+
32770
+ /** @private */
32771
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
32772
+ className() {
32773
+ return 'UIImagePositionTab';
32493
32774
  }
32494
- else {
32495
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
32775
+ constructor(jodit, state, handlers) {
32776
+ super(jodit, {
32777
+ availableClasses: jodit.o.image.availableClasses
32778
+ });
32779
+ this.state = state;
32780
+ this.handlers = handlers;
32496
32781
  }
32497
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
32498
- <label>${i18n('Margins')}</label>
32782
+ render({ availableClasses }) {
32783
+ return `<div class="jodit-form__group &__editMargins">
32784
+ <label>~Margins~</label>
32499
32785
  <div class="jodit-grid jodit_vertical_middle">
32500
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
32501
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
32502
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
32503
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
32504
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
32786
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
32787
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
32788
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
32789
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
32790
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
32505
32791
  </div>
32506
32792
  </div>
32507
- <div
32508
- style="${!opt.image.editAlign ? 'display:none' : ''}"
32509
- class="jodit-form__group"
32510
- >
32511
- <label>${i18n('Align')}</label>
32512
- <select data-ref="align" class="jodit-select">
32513
- <option value="">${i18n('--Not Set--')}</option>
32514
- <option value="left">${i18n('Left')}</option>
32515
- <option value="center">${i18n('Center')}</option>
32516
- <option value="right">${i18n('Right')}</option>
32793
+ <div class="jodit-form__group &__editAlign">
32794
+ <label>~Align~</label>
32795
+ <select class="jodit-select &__align">
32796
+ <option value="">~--Not Set--~</option>
32797
+ <option value="left">~Left~</option>
32798
+ <option value="center">~Center~</option>
32799
+ <option value="right">~Right~</option>
32517
32800
  </select>
32518
32801
  </div>
32519
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
32520
- <label>${i18n('Styles')}</label>
32521
- <input data-ref="style" type="text" class="jodit-input"/>
32802
+ <div class="jodit-form__group &__editStyle">
32803
+ <label>~Styles~</label>
32804
+ <input type="text" class="jodit-input &__style"/>
32522
32805
  </div>
32523
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
32524
- <label>${i18n('Classes')}</label>
32525
- ${classInput.join('')}
32806
+ <div class="jodit-form__group &__editClass">
32807
+ <label>~Classes~</label>
32808
+ ${(() => {
32809
+ const classInput = [];
32810
+ if (availableClasses && availableClasses.length > 0) {
32811
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
32812
+ availableClasses.forEach(item => {
32813
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
32814
+ classInput.push(`<option value="${item}">${item}</option>`);
32815
+ }
32816
+ else {
32817
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32818
+ }
32819
+ });
32820
+ classInput.push('</select>');
32821
+ }
32822
+ else {
32823
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32824
+ }
32825
+ return classInput.join('');
32826
+ })()}
32526
32827
  </div>
32527
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32828
+ <div class="jodit-form__group &__editId">
32528
32829
  <label>Id</label>
32529
- <input data-ref="id" type="text" class="jodit-input"/>
32830
+ <input type="text" class="jodit-input &__id"/>
32530
32831
  </div>
32531
32832
  <div
32532
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
32533
- class="jodit-form__group"
32833
+ class="jodit-form__group &__editBorderRadius"
32534
32834
  >
32535
- <label>${i18n('Border radius')}</label>
32536
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
32537
- </div>`);
32835
+ <label>~Border radius~</label>
32836
+ <input type="number" class="jodit-input &__borderRadius"/>
32837
+ </div>`;
32838
+ }
32839
+ onStateAlignChange() {
32840
+ const align = this.getElm('align');
32841
+ align.value = this.state.values.align;
32842
+ }
32843
+ onChangeAlign() {
32844
+ const align = this.getElm('align');
32845
+ this.state.values.align = align.value;
32846
+ }
32847
+ onStateValuesBorderRadiusChange() {
32848
+ const borderRadius = this.getElm('borderRadius');
32849
+ borderRadius.value = this.state.values.borderRadius.toString();
32850
+ }
32851
+ onChangeBorderRadius() {
32852
+ const borderRadius = this.getElm('borderRadius');
32853
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32854
+ }
32855
+ onStateValuesIdChange() {
32856
+ const id = this.getElm('id');
32857
+ id.value = this.state.values.id;
32858
+ }
32859
+ onChangeId() {
32860
+ const id = this.getElm('id');
32861
+ this.state.values.id = id.value;
32862
+ }
32863
+ onStateValuesStyleChange() {
32864
+ const style = this.getElm('style');
32865
+ style.value = this.state.values.style;
32866
+ }
32867
+ onChangeStyle() {
32868
+ const style = this.getElm('style');
32869
+ this.state.values.style = style.value;
32870
+ }
32871
+ onStateValuesClassesChange() {
32872
+ const classes = this.getElm('classes');
32873
+ classes.value = this.state.values.classes;
32874
+ }
32875
+ onChangClasses() {
32876
+ const classes = this.getElm('classes');
32877
+ this.state.values.classes = classes.value;
32878
+ }
32879
+ onLockMarginClick(e) {
32880
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32881
+ e.preventDefault();
32882
+ }
32883
+ onChangeMarginIsLocked() {
32884
+ const marginBottom = this.getElm('marginBottom');
32885
+ const marginRight = this.getElm('marginRight');
32886
+ const marginLeft = this.getElm('marginLeft');
32887
+ const lockMargin = this.getElm('lockMargin');
32888
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32889
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32890
+ });
32891
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32892
+ if (this.state.marginIsLocked) {
32893
+ const marginTop = this.state.values.marginTop;
32894
+ this.state.values.marginRight = marginTop;
32895
+ this.state.values.marginBottom = marginTop;
32896
+ this.state.values.marginLeft = marginTop;
32897
+ }
32898
+ }
32899
+ onStateValuesMarginChange() {
32900
+ const marginTop = this.getElm('marginTop');
32901
+ const marginRight = this.getElm('marginRight');
32902
+ const marginBottom = this.getElm('marginBottom');
32903
+ const marginLeft = this.getElm('marginLeft');
32904
+ marginTop.value = this.state.values.marginTop.toString();
32905
+ marginRight.value = this.state.values.marginRight.toString();
32906
+ marginBottom.value = this.state.values.marginBottom.toString();
32907
+ marginLeft.value = this.state.values.marginLeft.toString();
32908
+ }
32909
+ onChangeMargin() {
32910
+ const marginTop = this.getElm('marginTop');
32911
+ const marginRight = this.getElm('marginRight');
32912
+ const marginBottom = this.getElm('marginBottom');
32913
+ const marginLeft = this.getElm('marginLeft');
32914
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32915
+ if (this.state.marginIsLocked) {
32916
+ this.state.values.marginRight = this.state.values.marginTop;
32917
+ this.state.values.marginBottom = this.state.values.marginTop;
32918
+ this.state.values.marginLeft = this.state.values.marginTop;
32919
+ }
32920
+ else {
32921
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32922
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32923
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32924
+ }
32925
+ }
32926
+ hideFieldByOptions() {
32927
+ const opt = this.j.o.image;
32928
+ [
32929
+ ['editMargins', 'editMargins'],
32930
+ ['editAlign', 'editAlign'],
32931
+ ['editStyle', 'editStyle'],
32932
+ ['editClass', 'editClass'],
32933
+ ['editId', 'editId'],
32934
+ ['editBorderRadius', 'editBorderRadius']
32935
+ ].forEach(([optKey, elmKey]) => {
32936
+ const elm = this.getElm(elmKey);
32937
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32938
+ });
32939
+ }
32940
+ };
32941
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32942
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32943
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32944
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32945
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32946
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32947
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32948
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32949
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32950
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32951
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32952
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32953
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32954
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32955
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32956
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32957
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32958
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32959
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32960
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32961
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32962
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32963
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32964
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32965
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32966
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32967
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32968
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32969
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32970
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32971
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32972
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32973
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32974
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32975
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32976
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32977
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32978
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32979
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32980
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32981
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32982
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32983
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32984
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32985
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32986
+ 'state.values.marginTop',
32987
+ 'state.values.marginRight',
32988
+ 'state.values.marginBottom',
32989
+ 'state.values.marginLeft'
32990
+ ])
32991
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32992
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32993
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32994
+ 'marginTop:change',
32995
+ 'marginRight:change',
32996
+ 'marginBottom:change',
32997
+ 'marginLeft:change'
32998
+ ])
32999
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
33000
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
33001
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
33002
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
33003
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
33004
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
33005
+ ], UIImagePositionTab);
33006
+
33007
+
33008
+
33009
+ /***/ }),
33010
+
33011
+ /***/ 77137:
33012
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33013
+
33014
+ "use strict";
33015
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33016
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
33017
+ /* harmony export */ });
33018
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26986);
33019
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
33020
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60485);
33021
+ /*!
33022
+ * Jodit Editor (https://xdsoft.net/jodit/)
33023
+ * Released under MIT see LICENSE.txt in the project root for license information.
33024
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33025
+ */
33026
+
33027
+
33028
+
33029
+ /**
33030
+ * Open image editor dialog
33031
+ * @private
33032
+ */
33033
+ function openImageEditorDialog(j, state) {
33034
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
33035
+ if (a.host !== location.host) {
33036
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
33037
+ if (yes && j.uploader) {
33038
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
33039
+ j.alert('The image has been successfully uploaded to the host!', () => {
33040
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
33041
+ state.values.imageSrc =
33042
+ resp.baseurl +
33043
+ resp.newfilename;
33044
+ }
33045
+ });
33046
+ }, error => {
33047
+ j.alert('There was an error loading %s', error.message);
33048
+ });
33049
+ }
33050
+ });
33051
+ return;
33052
+ }
33053
+ };
33054
+ a.href = url;
33055
+ j.filebrowser.dataProvider
33056
+ .getPathByUrl(a.href.toString())
33057
+ .then(resp => {
33058
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
33059
+ const timestamp = new Date().getTime();
33060
+ state.values.imageSrc =
33061
+ url +
33062
+ (url.indexOf('?') !== -1 ? '' : '?') +
33063
+ '&_tmp=' +
33064
+ timestamp.toString();
33065
+ }, error => {
33066
+ j.alert(error.message);
33067
+ });
33068
+ })
33069
+ .catch(error => {
33070
+ j.alert(error.message, loadExternal);
33071
+ });
33072
+ }
33073
+
33074
+
33075
+ /***/ }),
33076
+
33077
+ /***/ 91852:
33078
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33079
+
33080
+ "use strict";
33081
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33082
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
33083
+ /* harmony export */ });
33084
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31635);
33085
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55010);
33086
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43977);
33087
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34138);
33088
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31784);
33089
+ /*!
33090
+ * Jodit Editor (https://xdsoft.net/jodit/)
33091
+ * Released under MIT see LICENSE.txt in the project root for license information.
33092
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33093
+ */
33094
+
33095
+
33096
+
33097
+
33098
+
33099
+ /** @private */
33100
+ function openImagePopup(j, dialog, state, button) {
33101
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
33102
+ const closePopup = () => {
33103
+ popup.close();
33104
+ popup.destruct();
33105
+ };
33106
+ popup
33107
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
33108
+ upload: (data) => {
33109
+ if (data.files && data.files.length) {
33110
+ state.values.imageSrc =
33111
+ data.baseurl + data.files[0];
33112
+ }
33113
+ closePopup();
33114
+ },
33115
+ filebrowser: (data) => (0,tslib__WEBPACK_IMPORTED_MODULE_2__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
33116
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__/* .isArray */ .c)(data.files) && data.files.length) {
33117
+ state.values.imageSrc = data.files[0];
33118
+ closePopup();
33119
+ }
33120
+ })
33121
+ }, state.image, closePopup))
33122
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_4__/* .position */ .G)(button));
33123
+ }
33124
+
33125
+
33126
+ /***/ }),
33127
+
33128
+ /***/ 10926:
33129
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33130
+
33131
+ "use strict";
33132
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33133
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
33134
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
33135
+ /* harmony export */ });
33136
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72558);
33137
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22718);
33138
+ /*!
33139
+ * Jodit Editor (https://xdsoft.net/jodit/)
33140
+ * Released under MIT see LICENSE.txt in the project root for license information.
33141
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33142
+ */
33143
+
33144
+
33145
+ /** @private */
33146
+ const normalSizeFromString = (value) => {
33147
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
33148
+ ? parseFloat(value.toString())
33149
+ : value;
33150
+ };
33151
+ /** @private */
33152
+ const normalSizeToString = (value) => {
33153
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
33154
+ return value ? value + 'px' : value.toString();
33155
+ }
33156
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
33157
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
33158
+ };
33159
+
33160
+
33161
+ /***/ }),
33162
+
33163
+ /***/ 48570:
33164
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33165
+
33166
+ "use strict";
33167
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33168
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
33169
+ /* harmony export */ });
33170
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
33171
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71122);
33172
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9144);
33173
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82714);
33174
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26277);
33175
+ /*!
33176
+ * Jodit Editor (https://xdsoft.net/jodit/)
33177
+ * Released under MIT see LICENSE.txt in the project root for license information.
33178
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33179
+ */
33180
+
33181
+
33182
+
33183
+
33184
+
33185
+ /**
33186
+ * Apply form's values to image
33187
+ * @private
33188
+ */
33189
+ function applyValuesToImage(j, state, image) {
33190
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
33191
+ const opt = j.o;
33192
+ // styles
33193
+ if (opt.image.editStyle) {
33194
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
33195
+ }
33196
+ // Src
33197
+ if (imageSrc) {
33198
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
33199
+ }
33200
+ else {
33201
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
33202
+ return;
33203
+ }
33204
+ // Border radius
33205
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
33206
+ // Title
33207
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
33208
+ // Alt
33209
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
33210
+ // Link
33211
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
33212
+ // Size
33213
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
33214
+ // Margin
33215
+ if (j.o.image.editMargins) {
33216
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
33217
+ }
33218
+ if (opt.image.editClass) {
33219
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
33220
+ }
33221
+ if (opt.image.editId) {
33222
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
33223
+ }
33224
+ if (opt.image.editAlign) {
33225
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
33226
+ }
33227
+ }
33228
+
33229
+
33230
+ /***/ }),
33231
+
33232
+ /***/ 9144:
33233
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33234
+
33235
+ "use strict";
33236
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33237
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
33238
+ /* harmony export */ });
33239
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
33240
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97099);
33241
+ /*!
33242
+ * Jodit Editor (https://xdsoft.net/jodit/)
33243
+ * Released under MIT see LICENSE.txt in the project root for license information.
33244
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33245
+ */
33246
+
33247
+
33248
+ /** @private */
33249
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
33250
+ // Link
33251
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
33252
+ if (imageLink) {
33253
+ if (!link) {
33254
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
33255
+ }
33256
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
33257
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
33258
+ }
33259
+ else {
33260
+ if (link && link.parentNode) {
33261
+ link.parentNode.replaceChild(image, link);
33262
+ }
33263
+ }
33264
+ }
33265
+
33266
+
33267
+ /***/ }),
33268
+
33269
+ /***/ 82714:
33270
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33271
+
33272
+ "use strict";
33273
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33274
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
33275
+ /* harmony export */ });
33276
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4401);
33277
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10926);
33278
+ /*!
33279
+ * Jodit Editor (https://xdsoft.net/jodit/)
33280
+ * Released under MIT see LICENSE.txt in the project root for license information.
33281
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33282
+ */
33283
+
33284
+
33285
+ /** @private */
33286
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
33287
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
33288
+ const applyMargin = (key, value) => {
33289
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
33290
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
33291
+ if (oldValue.toString() !== v.toString()) {
33292
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
33293
+ }
33294
+ };
33295
+ if (!marginIsLocked) {
33296
+ const sides = [
33297
+ 'margin-top',
33298
+ 'margin-right',
33299
+ 'margin-bottom',
33300
+ 'margin-left'
33301
+ ];
33302
+ margins.forEach((margin, index) => {
33303
+ const side = sides[index];
33304
+ applyMargin(side, margin);
33305
+ });
33306
+ }
33307
+ else {
33308
+ applyMargin('margin', marginTop);
33309
+ }
33310
+ }
33311
+
33312
+
33313
+ /***/ }),
33314
+
33315
+ /***/ 26277:
33316
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33317
+
33318
+ "use strict";
33319
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33320
+ /* harmony export */ q: function() { return /* binding */ applySize; }
33321
+ /* harmony export */ });
33322
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
33323
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4401);
33324
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10926);
33325
+ /*!
33326
+ * Jodit Editor (https://xdsoft.net/jodit/)
33327
+ * Released under MIT see LICENSE.txt in the project root for license information.
33328
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33329
+ */
33330
+
33331
+
33332
+
33333
+ /** @private */
33334
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
33335
+ // Size
33336
+ if (imageWidth !== image.offsetWidth ||
33337
+ imageHeight !== image.offsetHeight) {
33338
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
33339
+ let updatedHeight = imageHeight
33340
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
33341
+ : null;
33342
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
33343
+ width: updatedWidth,
33344
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
33345
+ });
33346
+ (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);
33347
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
33348
+ updatedHeight = null;
33349
+ }
33350
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
33351
+ }
32538
33352
  }
32539
33353
 
32540
33354
 
@@ -38932,7 +39746,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38932
39746
  */
38933
39747
 
38934
39748
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38935
- normalizeSelectionBeforeCutAndCopy: false
39749
+ normalizeSelectionBeforeCutAndCopy: false,
39750
+ normalizeTripleClick: true
38936
39751
  };
38937
39752
 
38938
39753
 
@@ -39008,7 +39823,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
39008
39823
  }
39009
39824
  }
39010
39825
  /**
39011
- * @event outsideClick(e) - when user clicked in the outside of editor
39826
+ * @event outsideClick(e) - when user clicked on the outside of editor
39012
39827
  */
39013
39828
  onOutsideClick(e) {
39014
39829
  const node = e.target;
@@ -39020,7 +39835,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
39020
39835
  this.j.e.fire('outsideClick', e);
39021
39836
  }
39022
39837
  }
39023
- beforeCommandCut(command) {
39838
+ beforeCommandCut() {
39024
39839
  const { s } = this.j;
39025
39840
  if (!s.isCollapsed()) {
39026
39841
  const current = s.current();
@@ -39029,13 +39844,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
39029
39844
  }
39030
39845
  }
39031
39846
  }
39032
- beforeCommandSelectall(command) {
39847
+ beforeCommandSelectAll() {
39033
39848
  const { s } = this.j;
39034
39849
  s.focus();
39035
39850
  s.select(this.j.editor, true);
39036
39851
  s.expandSelection();
39037
39852
  return false;
39038
39853
  }
39854
+ /**
39855
+ * Normalize selection after triple click
39856
+ */
39857
+ onTripleClickNormalizeSelection(e) {
39858
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39859
+ return;
39860
+ }
39861
+ const { s } = this.j;
39862
+ const { startContainer, startOffset } = s.range;
39863
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39864
+ 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) ||
39865
+ startContainer, true);
39866
+ }
39867
+ }
39039
39868
  onCopyNormalizeSelectionBound(e) {
39040
39869
  const { s, editor, o } = this.j;
39041
39870
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -39061,7 +39890,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
39061
39890
  ], select.prototype, "beforeCommandCut", null);
39062
39891
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39063
39892
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
39064
- ], select.prototype, "beforeCommandSelectall", null);
39893
+ ], select.prototype, "beforeCommandSelectAll", null);
39894
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39895
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39896
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
39065
39897
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39066
39898
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
39067
39899
  ], select.prototype, "onCopyNormalizeSelectionBound", null);