jodit-pro 4.1.13 → 4.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/es2015/jodit.css +87 -31
  2. package/es2015/jodit.fat.min.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +1378 -546
  5. package/es2015/jodit.min.css +1 -1
  6. package/es2015/jodit.min.js +2 -2
  7. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  8. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  9. package/es2015/plugins/backup/backup.css +1 -1
  10. package/es2015/plugins/backup/backup.js +1 -1
  11. package/es2015/plugins/backup/backup.min.js +1 -1
  12. package/es2015/plugins/button-generator/button-generator.css +1 -1
  13. package/es2015/plugins/button-generator/button-generator.js +1 -1
  14. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  15. package/es2015/plugins/change-case/change-case.js +1 -1
  16. package/es2015/plugins/change-case/change-case.min.js +1 -1
  17. package/es2015/plugins/color-picker/color-picker.css +1 -1
  18. package/es2015/plugins/color-picker/color-picker.js +1 -1
  19. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  20. package/es2015/plugins/emoji/emoji.css +1 -1
  21. package/es2015/plugins/emoji/emoji.js +1 -1
  22. package/es2015/plugins/emoji/emoji.min.js +1 -1
  23. package/es2015/plugins/export-docs/export-docs.js +1 -1
  24. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  25. package/es2015/plugins/finder/finder.css +6 -7
  26. package/es2015/plugins/finder/finder.js +1 -1
  27. package/es2015/plugins/finder/finder.min.css +1 -1
  28. package/es2015/plugins/finder/finder.min.js +1 -1
  29. package/es2015/plugins/google-maps/google-maps.css +1 -1
  30. package/es2015/plugins/google-maps/google-maps.js +1 -1
  31. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  32. package/es2015/plugins/google-search/google-search.js +1 -1
  33. package/es2015/plugins/google-search/google-search.min.js +1 -1
  34. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  35. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  36. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  37. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  38. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  39. package/es2015/plugins/keyboard/keyboard.css +1 -1
  40. package/es2015/plugins/keyboard/keyboard.js +1 -1
  41. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  42. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  43. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  44. package/es2015/plugins/page-break/page-break.js +1 -1
  45. package/es2015/plugins/page-break/page-break.min.js +1 -1
  46. package/es2015/plugins/paste-code/paste-code.css +1 -1
  47. package/es2015/plugins/paste-code/paste-code.js +1 -1
  48. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  49. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  50. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  51. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  52. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  53. package/es2015/plugins/todo-list/todo-list.css +1 -1
  54. package/es2015/plugins/todo-list/todo-list.js +1 -1
  55. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  56. package/es2015/plugins/translate/translate.css +1 -1
  57. package/es2015/plugins/translate/translate.js +1 -1
  58. package/es2015/plugins/translate/translate.min.js +1 -1
  59. package/es2015/plugins/tune-block/tune-block.css +1 -1
  60. package/es2015/plugins/tune-block/tune-block.js +1 -1
  61. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  62. package/es2018/jodit.css +87 -31
  63. package/es2018/jodit.fat.min.css +1 -1
  64. package/es2018/jodit.fat.min.js +2 -2
  65. package/es2018/jodit.js +1364 -546
  66. package/es2018/jodit.min.css +1 -1
  67. package/es2018/jodit.min.js +2 -2
  68. package/es2018/plugins/autocomplete/autocomplete.js +1 -1
  69. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  70. package/es2018/plugins/backup/backup.css +1 -1
  71. package/es2018/plugins/backup/backup.js +1 -1
  72. package/es2018/plugins/backup/backup.min.js +1 -1
  73. package/es2018/plugins/button-generator/button-generator.css +1 -1
  74. package/es2018/plugins/button-generator/button-generator.js +1 -1
  75. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  76. package/es2018/plugins/change-case/change-case.js +1 -1
  77. package/es2018/plugins/change-case/change-case.min.js +1 -1
  78. package/es2018/plugins/color-picker/color-picker.css +1 -1
  79. package/es2018/plugins/color-picker/color-picker.js +1 -1
  80. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  81. package/es2018/plugins/emoji/emoji.css +1 -1
  82. package/es2018/plugins/emoji/emoji.js +1 -1
  83. package/es2018/plugins/emoji/emoji.min.js +1 -1
  84. package/es2018/plugins/export-docs/export-docs.js +1 -1
  85. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  86. package/es2018/plugins/finder/finder.css +6 -7
  87. package/es2018/plugins/finder/finder.js +1 -1
  88. package/es2018/plugins/finder/finder.min.css +1 -1
  89. package/es2018/plugins/finder/finder.min.js +1 -1
  90. package/es2018/plugins/google-maps/google-maps.css +1 -1
  91. package/es2018/plugins/google-maps/google-maps.js +1 -1
  92. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  93. package/es2018/plugins/google-search/google-search.js +1 -1
  94. package/es2018/plugins/google-search/google-search.min.js +1 -1
  95. package/es2018/plugins/highlight-signature/highlight-signature.js +1 -1
  96. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  97. package/es2018/plugins/iframe-editor/iframe-editor.css +1 -1
  98. package/es2018/plugins/iframe-editor/iframe-editor.js +1 -1
  99. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  100. package/es2018/plugins/keyboard/keyboard.css +1 -1
  101. package/es2018/plugins/keyboard/keyboard.js +1 -1
  102. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  103. package/es2018/plugins/mobile-view/mobile-view.js +1 -1
  104. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  105. package/es2018/plugins/page-break/page-break.js +1 -1
  106. package/es2018/plugins/page-break/page-break.min.js +1 -1
  107. package/es2018/plugins/paste-code/paste-code.css +1 -1
  108. package/es2018/plugins/paste-code/paste-code.js +1 -1
  109. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  110. package/es2018/plugins/paste-from-word/paste-from-word.js +1 -1
  111. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  112. package/es2018/plugins/show-blocks/show-blocks.js +1 -1
  113. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  114. package/es2018/plugins/todo-list/todo-list.css +1 -1
  115. package/es2018/plugins/todo-list/todo-list.js +1 -1
  116. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  117. package/es2018/plugins/translate/translate.css +1 -1
  118. package/es2018/plugins/translate/translate.js +1 -1
  119. package/es2018/plugins/translate/translate.min.js +1 -1
  120. package/es2018/plugins/tune-block/tune-block.css +1 -1
  121. package/es2018/plugins/tune-block/tune-block.js +1 -1
  122. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  123. package/es2021/jodit.css +87 -31
  124. package/es2021/jodit.fat.min.css +1 -1
  125. package/es2021/jodit.fat.min.js +2 -2
  126. package/es2021/jodit.js +1361 -546
  127. package/es2021/jodit.min.css +1 -1
  128. package/es2021/jodit.min.js +2 -2
  129. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  130. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  131. package/es2021/plugins/backup/backup.css +1 -1
  132. package/es2021/plugins/backup/backup.js +1 -1
  133. package/es2021/plugins/backup/backup.min.js +1 -1
  134. package/es2021/plugins/button-generator/button-generator.css +1 -1
  135. package/es2021/plugins/button-generator/button-generator.js +1 -1
  136. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  137. package/es2021/plugins/change-case/change-case.js +1 -1
  138. package/es2021/plugins/change-case/change-case.min.js +1 -1
  139. package/es2021/plugins/color-picker/color-picker.css +1 -1
  140. package/es2021/plugins/color-picker/color-picker.js +1 -1
  141. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  142. package/es2021/plugins/emoji/emoji.css +1 -1
  143. package/es2021/plugins/emoji/emoji.js +1 -1
  144. package/es2021/plugins/emoji/emoji.min.js +1 -1
  145. package/es2021/plugins/export-docs/export-docs.js +1 -1
  146. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  147. package/es2021/plugins/finder/finder.css +6 -7
  148. package/es2021/plugins/finder/finder.js +1 -1
  149. package/es2021/plugins/finder/finder.min.css +1 -1
  150. package/es2021/plugins/finder/finder.min.js +1 -1
  151. package/es2021/plugins/google-maps/google-maps.css +1 -1
  152. package/es2021/plugins/google-maps/google-maps.js +1 -1
  153. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  154. package/es2021/plugins/google-search/google-search.js +1 -1
  155. package/es2021/plugins/google-search/google-search.min.js +1 -1
  156. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  157. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  158. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  159. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  160. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  161. package/es2021/plugins/keyboard/keyboard.css +1 -1
  162. package/es2021/plugins/keyboard/keyboard.js +1 -1
  163. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  164. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  165. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  166. package/es2021/plugins/page-break/page-break.js +1 -1
  167. package/es2021/plugins/page-break/page-break.min.js +1 -1
  168. package/es2021/plugins/paste-code/paste-code.css +1 -1
  169. package/es2021/plugins/paste-code/paste-code.js +1 -1
  170. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  171. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  172. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  173. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  174. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  175. package/es2021/plugins/todo-list/todo-list.css +1 -1
  176. package/es2021/plugins/todo-list/todo-list.js +1 -1
  177. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  178. package/es2021/plugins/translate/translate.css +1 -1
  179. package/es2021/plugins/translate/translate.js +1 -1
  180. package/es2021/plugins/translate/translate.min.js +1 -1
  181. package/es2021/plugins/tune-block/tune-block.css +1 -1
  182. package/es2021/plugins/tune-block/tune-block.js +1 -1
  183. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  184. package/es2021.en/jodit.css +87 -31
  185. package/es2021.en/jodit.fat.min.css +1 -1
  186. package/es2021.en/jodit.fat.min.js +2 -2
  187. package/es2021.en/jodit.js +1361 -546
  188. package/es2021.en/jodit.min.css +1 -1
  189. package/es2021.en/jodit.min.js +2 -2
  190. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  191. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  192. package/es2021.en/plugins/backup/backup.css +1 -1
  193. package/es2021.en/plugins/backup/backup.js +1 -1
  194. package/es2021.en/plugins/backup/backup.min.js +1 -1
  195. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  196. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  197. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  198. package/es2021.en/plugins/change-case/change-case.js +1 -1
  199. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  200. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  201. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  202. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  203. package/es2021.en/plugins/emoji/emoji.css +1 -1
  204. package/es2021.en/plugins/emoji/emoji.js +1 -1
  205. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  206. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  207. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  208. package/es2021.en/plugins/finder/finder.css +6 -7
  209. package/es2021.en/plugins/finder/finder.js +1 -1
  210. package/es2021.en/plugins/finder/finder.min.css +1 -1
  211. package/es2021.en/plugins/finder/finder.min.js +1 -1
  212. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  213. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  214. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  215. package/es2021.en/plugins/google-search/google-search.js +1 -1
  216. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  217. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  218. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  219. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  220. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  221. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  222. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  223. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  224. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  225. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  226. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  227. package/es2021.en/plugins/page-break/page-break.js +1 -1
  228. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  229. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  230. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  231. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  232. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  233. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  234. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  235. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  236. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  237. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  238. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  239. package/es2021.en/plugins/translate/translate.css +1 -1
  240. package/es2021.en/plugins/translate/translate.js +1 -1
  241. package/es2021.en/plugins/translate/translate.min.js +1 -1
  242. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  243. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  244. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  245. package/es5/jodit.css +131 -35
  246. package/es5/jodit.fat.min.css +1 -1
  247. package/es5/jodit.fat.min.js +2 -2
  248. package/es5/jodit.js +1410 -482
  249. package/es5/jodit.min.css +3 -3
  250. package/es5/jodit.min.js +2 -2
  251. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  252. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  253. package/es5/plugins/backup/backup.css +1 -1
  254. package/es5/plugins/backup/backup.js +1 -1
  255. package/es5/plugins/backup/backup.min.js +1 -1
  256. package/es5/plugins/button-generator/button-generator.css +1 -1
  257. package/es5/plugins/button-generator/button-generator.js +1 -1
  258. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  259. package/es5/plugins/change-case/change-case.js +1 -1
  260. package/es5/plugins/change-case/change-case.min.js +1 -1
  261. package/es5/plugins/color-picker/color-picker.css +1 -1
  262. package/es5/plugins/color-picker/color-picker.js +1 -1
  263. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  264. package/es5/plugins/emoji/emoji.css +1 -1
  265. package/es5/plugins/emoji/emoji.js +1 -1
  266. package/es5/plugins/emoji/emoji.min.js +1 -1
  267. package/es5/plugins/export-docs/export-docs.js +1 -1
  268. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  269. package/es5/plugins/finder/finder.css +6 -7
  270. package/es5/plugins/finder/finder.js +1 -1
  271. package/es5/plugins/finder/finder.min.css +1 -1
  272. package/es5/plugins/finder/finder.min.js +1 -1
  273. package/es5/plugins/google-maps/google-maps.css +1 -1
  274. package/es5/plugins/google-maps/google-maps.js +1 -1
  275. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  276. package/es5/plugins/google-search/google-search.js +1 -1
  277. package/es5/plugins/google-search/google-search.min.js +1 -1
  278. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  279. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  280. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  281. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  282. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  283. package/es5/plugins/keyboard/keyboard.css +1 -1
  284. package/es5/plugins/keyboard/keyboard.js +1 -1
  285. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  286. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  287. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  288. package/es5/plugins/page-break/page-break.js +1 -1
  289. package/es5/plugins/page-break/page-break.min.js +1 -1
  290. package/es5/plugins/paste-code/paste-code.css +1 -1
  291. package/es5/plugins/paste-code/paste-code.js +1 -1
  292. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  293. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  294. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  295. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  296. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  297. package/es5/plugins/todo-list/todo-list.css +1 -1
  298. package/es5/plugins/todo-list/todo-list.js +1 -1
  299. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  300. package/es5/plugins/translate/translate.css +1 -1
  301. package/es5/plugins/translate/translate.js +1 -1
  302. package/es5/plugins/translate/translate.min.js +1 -1
  303. package/es5/plugins/tune-block/tune-block.css +1 -1
  304. package/es5/plugins/tune-block/tune-block.js +1 -1
  305. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  306. package/esm/plugins/finder/browser.d.ts +1 -1
  307. package/package.json +1 -1
  308. package/types/plugins/finder/browser.d.ts +1 -1
package/es2021/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.13
4
+ * Version: v4.1.21
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -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
  this.timers = new Map();
@@ -1859,6 +1883,11 @@ class Async {
1859
1883
  ? (...args) => {
1860
1884
  const promise = this.promise(res => {
1861
1885
  promises.push(res);
1886
+ }).catch((e) => {
1887
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1888
+ return null;
1889
+ }
1890
+ throw e;
1862
1891
  });
1863
1892
  onFire(...args);
1864
1893
  return promise;
@@ -1930,7 +1959,7 @@ class Async {
1930
1959
  promise(executor) {
1931
1960
  let rejectCallback = () => { };
1932
1961
  const promise = new Promise((resolve, reject) => {
1933
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1962
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1934
1963
  this.promisesRejections.add(rejectCallback);
1935
1964
  executor(resolve, reject);
1936
1965
  });
@@ -2415,7 +2444,7 @@ __webpack_require__.r(__webpack_exports__);
2415
2444
  * Released under MIT see LICENSE.txt in the project root for license information.
2416
2445
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
2417
2446
  */
2418
- const APP_VERSION = "4.1.13";
2447
+ const APP_VERSION = "4.1.21";
2419
2448
  // prettier-ignore
2420
2449
  const ES = "es2021";
2421
2450
  const IS_ES_MODERN = true;
@@ -7424,8 +7453,8 @@ function position(elm, jodit, recurse = false) {
7424
7453
  return {
7425
7454
  left: Math.round(xPos),
7426
7455
  top: Math.round(yPos),
7427
- width: Math.round(elm.offsetWidth),
7428
- height: Math.round(elm.offsetHeight)
7456
+ width: Math.round(elm.offsetWidth ?? rect.width),
7457
+ height: Math.round(elm.offsetHeight ?? rect.height)
7429
7458
  };
7430
7459
  }
7431
7460
 
@@ -9458,9 +9487,9 @@ const getXPathByElement = (element, root) => {
9458
9487
  * Find all `ref` or `data-ref` elements inside HTMLElement
9459
9488
  */
9460
9489
  const refs = (root) => {
9461
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
9462
- // root = root.container;
9463
- // }
9490
+ if ('container' in root) {
9491
+ root = root.container;
9492
+ }
9464
9493
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
9465
9494
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
9466
9495
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13983,7 +14012,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13983
14012
  view.o.showTooltip &&
13984
14013
  !view.o.useNativeTooltip) {
13985
14014
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13986
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
14015
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13987
14016
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13988
14017
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13989
14018
  capture: true
@@ -13999,6 +14028,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13999
14028
  const view = this.j;
14000
14029
  view.e
14001
14030
  .on(view.ow, 'scroll.tooltip', this.__hide)
14031
+ .on(view.ow, 'joditCloseDialog', this.__hide)
14002
14032
  .on(view.container, 'mouseleave.tooltip', this.__hide)
14003
14033
  .on([
14004
14034
  'escape.tooltip',
@@ -16008,7 +16038,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
16008
16038
  }
16009
16039
  let pe = this.parentElement;
16010
16040
  while (pe) {
16011
- if (checkView(j)) {
16041
+ if (checkView(pe.j)) {
16012
16042
  return;
16013
16043
  }
16014
16044
  if (pe.container.style.zIndex) {
@@ -18588,6 +18618,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18588
18618
  * Fired when dialog box is started moving
18589
18619
  */
18590
18620
  this.e.fire(this, 'startMove');
18621
+ this.e.fire('closeAllPopups');
18591
18622
  }
18592
18623
  }
18593
18624
  onMouseMove(e) {
@@ -19915,6 +19946,9 @@ let DataProvider = class DataProvider {
19915
19946
  this.o.permissions.data.source = source;
19916
19947
  if (this.o.permissions.url) {
19917
19948
  return this.get('permissions').then(resp => {
19949
+ if (this.parent.isInDestruct) {
19950
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19951
+ }
19918
19952
  let process = this.o.permissions.process;
19919
19953
  if (!process) {
19920
19954
  process = this.o.ajax.process;
@@ -20528,10 +20562,17 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
20528
20562
  this.__updateToolbarButtons();
20529
20563
  this._dialog.open(this.browser, header);
20530
20564
  this.e.fire('sort.filebrowser', this.state.sortBy);
20531
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
20565
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
20566
+ .then(resolve, reject)
20567
+ .finally(() => {
20568
+ if (this.isInDestruct) {
20569
+ return;
20570
+ }
20571
+ this?.e?.fire('fileBrowserReady.filebrowser');
20572
+ });
20532
20573
  })
20533
20574
  .catch((e) => {
20534
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
20575
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
20535
20576
  throw e;
20536
20577
  }
20537
20578
  });
@@ -22397,11 +22438,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
22397
22438
  const form = (editor, o) => {
22398
22439
  const i = editor.i18n.bind(editor);
22399
22440
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
22400
- <label>${i(label)}</label>
22401
-
22402
- <label class='jodit-switcher'>
22403
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
22404
- <span class="jodit-switcher__slider"></span>
22441
+ <label class="jodit-switcher-wrapper">
22442
+ <span class='jodit-switcher'>
22443
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
22444
+ <span class="jodit-switcher__slider"></span>
22445
+ </span>
22446
+ <span>${i(label)}</span>
22405
22447
  </label>
22406
22448
  </div>`;
22407
22449
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -25465,11 +25507,13 @@ const TabsWidget = (jodit, tabs, state) => {
25465
25507
  return;
25466
25508
  }
25467
25509
  buttonList.forEach(b => {
25510
+ b.state.variant = 'initial';
25468
25511
  b.state.activated = false;
25469
25512
  });
25470
25513
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
25471
25514
  a.classList.remove('jodit-tab_active');
25472
25515
  });
25516
+ nameToTab[tab].button.state.variant = 'outline';
25473
25517
  nameToTab[tab].button.state.activated = true;
25474
25518
  nameToTab[tab].tab.classList.add('jodit-tab_active');
25475
25519
  };
@@ -25498,7 +25542,7 @@ const TabsWidget = (jodit, tabs, state) => {
25498
25542
  content.call(jodit);
25499
25543
  }
25500
25544
  if (state) {
25501
- state.__activeTab = name;
25545
+ state.activeTab = name;
25502
25546
  }
25503
25547
  return false;
25504
25548
  });
@@ -25514,20 +25558,20 @@ const TabsWidget = (jodit, tabs, state) => {
25514
25558
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
25515
25559
  a.style.width = (100 / tabCount).toFixed(10) + '%';
25516
25560
  });
25517
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
25561
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
25518
25562
  ? firstTab
25519
- : state.__activeTab;
25563
+ : state.activeTab;
25520
25564
  setActive(tab);
25521
25565
  if (state) {
25522
- let __activeTab = state.__activeTab;
25523
- Object.defineProperty(state, '__activeTab', {
25566
+ let activeTab = state.activeTab;
25567
+ Object.defineProperty(state, 'activeTab', {
25524
25568
  configurable: true,
25525
25569
  enumerable: false,
25526
25570
  get() {
25527
- return __activeTab;
25571
+ return activeTab;
25528
25572
  },
25529
25573
  set(value) {
25530
- __activeTab = value;
25574
+ activeTab = value;
25531
25575
  setActive(value);
25532
25576
  }
25533
25577
  });
@@ -25942,7 +25986,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25942
25986
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25943
25987
  }
25944
25988
  /** @override */
25945
- afterInit(jodit) { }
25989
+ afterInit() { }
25946
25990
  onGenerateAiAssistantForm(prompt) {
25947
25991
  this.__dialog.open(this.__container, 'AI Assistant');
25948
25992
  this.__container.setPrompt(prompt);
@@ -31804,9 +31848,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31804
31848
  * Released under MIT see LICENSE.txt in the project root for license information.
31805
31849
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31806
31850
  */
31807
- /**
31808
- * @module plugins/image-properties
31809
- */
31810
31851
 
31811
31852
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31812
31853
  dialogWidth: 600,
@@ -31836,18 +31877,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31836
31877
 
31837
31878
  "use strict";
31838
31879
  /* unused harmony export imageProperties */
31839
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31880
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31840
31881
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53557);
31841
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51431);
31842
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
31843
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64962);
31844
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35102);
31845
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60485);
31846
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21391);
31847
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(61115);
31848
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98231);
31849
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9118);
31850
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85480);
31882
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23545);
31883
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51431);
31884
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9596);
31885
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67141);
31886
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64962);
31887
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(61115);
31888
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91675);
31889
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77137);
31890
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91852);
31891
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61566);
31892
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48570);
31851
31893
  /*!
31852
31894
  * Jodit Editor (https://xdsoft.net/jodit/)
31853
31895
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31879,55 +31921,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31879
31921
  * });
31880
31922
  * ```
31881
31923
  */
31882
- const normalSizeToString = (value) => {
31883
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31884
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31885
- };
31886
- const normalSizeFromString = (value) => {
31887
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31888
- ? parseFloat(value.toString())
31889
- : value;
31890
- };
31891
31924
  /**
31892
31925
  * Show dialog with image's options
31893
31926
  */
31894
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31927
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31895
31928
  constructor() {
31896
31929
  super(...arguments);
31897
31930
  this.state = {
31898
31931
  image: new Image(),
31932
+ sourceImage: new Image(),
31899
31933
  get ratio() {
31900
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31934
+ const { naturalWidth, naturalHeight } = this.image;
31935
+ return naturalWidth / naturalHeight || 1;
31901
31936
  },
31902
31937
  sizeIsLocked: true,
31903
- marginIsLocked: true
31938
+ marginIsLocked: true,
31939
+ values: {
31940
+ style: '',
31941
+ imageSrc: '',
31942
+ borderRadius: 0,
31943
+ imageTitle: '',
31944
+ imageAlt: '',
31945
+ imageLink: '',
31946
+ imageLinkOpenInNewTab: false,
31947
+ imageWidth: 0,
31948
+ imageHeight: 0,
31949
+ marginTop: 0,
31950
+ marginRight: 0,
31951
+ marginBottom: 0,
31952
+ marginLeft: 0,
31953
+ classes: '',
31954
+ id: '',
31955
+ align: ''
31956
+ }
31904
31957
  };
31905
31958
  this.activeTabState = {
31906
- __activeTab: 'Image'
31959
+ activeTab: 'Image'
31907
31960
  };
31908
31961
  }
31909
- onChangeMarginIsLocked() {
31910
- if (!this.form) {
31911
- return;
31912
- }
31913
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31914
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31915
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31962
+ get form() {
31963
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31964
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31965
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31916
31966
  });
31917
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31918
31967
  }
31919
- onChangeSizeIsLocked() {
31920
- if (!this.form) {
31921
- return;
31922
- }
31923
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31924
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31925
- lockSize.classList.remove('jodit-properties__lock');
31926
- lockSize.classList.remove('jodit-properties__unlock');
31927
- lockSize.classList.add(this.state.sizeIsLocked
31928
- ? 'jodit-properties__lock'
31929
- : 'jodit-properties__unlock');
31930
- this.j.e.fire(imageWidth, 'change');
31968
+ /**
31969
+ * Dialog for form
31970
+ */
31971
+ get dialog() {
31972
+ const { j } = this;
31973
+ const dialog = j.dlg({
31974
+ minWidth: Math.min(400, screen.width),
31975
+ minHeight: 590,
31976
+ buttons: ['fullsize', 'dialog.close']
31977
+ });
31978
+ const buttons = this.__buttons;
31979
+ buttons.check.onAction(() => {
31980
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31981
+ j.synchronizeValues();
31982
+ dialog.close();
31983
+ });
31984
+ buttons.remove.onAction(() => {
31985
+ j.s.removeNode(this.state.sourceImage);
31986
+ dialog.close();
31987
+ });
31988
+ buttons.cancel.onAction(() => {
31989
+ dialog.close();
31990
+ });
31991
+ dialog.setHeader(j.i18n('Image properties'));
31992
+ dialog.setContent(this.form);
31993
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31994
+ j.e.on(dialog, 'afterClose', () => {
31995
+ if (this.state.image.parentNode &&
31996
+ j.o.image.selectImageAfterClose) {
31997
+ j.s.select(this.state.sourceImage);
31998
+ }
31999
+ });
32000
+ dialog.setSize(j.o.image.dialogWidth);
32001
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
32002
+ return dialog;
32003
+ }
32004
+ get __buttons() {
32005
+ const { j } = this;
32006
+ return {
32007
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
32008
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
32009
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
32010
+ };
31931
32011
  }
31932
32012
  /**
31933
32013
  * Open dialog editing image properties
@@ -31944,358 +32024,28 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31944
32024
  * ```
31945
32025
  */
31946
32026
  open() {
31947
- this.makeForm();
31948
- this.activeTabState.__activeTab = 'Image';
31949
- this.j.e.fire('hidePopup');
31950
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31951
- this.state.marginIsLocked = true;
31952
- this.state.sizeIsLocked = true;
31953
- this.onChangeMarginIsLocked();
31954
- this.onChangeSizeIsLocked();
31955
- this.updateValues();
32027
+ this.activeTabState.activeTab = 'Image';
32028
+ this.__lock();
31956
32029
  this.dialog.open().setModal(true).setPosition();
31957
- return false;
31958
- }
31959
- /**
31960
- * Create form for edit image properties
31961
- */
31962
- makeForm() {
31963
- if (this.dialog) {
31964
- return;
31965
- }
31966
- this.dialog = this.j.dlg({
31967
- minWidth: Math.min(400, screen.width),
31968
- minHeight: 590,
31969
- buttons: ['fullsize', 'dialog.close']
31970
- });
31971
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31972
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31973
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31974
- };
31975
- editor.e.on(this.dialog, 'afterClose', () => {
31976
- if (this.state.image.parentNode &&
31977
- opt.image.selectImageAfterClose) {
31978
- editor.s.select(this.state.image);
31979
- }
31980
- });
31981
- buttons.remove.onAction(() => {
31982
- editor.s.removeNode(this.state.image);
31983
- this.dialog.close();
31984
- });
31985
- const { dialog } = this;
31986
- dialog.setHeader(i18n('Image properties'));
31987
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31988
- this.form = mainForm;
31989
- dialog.setContent(mainForm);
31990
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31991
- if (tabsBox) {
31992
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31993
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31994
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31995
- ], this.activeTabState));
31996
- }
31997
- buttons.check.onAction(this.onApply);
31998
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31999
- editor.e.on(changeImage, 'click', this.openImagePopup);
32000
- if (opt.image.useImageEditor) {
32001
- editor.e.on(editImage, 'click', this.openImageEditor);
32002
- }
32003
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
32004
- if (lockSize) {
32005
- editor.e.on(lockSize, 'click', () => {
32006
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
32007
- });
32008
- }
32009
- editor.e.on(lockMargin, 'click', (e) => {
32010
- this.state.marginIsLocked = !this.state.marginIsLocked;
32011
- e.preventDefault();
32012
- });
32013
- const changeSizes = (event) => {
32014
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
32015
- return;
32016
- }
32017
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
32018
- if (event.target === imageWidth) {
32019
- imageHeight.value = Math.round(w / this.state.ratio).toString();
32020
- }
32021
- else {
32022
- imageWidth.value = Math.round(h * this.state.ratio).toString();
32023
- }
32024
- };
32025
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
32026
- if (!this.state.sizeIsLocked) {
32027
- return;
32028
- }
32029
- editor.async.setTimeout(changeSizes.bind(this, event), {
32030
- timeout: editor.defaultTimeout,
32031
- label: 'image-properties-changeSize'
32032
- });
32033
- });
32034
- dialog.setFooter([buttons.remove, buttons.check]);
32035
- dialog.setSize(this.j.o.image.dialogWidth);
32036
- }
32037
- /**
32038
- * Set input values from image
32039
- */
32040
- updateValues() {
32041
- const opt = this.j.o;
32042
- const { image } = this.state;
32043
- 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);
32044
- const updateLock = () => {
32045
- lockMargin.checked = this.state.marginIsLocked;
32046
- lockSize.checked = this.state.sizeIsLocked;
32047
- }, updateAlign = () => {
32048
- if (image.style.cssFloat &&
32049
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
32050
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
32051
- }
32052
- else {
32053
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
32054
- image.style.marginLeft === 'auto' &&
32055
- image.style.marginRight === 'auto') {
32056
- align.value = 'center';
32057
- }
32058
- }
32059
- }, updateBorderRadius = () => {
32060
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
32061
- }, updateId = () => {
32062
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
32063
- }, updateStyle = () => {
32064
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
32065
- }, updateClasses = () => {
32066
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
32067
- }, updateMargins = () => {
32068
- if (!opt.image.editMargins) {
32069
- return;
32070
- }
32071
- let equal = true, wasEmptyField = false;
32072
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
32073
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
32074
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
32075
- if (!value) {
32076
- wasEmptyField = true;
32077
- elm.value = '';
32078
- return;
32079
- }
32080
- if (/^[0-9]+(px)?$/.test(value)) {
32081
- value = parseInt(value, 10);
32082
- }
32083
- elm.value = value.toString() || '';
32084
- if ((wasEmptyField && elm.value) ||
32085
- (equal &&
32086
- id !== 'marginTop' &&
32087
- elm.value !== marginTop.value)) {
32088
- equal = false;
32089
- }
32090
- });
32091
- this.state.marginIsLocked = equal;
32092
- }, updateSizes = () => {
32093
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
32094
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
32095
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
32096
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
32097
- false;
32098
- imageWidth.value =
32099
- width !== false
32100
- ? normalSizeFromString(width).toString()
32101
- : image.offsetWidth.toString();
32102
- imageHeight.value =
32103
- height !== false
32104
- ? normalSizeFromString(height).toString()
32105
- : image.offsetHeight.toString();
32106
- this.state.sizeIsLocked = (() => {
32107
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
32108
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
32109
- return false;
32110
- }
32111
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
32112
- return Math.abs(w - h * this.state.ratio) < 1;
32113
- })();
32114
- }, updateText = () => {
32115
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
32116
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
32117
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
32118
- if (a) {
32119
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
32120
- imageLinkOpenInNewTab.checked =
32121
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
32122
- }
32123
- else {
32124
- imageLink.value = '';
32125
- imageLinkOpenInNewTab.checked = false;
32126
- }
32127
- }, updateSrc = () => {
32128
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
32129
- if (imageViewSrc) {
32130
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
32131
- }
32132
- };
32133
- updateLock();
32134
- updateSrc();
32135
- updateText();
32136
- updateSizes();
32137
- updateMargins();
32138
- updateClasses();
32139
- updateId();
32140
- updateBorderRadius();
32141
- updateAlign();
32142
- updateStyle();
32143
- }
32144
- /**
32145
- * Apply form's values to image
32146
- */
32147
- onApply() {
32148
- 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);
32149
- const opt = this.j.o;
32150
- const { image } = this.state;
32151
- // styles
32152
- if (opt.image.editStyle) {
32153
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
32154
- }
32155
- // Src
32156
- if (imageSrc.value) {
32157
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
32158
- }
32159
- else {
32160
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
32161
- this.dialog.close();
32162
- return;
32163
- }
32164
- // Border radius
32165
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
32166
- image.style.borderRadius = borderRadius.value + 'px';
32167
- }
32168
- else {
32169
- image.style.borderRadius = '';
32170
- }
32171
- // Title
32172
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
32173
- // Alt
32174
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
32175
- // Link
32176
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
32177
- if (imageLink.value) {
32178
- if (!link) {
32179
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
32180
- }
32181
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
32182
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
32183
- }
32184
- else {
32185
- if (link && link.parentNode) {
32186
- link.parentNode.replaceChild(image, link);
32187
- }
32188
- }
32189
- // Size
32190
- if (imageWidth.value !== image.offsetWidth.toString() ||
32191
- imageHeight.value !== image.offsetHeight.toString()) {
32192
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
32193
- ? normalSizeToString(imageWidth.value)
32194
- : null;
32195
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
32196
- ? normalSizeToString(imageHeight.value)
32197
- : null;
32198
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
32199
- width: updatedtWidth,
32200
- height: updatedHeight
32201
- });
32202
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
32203
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
32204
- }
32205
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
32206
- if (opt.image.editMargins) {
32207
- if (!this.state.marginIsLocked) {
32208
- margins.forEach((margin) => {
32209
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
32210
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
32211
- });
32212
- }
32213
- else {
32214
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
32215
- }
32216
- }
32217
- if (opt.image.editClass) {
32218
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
32219
- }
32220
- if (opt.image.editId) {
32221
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
32222
- }
32223
- if (opt.image.editAlign) {
32224
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
32225
- }
32226
- this.j.synchronizeValues();
32227
- this.dialog.close();
32228
- }
32229
- /**
32230
- * Open image editor dialog
32231
- */
32232
- openImageEditor() {
32233
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
32234
- if (a.host !== location.host) {
32235
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32236
- if (yes && this.j.uploader) {
32237
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32238
- this.j.alert('The image has been successfully uploaded to the host!', () => {
32239
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
32240
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
32241
- resp.newfilename);
32242
- this.updateValues();
32243
- }
32244
- });
32245
- }, error => {
32246
- this.j.alert('There was an error loading %s', error.message);
32247
- });
32248
- }
32249
- });
32250
- return;
32030
+ this.async
32031
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
32032
+ .catch((e) => {
32033
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
32034
+ this.dialog.message.error(e.message);
32251
32035
  }
32252
- };
32253
- a.href = url;
32254
- this.j.filebrowser.dataProvider
32255
- .getPathByUrl(a.href.toString())
32256
- .then(resp => {
32257
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32258
- const timestamp = new Date().getTime();
32259
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
32260
- (url.indexOf('?') !== -1 ? '' : '?') +
32261
- '&_tmp=' +
32262
- timestamp.toString());
32263
- this.updateValues();
32264
- }, error => {
32265
- this.j.alert(error.message);
32266
- });
32267
32036
  })
32268
- .catch(error => {
32269
- this.j.alert(error.message, loadExternal);
32270
- });
32037
+ .finally(() => this.__unlock());
32038
+ return false;
32271
32039
  }
32272
- /**
32273
- * Open popup with filebrowser/uploader buttons for image
32274
- */
32275
- openImagePopup(event) {
32276
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
32277
- popup.setZIndex(this.dialog.getZIndex() + 1);
32278
- popup
32279
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
32280
- upload: (data) => {
32281
- if (data.files && data.files.length) {
32282
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
32283
- }
32284
- this.updateValues();
32285
- popup.close();
32286
- },
32287
- filebrowser: (data) => {
32288
- if (data &&
32289
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
32290
- data.files.length) {
32291
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
32292
- popup.close();
32293
- this.updateValues();
32294
- }
32295
- }
32296
- }, this.state.image, popup.close))
32297
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
32298
- event.stopPropagation();
32040
+ __lock() {
32041
+ this.dialog.lock();
32042
+ this.form.setMod('lock', true);
32043
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
32044
+ }
32045
+ __unlock() {
32046
+ this.dialog.unlock();
32047
+ this.form.setMod('lock', false);
32048
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
32299
32049
  }
32300
32050
  /** @override **/
32301
32051
  afterInit(editor) {
@@ -32306,7 +32056,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
32306
32056
  .off(editor.editor, '.imageproperties')
32307
32057
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
32308
32058
  const image = e.target;
32309
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
32059
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
32310
32060
  return;
32311
32061
  }
32312
32062
  if (editor.o.image.openOnDblClick) {
@@ -32314,7 +32064,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
32314
32064
  false) {
32315
32065
  return;
32316
32066
  }
32317
- self.state.image = image;
32067
+ self.state.sourceImage = image;
32068
+ self.state.image = image.cloneNode(true);
32318
32069
  if (!editor.o.readonly) {
32319
32070
  e.stopImmediatePropagation();
32320
32071
  e.preventDefault();
@@ -32328,206 +32079,1252 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
32328
32079
  });
32329
32080
  })
32330
32081
  .on('openImageProperties.imageproperties', (image) => {
32331
- this.state.image = image;
32082
+ self.state.sourceImage = image;
32083
+ this.state.image = image.cloneNode(true);
32332
32084
  this.open();
32333
32085
  });
32334
32086
  }
32087
+ async onStateValuesImageSrcChange() {
32088
+ const { image, values } = this.state;
32089
+ if (!image.src) {
32090
+ return;
32091
+ }
32092
+ try {
32093
+ this.__lock();
32094
+ await image.decode();
32095
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
32096
+ const w = parseFloat(values.imageWidth.toString());
32097
+ values.imageHeight = Math.round(w / this.state.ratio);
32098
+ }
32099
+ this.j.e.fire('updateImageProperties.imageproperties', image);
32100
+ }
32101
+ catch (e) {
32102
+ this.j.alert(e.message);
32103
+ }
32104
+ finally {
32105
+ this.__unlock();
32106
+ }
32107
+ }
32335
32108
  /** @override */
32336
32109
  beforeDestruct(editor) {
32337
- this.dialog && this.dialog.destruct();
32110
+ Object.values((0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons') ?? {}).forEach(b => b.destruct());
32111
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')?.destruct();
32112
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')?.destruct();
32338
32113
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
32339
32114
  }
32340
32115
  }
32341
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32342
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
32343
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
32344
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32345
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
32346
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
32347
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32348
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
32349
- ], imageProperties.prototype, "onApply", null);
32350
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32351
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
32352
- ], imageProperties.prototype, "openImageEditor", null);
32353
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
32354
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
32355
- ], imageProperties.prototype, "openImagePopup", null);
32356
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
32116
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32117
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
32118
+ ], imageProperties.prototype, "form", null);
32119
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32120
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
32121
+ ], imageProperties.prototype, "dialog", null);
32122
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32123
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
32124
+ ], imageProperties.prototype, "__buttons", null);
32125
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
32126
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
32127
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
32128
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
32357
32129
 
32358
32130
 
32359
32131
  /***/ }),
32360
32132
 
32361
- /***/ 98231:
32133
+ /***/ 81091:
32362
32134
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32363
32135
 
32364
32136
  "use strict";
32365
32137
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32366
- /* harmony export */ Z: function() { return /* binding */ form; }
32138
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
32367
32139
  /* harmony export */ });
32368
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32140
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4401);
32141
+ /*!
32142
+ * Jodit Editor (https://xdsoft.net/jodit/)
32143
+ * Released under MIT see LICENSE.txt in the project root for license information.
32144
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32145
+ */
32146
+
32147
+ /** @private */
32148
+ function readAlign(image, values) {
32149
+ // Align
32150
+ if (image.style.cssFloat &&
32151
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
32152
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
32153
+ }
32154
+ else {
32155
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
32156
+ image.style.marginLeft === 'auto' &&
32157
+ image.style.marginRight === 'auto') {
32158
+ values.align = 'center';
32159
+ }
32160
+ else {
32161
+ values.align = '';
32162
+ }
32163
+ }
32164
+ }
32165
+
32166
+
32167
+ /***/ }),
32168
+
32169
+ /***/ 61566:
32170
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32171
+
32172
+ "use strict";
32173
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32174
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
32175
+ /* harmony export */ });
32176
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32177
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81091);
32178
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33756);
32179
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51462);
32180
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60225);
32181
+ /*!
32182
+ * Jodit Editor (https://xdsoft.net/jodit/)
32183
+ * Released under MIT see LICENSE.txt in the project root for license information.
32184
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32185
+ */
32186
+
32187
+
32188
+
32189
+
32190
+
32191
+ /**
32192
+ * Read values from image and set it to state
32193
+ * @private
32194
+ */
32195
+ async function readValuesFromImage(j, state) {
32196
+ const { sourceImage: image, values } = state;
32197
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__/* .readAlign */ .g)(image, values);
32198
+ // Border radius
32199
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
32200
+ // Id
32201
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
32202
+ // Title
32203
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
32204
+ // Alt
32205
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
32206
+ // Style
32207
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
32208
+ // Classes
32209
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
32210
+ // Margins
32211
+ (0,_margin__WEBPACK_IMPORTED_MODULE_4__/* .readMargins */ .E)(image, values, state);
32212
+ // Link
32213
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
32214
+ // Src
32215
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
32216
+ // Image size
32217
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
32218
+ }
32219
+
32220
+
32221
+ /***/ }),
32222
+
32223
+ /***/ 33756:
32224
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32225
+
32226
+ "use strict";
32227
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32228
+ /* harmony export */ X: function() { return /* binding */ readLink; }
32229
+ /* harmony export */ });
32230
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
32231
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97099);
32369
32232
  /*!
32370
32233
  * Jodit Editor (https://xdsoft.net/jodit/)
32371
32234
  * Released under MIT see LICENSE.txt in the project root for license information.
32372
32235
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32373
32236
  */
32374
32237
 
32375
- function form(editor) {
32376
- 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);
32377
- return editor.c.fromHTML(`<form class="jodit-properties">
32238
+
32239
+ /** @private */
32240
+ function readLink(state, j, values) {
32241
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
32242
+ if (a) {
32243
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
32244
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
32245
+ }
32246
+ else {
32247
+ values.imageLink = '';
32248
+ values.imageLinkOpenInNewTab = false;
32249
+ }
32250
+ }
32251
+
32252
+
32253
+ /***/ }),
32254
+
32255
+ /***/ 51462:
32256
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32257
+
32258
+ "use strict";
32259
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32260
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
32261
+ /* harmony export */ });
32262
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18014);
32263
+ /*!
32264
+ * Jodit Editor (https://xdsoft.net/jodit/)
32265
+ * Released under MIT see LICENSE.txt in the project root for license information.
32266
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32267
+ */
32268
+
32269
+ /** @private */
32270
+ function readMargins(image, values, state) {
32271
+ // Margins
32272
+ let equal = true, wasEmptyField = false;
32273
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
32274
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
32275
+ if (!value) {
32276
+ wasEmptyField = true;
32277
+ values[id] = 0;
32278
+ return;
32279
+ }
32280
+ if (/^[0-9]+(px)?$/.test(value)) {
32281
+ value = parseInt(value, 10);
32282
+ }
32283
+ values[id] = value;
32284
+ if ((wasEmptyField && values[id]) ||
32285
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
32286
+ equal = false;
32287
+ }
32288
+ });
32289
+ state.marginIsLocked = equal;
32290
+ }
32291
+
32292
+
32293
+ /***/ }),
32294
+
32295
+ /***/ 60225:
32296
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32297
+
32298
+ "use strict";
32299
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32300
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
32301
+ /* harmony export */ });
32302
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59372);
32303
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32304
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4401);
32305
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10926);
32306
+ /*!
32307
+ * Jodit Editor (https://xdsoft.net/jodit/)
32308
+ * Released under MIT see LICENSE.txt in the project root for license information.
32309
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32310
+ */
32311
+
32312
+
32313
+
32314
+
32315
+ /** @private */
32316
+ async function readSizes(image, values, state) {
32317
+ await image.decode();
32318
+ const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'width', true) || false;
32319
+ const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'height', true) || false;
32320
+ values.imageWidth =
32321
+ width !== false
32322
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
32323
+ : image.offsetWidth || image.naturalWidth;
32324
+ values.imageHeight =
32325
+ height !== false
32326
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
32327
+ : image.offsetHeight || image.naturalHeight;
32328
+ const { imageWidth, imageHeight } = values;
32329
+ const w = parseFloat(imageWidth.toString());
32330
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageHeight)) {
32331
+ state.sizeIsLocked = false;
32332
+ return;
32333
+ }
32334
+ if (height === false) {
32335
+ values.imageHeight = Math.round(w / state.ratio);
32336
+ state.sizeIsLocked = true;
32337
+ return;
32338
+ }
32339
+ const h = parseFloat(imageHeight.toString());
32340
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
32341
+ }
32342
+
32343
+
32344
+ /***/ }),
32345
+
32346
+ /***/ 91675:
32347
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32348
+
32349
+ "use strict";
32350
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32351
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
32352
+ /* harmony export */ });
32353
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
32354
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53557);
32355
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12222);
32356
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9596);
32357
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1530);
32358
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80004);
32359
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21391);
32360
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26282);
32361
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26180);
32362
+ /*!
32363
+ * Jodit Editor (https://xdsoft.net/jodit/)
32364
+ * Released under MIT see LICENSE.txt in the project root for license information.
32365
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32366
+ */
32367
+
32368
+
32369
+
32370
+
32371
+
32372
+
32373
+
32374
+
32375
+
32376
+
32377
+ /** @private */
32378
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
32379
+ className() {
32380
+ return 'UIImagePropertiesForm';
32381
+ }
32382
+ appendChildToContainer() { }
32383
+ getElm(elementName) {
32384
+ const selfElm = super.getElm(elementName);
32385
+ if (selfElm) {
32386
+ return selfElm;
32387
+ }
32388
+ for (const child of this.elements) {
32389
+ const elm = child.getElm(elementName);
32390
+ if (elm) {
32391
+ return elm;
32392
+ }
32393
+ }
32394
+ return null;
32395
+ }
32396
+ constructor(jodit, state, activeTabState, handlers) {
32397
+ super(jodit);
32398
+ this.state = state;
32399
+ this.handlers = handlers;
32400
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
32401
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
32402
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
32403
+ { name: 'Image', content: this.__mainTab },
32404
+ { name: 'Advanced', content: this.__positionTab }
32405
+ ], activeTabState));
32406
+ this.setMod('lock-size', this.state.sizeIsLocked);
32407
+ this.append(this.__mainTab).append(this.__positionTab);
32408
+ }
32409
+ render() {
32410
+ return `<form>
32378
32411
  <div class="jodit-grid jodit-grid_xs-column">
32379
32412
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
32380
- <div class="jodit-properties_view_box">
32381
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
32382
- <img data-ref="imageViewSrc" src="" alt=""/>
32413
+ <div class="&__view-box">
32414
+ <div class="&__imageView">
32415
+ <img class="&__imageViewSrc" src="" alt=""/>
32383
32416
  </div>
32384
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
32385
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
32386
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
32387
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
32417
+ <div class="jodit-form__group &__imageSizes">
32418
+ <input type="text" class="jodit-input &__imageWidth"/>
32419
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
32420
+ <input type="text" class="&__imageHeight jodit-input"/>
32388
32421
  </div>
32389
32422
  </div>
32390
32423
  </div>
32391
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
32424
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
32392
32425
  </div>
32393
- </form>`);
32394
- }
32426
+ </form>`;
32427
+ }
32428
+ onChangeSizeIsLocked() {
32429
+ const lockSize = this.getElm('lockSize');
32430
+ const imageWidth = this.getElm('imageWidth');
32431
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
32432
+ this.setMod('lock-size', this.state.sizeIsLocked);
32433
+ this.j.e.fire(imageWidth, 'change');
32434
+ }
32435
+ onLockSizeClick() {
32436
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
32437
+ }
32438
+ onStateValuesSizeChange() {
32439
+ const imageWidth = this.getElm('imageWidth');
32440
+ const imageHeight = this.getElm('imageHeight');
32441
+ if (imageWidth !== this.j.od.activeElement) {
32442
+ imageWidth.value = this.state.values.imageWidth.toString();
32443
+ }
32444
+ if (imageHeight !== this.j.od.activeElement) {
32445
+ imageHeight.value = this.state.values.imageHeight.toString();
32446
+ }
32447
+ }
32448
+ onImageWidthChange(e) {
32449
+ const imageWidth = this.getElm('imageWidth');
32450
+ const imageHeight = this.getElm('imageHeight');
32451
+ if (!this.state.sizeIsLocked ||
32452
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
32453
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
32454
+ this.state.values.imageWidth = imageWidth.value;
32455
+ this.state.values.imageHeight = imageHeight.value;
32456
+ return;
32457
+ }
32458
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
32459
+ if (e.target === imageWidth) {
32460
+ this.state.values.imageWidth = w;
32461
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
32462
+ }
32463
+ else {
32464
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
32465
+ this.state.values.imageHeight = h;
32466
+ }
32467
+ }
32468
+ onStateValuesImageSrcChange() {
32469
+ const { imageSrc } = this.state.values;
32470
+ if (!imageSrc) {
32471
+ return;
32472
+ }
32473
+ const imageViewSrc = this.getElm('imageViewSrc');
32474
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
32475
+ const image = new Image();
32476
+ image.src = imageSrc;
32477
+ this.state.image = image;
32478
+ }
32479
+ hideFieldByOptions() {
32480
+ const opt = this.j.o.image;
32481
+ [
32482
+ ['editSize', 'imageSizes'],
32483
+ ['showPreview', 'imageView']
32484
+ ].forEach(([optKey, elmKey]) => {
32485
+ const elm = this.getElm(elmKey);
32486
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
32487
+ });
32488
+ }
32489
+ };
32490
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32491
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
32492
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
32493
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
32494
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32495
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
32496
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
32497
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32498
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
32499
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
32500
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
32501
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32502
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
32503
+ 'imageWidth:change',
32504
+ 'imageHeight:change',
32505
+ 'imageWidth:keydown',
32506
+ 'imageHeight:keydown',
32507
+ 'imageWidth:mousedown',
32508
+ 'imageHeight:mousedown',
32509
+ 'imageWidth:paste',
32510
+ 'imageHeight:paste'
32511
+ ]),
32512
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
32513
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
32514
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32515
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
32516
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
32517
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
32518
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32519
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
32520
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
32521
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
32522
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
32523
+ ], UIImagePropertiesForm);
32524
+
32395
32525
 
32396
32526
 
32397
32527
  /***/ }),
32398
32528
 
32399
- /***/ 9118:
32529
+ /***/ 26282:
32400
32530
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32401
32531
 
32402
32532
  "use strict";
32403
32533
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32404
- /* harmony export */ J: function() { return /* binding */ mainTab; }
32534
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
32405
32535
  /* harmony export */ });
32406
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32536
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
32537
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12222);
32538
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27582);
32539
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24014);
32540
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
32541
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1530);
32407
32542
  /*!
32408
32543
  * Jodit Editor (https://xdsoft.net/jodit/)
32409
32544
  * Released under MIT see LICENSE.txt in the project root for license information.
32410
32545
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32411
32546
  */
32412
32547
 
32413
- function mainTab(editor) {
32414
- 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;
32415
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
32416
- <label>${i18n('Src')}</label>
32548
+
32549
+
32550
+
32551
+
32552
+
32553
+ /** @private */
32554
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
32555
+ className() {
32556
+ return 'UIImageMainTab';
32557
+ }
32558
+ appendChildToContainer() {
32559
+ // Do nothing
32560
+ }
32561
+ constructor(view, state, handlers) {
32562
+ super(view);
32563
+ this.state = state;
32564
+ this.handlers = handlers;
32565
+ }
32566
+ render() {
32567
+ return `<div class="jodit-form__group &__editSrc">
32568
+ <label>~Src~</label>
32417
32569
  <div class="jodit-input_group">
32418
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
32419
- <div
32420
- class="jodit-input_group-buttons"
32421
- style="${hasFbUrl ? '' : 'display: none'}"
32422
- >
32423
- <a
32424
- data-ref="changeImage"
32425
- class="jodit-button"
32426
- >${gi('image')}</a>
32427
- <a
32428
- data-ref="editImage"
32429
- class="jodit-button"
32430
- style="${hasEditor ? '' : 'display: none'}"
32431
- >${gi('crop')}</a>
32570
+ <input class="jodit-input &__imageSrc" type="text"/>
32571
+ <div class="jodit-input_group-buttons &__fixImage">
32572
+ <a class="jodit-button &__changeImage">*image*</a>
32573
+ <a class="jodit-button &__editImage">*crop*</a>
32432
32574
  </div>
32433
32575
  </div>
32434
32576
  </div>
32435
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
32436
- <label>${i18n('Title')}</label>
32437
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
32577
+ <div class="jodit-form__group &__editTitle">
32578
+ <label>~Title~</label>
32579
+ <input type="text" class="jodit-input &__imageTitle"/>
32438
32580
  </div>
32439
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
32440
- <label>${i18n('Alternative')}</label>
32441
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
32581
+ <div class="jodit-form__group &__editAlt">
32582
+ <label>~Alternative~</label>
32583
+ <input type="text" class="jodit-input &__imageAlt"/>
32442
32584
  </div>
32443
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
32444
- <label>${i18n('Link')}</label>
32445
- <input data-ref="imageLink" type="text" class="jodit-input"/>
32585
+ <div class="jodit-form__group &__editLink">
32586
+ <label>~Link~</label>
32587
+ <input type="text" class="jodit-input &__imageLink"/>
32446
32588
  </div>
32447
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
32589
+ <div class="jodit-form__group &__editLinkTarget">
32448
32590
  <label class="jodit_vertical_middle">
32449
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
32450
- <span>${i18n('Open link in new tab')}</span>
32591
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
32592
+ <span>~Open link in new tab~</span>
32451
32593
  </label>
32452
- </div>`);
32453
- }
32594
+ </div>`;
32595
+ }
32596
+ async onStateImageSrcChange() {
32597
+ const imageSrc = this.getElm('imageSrc');
32598
+ imageSrc.value = this.state.values.imageSrc;
32599
+ }
32600
+ onImageSrcChange() {
32601
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
32602
+ }
32603
+ /**
32604
+ * Open image editor
32605
+ */
32606
+ onEditImageClick(e) {
32607
+ this.handlers.openImageEditor();
32608
+ e.stopPropagation();
32609
+ }
32610
+ /**
32611
+ * Open popup with filebrowser/uploader buttons for image
32612
+ */
32613
+ onChangeImageClick(e) {
32614
+ this.handlers.openImagePopup(this.getElm('changeImage'));
32615
+ e.stopPropagation();
32616
+ }
32617
+ onStateTitleChange() {
32618
+ const title = this.getElm('imageTitle');
32619
+ title.value = this.state.values.imageTitle;
32620
+ }
32621
+ onTitleChange() {
32622
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
32623
+ }
32624
+ onStateAltChange() {
32625
+ const alt = this.getElm('imageAlt');
32626
+ alt.value = this.state.values.imageAlt;
32627
+ }
32628
+ onAltChange() {
32629
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
32630
+ }
32631
+ onStateImageLinkChange() {
32632
+ const imageLink = this.getElm('imageLink');
32633
+ imageLink.value = this.state.values.imageLink;
32634
+ }
32635
+ onImageLinkChange() {
32636
+ this.state.values.imageLink = this.getElm('imageLink').value;
32637
+ }
32638
+ onStateImageLinkOpenInNewTabChange() {
32639
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
32640
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
32641
+ }
32642
+ onImageLinkOpenInNewTabChange() {
32643
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
32644
+ }
32645
+ hideFieldByOptions() {
32646
+ const o = this.j.o;
32647
+ const opt = o.image;
32648
+ [
32649
+ ['editSrc', 'editSrc'],
32650
+ ['editTitle', 'editTitle'],
32651
+ ['editAlt', 'editAlt'],
32652
+ ['editLink', 'editLink'],
32653
+ ['editLink', 'editLinkTarget'],
32654
+ ['useImageEditor', 'editImage']
32655
+ ].forEach(([optKey, elmKey]) => {
32656
+ const elm = this.getElm(elmKey);
32657
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32658
+ });
32659
+ const changeImage = this.getElm('changeImage');
32660
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
32661
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
32662
+ const editImage = this.getElm('editImage');
32663
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
32664
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
32665
+ const fixImage = this.getElm('fixImage');
32666
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
32667
+ }
32668
+ };
32669
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32670
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
32671
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
32672
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32673
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
32674
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
32675
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32676
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
32677
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
32678
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32679
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
32680
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
32681
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32682
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
32683
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
32684
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32685
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
32686
+ ], UIImageMainTab.prototype, "onTitleChange", null);
32687
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32688
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
32689
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
32690
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32691
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
32692
+ ], UIImageMainTab.prototype, "onAltChange", null);
32693
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32694
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
32695
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
32696
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32697
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
32698
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
32699
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32700
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
32701
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
32702
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32703
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
32704
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
32705
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32706
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32707
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
32708
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32709
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
32710
+ ], UIImageMainTab);
32711
+
32454
32712
 
32455
32713
 
32456
32714
  /***/ }),
32457
32715
 
32458
- /***/ 85480:
32716
+ /***/ 26180:
32459
32717
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32460
32718
 
32461
32719
  "use strict";
32462
32720
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32463
- /* harmony export */ b: function() { return /* binding */ positionTab; }
32721
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
32464
32722
  /* harmony export */ });
32465
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32723
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
32724
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12222);
32725
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27582);
32726
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24014);
32727
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
32728
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26986);
32729
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97099);
32730
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65685);
32731
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80004);
32732
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10926);
32466
32733
  /*!
32467
32734
  * Jodit Editor (https://xdsoft.net/jodit/)
32468
32735
  * Released under MIT see LICENSE.txt in the project root for license information.
32469
32736
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32470
32737
  */
32471
32738
 
32472
- function positionTab(editor) {
32473
- 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);
32474
- const classInput = [];
32475
- if (opt.image.availableClasses.length > 0) {
32476
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
32477
- opt.image.availableClasses.forEach(item => {
32478
- if (typeof item === 'string') {
32479
- classInput.push(`<option value="${item}">${item}</option>`);
32480
- }
32481
- else {
32482
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32483
- }
32484
- });
32485
- classInput.push('</select>');
32739
+
32740
+
32741
+
32742
+
32743
+
32744
+
32745
+
32746
+
32747
+
32748
+ /** @private */
32749
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
32750
+ className() {
32751
+ return 'UIImagePositionTab';
32486
32752
  }
32487
- else {
32488
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
32753
+ constructor(jodit, state, handlers) {
32754
+ super(jodit, {
32755
+ availableClasses: jodit.o.image.availableClasses
32756
+ });
32757
+ this.state = state;
32758
+ this.handlers = handlers;
32489
32759
  }
32490
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
32491
- <label>${i18n('Margins')}</label>
32760
+ render({ availableClasses }) {
32761
+ return `<div class="jodit-form__group &__editMargins">
32762
+ <label>~Margins~</label>
32492
32763
  <div class="jodit-grid jodit_vertical_middle">
32493
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
32494
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
32495
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
32496
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
32497
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
32764
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
32765
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
32766
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
32767
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
32768
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
32498
32769
  </div>
32499
32770
  </div>
32500
- <div
32501
- style="${!opt.image.editAlign ? 'display:none' : ''}"
32502
- class="jodit-form__group"
32503
- >
32504
- <label>${i18n('Align')}</label>
32505
- <select data-ref="align" class="jodit-select">
32506
- <option value="">${i18n('--Not Set--')}</option>
32507
- <option value="left">${i18n('Left')}</option>
32508
- <option value="center">${i18n('Center')}</option>
32509
- <option value="right">${i18n('Right')}</option>
32771
+ <div class="jodit-form__group &__editAlign">
32772
+ <label>~Align~</label>
32773
+ <select class="jodit-select &__align">
32774
+ <option value="">~--Not Set--~</option>
32775
+ <option value="left">~Left~</option>
32776
+ <option value="center">~Center~</option>
32777
+ <option value="right">~Right~</option>
32510
32778
  </select>
32511
32779
  </div>
32512
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
32513
- <label>${i18n('Styles')}</label>
32514
- <input data-ref="style" type="text" class="jodit-input"/>
32780
+ <div class="jodit-form__group &__editStyle">
32781
+ <label>~Styles~</label>
32782
+ <input type="text" class="jodit-input &__style"/>
32515
32783
  </div>
32516
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
32517
- <label>${i18n('Classes')}</label>
32518
- ${classInput.join('')}
32784
+ <div class="jodit-form__group &__editClass">
32785
+ <label>~Classes~</label>
32786
+ ${(() => {
32787
+ const classInput = [];
32788
+ if (availableClasses && availableClasses.length > 0) {
32789
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
32790
+ availableClasses.forEach(item => {
32791
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
32792
+ classInput.push(`<option value="${item}">${item}</option>`);
32793
+ }
32794
+ else {
32795
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32796
+ }
32797
+ });
32798
+ classInput.push('</select>');
32799
+ }
32800
+ else {
32801
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32802
+ }
32803
+ return classInput.join('');
32804
+ })()}
32519
32805
  </div>
32520
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32806
+ <div class="jodit-form__group &__editId">
32521
32807
  <label>Id</label>
32522
- <input data-ref="id" type="text" class="jodit-input"/>
32808
+ <input type="text" class="jodit-input &__id"/>
32523
32809
  </div>
32524
32810
  <div
32525
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
32526
- class="jodit-form__group"
32811
+ class="jodit-form__group &__editBorderRadius"
32527
32812
  >
32528
- <label>${i18n('Border radius')}</label>
32529
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
32530
- </div>`);
32813
+ <label>~Border radius~</label>
32814
+ <input type="number" class="jodit-input &__borderRadius"/>
32815
+ </div>`;
32816
+ }
32817
+ onStateAlignChange() {
32818
+ const align = this.getElm('align');
32819
+ align.value = this.state.values.align;
32820
+ }
32821
+ onChangeAlign() {
32822
+ const align = this.getElm('align');
32823
+ this.state.values.align = align.value;
32824
+ }
32825
+ onStateValuesBorderRadiusChange() {
32826
+ const borderRadius = this.getElm('borderRadius');
32827
+ borderRadius.value = this.state.values.borderRadius.toString();
32828
+ }
32829
+ onChangeBorderRadius() {
32830
+ const borderRadius = this.getElm('borderRadius');
32831
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32832
+ }
32833
+ onStateValuesIdChange() {
32834
+ const id = this.getElm('id');
32835
+ id.value = this.state.values.id;
32836
+ }
32837
+ onChangeId() {
32838
+ const id = this.getElm('id');
32839
+ this.state.values.id = id.value;
32840
+ }
32841
+ onStateValuesStyleChange() {
32842
+ const style = this.getElm('style');
32843
+ style.value = this.state.values.style;
32844
+ }
32845
+ onChangeStyle() {
32846
+ const style = this.getElm('style');
32847
+ this.state.values.style = style.value;
32848
+ }
32849
+ onStateValuesClassesChange() {
32850
+ const classes = this.getElm('classes');
32851
+ classes.value = this.state.values.classes;
32852
+ }
32853
+ onChangClasses() {
32854
+ const classes = this.getElm('classes');
32855
+ this.state.values.classes = classes.value;
32856
+ }
32857
+ onLockMarginClick(e) {
32858
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32859
+ e.preventDefault();
32860
+ }
32861
+ onChangeMarginIsLocked() {
32862
+ const marginBottom = this.getElm('marginBottom');
32863
+ const marginRight = this.getElm('marginRight');
32864
+ const marginLeft = this.getElm('marginLeft');
32865
+ const lockMargin = this.getElm('lockMargin');
32866
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32867
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32868
+ });
32869
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32870
+ if (this.state.marginIsLocked) {
32871
+ const marginTop = this.state.values.marginTop;
32872
+ this.state.values.marginRight = marginTop;
32873
+ this.state.values.marginBottom = marginTop;
32874
+ this.state.values.marginLeft = marginTop;
32875
+ }
32876
+ }
32877
+ onStateValuesMarginChange() {
32878
+ const marginTop = this.getElm('marginTop');
32879
+ const marginRight = this.getElm('marginRight');
32880
+ const marginBottom = this.getElm('marginBottom');
32881
+ const marginLeft = this.getElm('marginLeft');
32882
+ marginTop.value = this.state.values.marginTop.toString();
32883
+ marginRight.value = this.state.values.marginRight.toString();
32884
+ marginBottom.value = this.state.values.marginBottom.toString();
32885
+ marginLeft.value = this.state.values.marginLeft.toString();
32886
+ }
32887
+ onChangeMargin() {
32888
+ const marginTop = this.getElm('marginTop');
32889
+ const marginRight = this.getElm('marginRight');
32890
+ const marginBottom = this.getElm('marginBottom');
32891
+ const marginLeft = this.getElm('marginLeft');
32892
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32893
+ if (this.state.marginIsLocked) {
32894
+ this.state.values.marginRight = this.state.values.marginTop;
32895
+ this.state.values.marginBottom = this.state.values.marginTop;
32896
+ this.state.values.marginLeft = this.state.values.marginTop;
32897
+ }
32898
+ else {
32899
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32900
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32901
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32902
+ }
32903
+ }
32904
+ hideFieldByOptions() {
32905
+ const opt = this.j.o.image;
32906
+ [
32907
+ ['editMargins', 'editMargins'],
32908
+ ['editAlign', 'editAlign'],
32909
+ ['editStyle', 'editStyle'],
32910
+ ['editClass', 'editClass'],
32911
+ ['editId', 'editId'],
32912
+ ['editBorderRadius', 'editBorderRadius']
32913
+ ].forEach(([optKey, elmKey]) => {
32914
+ const elm = this.getElm(elmKey);
32915
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32916
+ });
32917
+ }
32918
+ };
32919
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32920
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32921
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32922
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32923
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32924
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32925
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32926
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32927
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32928
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32929
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32930
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32931
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32932
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32933
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32934
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32935
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32936
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32937
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32938
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32939
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32940
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32941
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32942
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32943
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32944
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32945
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32946
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32947
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32948
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32949
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32950
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32951
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32952
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32953
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32954
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32955
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32956
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32957
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32958
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32959
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32960
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32961
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32962
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32963
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32964
+ 'state.values.marginTop',
32965
+ 'state.values.marginRight',
32966
+ 'state.values.marginBottom',
32967
+ 'state.values.marginLeft'
32968
+ ])
32969
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32970
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32971
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32972
+ 'marginTop:change',
32973
+ 'marginRight:change',
32974
+ 'marginBottom:change',
32975
+ 'marginLeft:change'
32976
+ ])
32977
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32978
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32979
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32980
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32981
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32982
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32983
+ ], UIImagePositionTab);
32984
+
32985
+
32986
+
32987
+ /***/ }),
32988
+
32989
+ /***/ 77137:
32990
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32991
+
32992
+ "use strict";
32993
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32994
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32995
+ /* harmony export */ });
32996
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26986);
32997
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32998
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60485);
32999
+ /*!
33000
+ * Jodit Editor (https://xdsoft.net/jodit/)
33001
+ * Released under MIT see LICENSE.txt in the project root for license information.
33002
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33003
+ */
33004
+
33005
+
33006
+
33007
+ /**
33008
+ * Open image editor dialog
33009
+ * @private
33010
+ */
33011
+ function openImageEditorDialog(j, state) {
33012
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
33013
+ if (a.host !== location.host) {
33014
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
33015
+ if (yes && j.uploader) {
33016
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
33017
+ j.alert('The image has been successfully uploaded to the host!', () => {
33018
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
33019
+ state.values.imageSrc =
33020
+ resp.baseurl +
33021
+ resp.newfilename;
33022
+ }
33023
+ });
33024
+ }, error => {
33025
+ j.alert('There was an error loading %s', error.message);
33026
+ });
33027
+ }
33028
+ });
33029
+ return;
33030
+ }
33031
+ };
33032
+ a.href = url;
33033
+ j.filebrowser.dataProvider
33034
+ .getPathByUrl(a.href.toString())
33035
+ .then(resp => {
33036
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
33037
+ const timestamp = new Date().getTime();
33038
+ state.values.imageSrc =
33039
+ url +
33040
+ (url.indexOf('?') !== -1 ? '' : '?') +
33041
+ '&_tmp=' +
33042
+ timestamp.toString();
33043
+ }, error => {
33044
+ j.alert(error.message);
33045
+ });
33046
+ })
33047
+ .catch(error => {
33048
+ j.alert(error.message, loadExternal);
33049
+ });
33050
+ }
33051
+
33052
+
33053
+ /***/ }),
33054
+
33055
+ /***/ 91852:
33056
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33057
+
33058
+ "use strict";
33059
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33060
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
33061
+ /* harmony export */ });
33062
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55010);
33063
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43977);
33064
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34138);
33065
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31784);
33066
+ /*!
33067
+ * Jodit Editor (https://xdsoft.net/jodit/)
33068
+ * Released under MIT see LICENSE.txt in the project root for license information.
33069
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33070
+ */
33071
+
33072
+
33073
+
33074
+
33075
+ /** @private */
33076
+ function openImagePopup(j, dialog, state, button) {
33077
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
33078
+ const closePopup = () => {
33079
+ popup.close();
33080
+ popup.destruct();
33081
+ };
33082
+ popup
33083
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
33084
+ upload: (data) => {
33085
+ if (data.files && data.files.length) {
33086
+ state.values.imageSrc =
33087
+ data.baseurl + data.files[0];
33088
+ }
33089
+ closePopup();
33090
+ },
33091
+ filebrowser: async (data) => {
33092
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .c)(data.files) && data.files.length) {
33093
+ state.values.imageSrc = data.files[0];
33094
+ closePopup();
33095
+ }
33096
+ }
33097
+ }, state.image, closePopup))
33098
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__/* .position */ .G)(button));
33099
+ }
33100
+
33101
+
33102
+ /***/ }),
33103
+
33104
+ /***/ 10926:
33105
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33106
+
33107
+ "use strict";
33108
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33109
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
33110
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
33111
+ /* harmony export */ });
33112
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72558);
33113
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22718);
33114
+ /*!
33115
+ * Jodit Editor (https://xdsoft.net/jodit/)
33116
+ * Released under MIT see LICENSE.txt in the project root for license information.
33117
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33118
+ */
33119
+
33120
+
33121
+ /** @private */
33122
+ const normalSizeFromString = (value) => {
33123
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
33124
+ ? parseFloat(value.toString())
33125
+ : value;
33126
+ };
33127
+ /** @private */
33128
+ const normalSizeToString = (value) => {
33129
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
33130
+ return value ? value + 'px' : value.toString();
33131
+ }
33132
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
33133
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
33134
+ };
33135
+
33136
+
33137
+ /***/ }),
33138
+
33139
+ /***/ 48570:
33140
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33141
+
33142
+ "use strict";
33143
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33144
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
33145
+ /* harmony export */ });
33146
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
33147
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71122);
33148
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9144);
33149
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82714);
33150
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26277);
33151
+ /*!
33152
+ * Jodit Editor (https://xdsoft.net/jodit/)
33153
+ * Released under MIT see LICENSE.txt in the project root for license information.
33154
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33155
+ */
33156
+
33157
+
33158
+
33159
+
33160
+
33161
+ /**
33162
+ * Apply form's values to image
33163
+ * @private
33164
+ */
33165
+ function applyValuesToImage(j, state, image) {
33166
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
33167
+ const opt = j.o;
33168
+ // styles
33169
+ if (opt.image.editStyle) {
33170
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
33171
+ }
33172
+ // Src
33173
+ if (imageSrc) {
33174
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
33175
+ }
33176
+ else {
33177
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
33178
+ return;
33179
+ }
33180
+ // Border radius
33181
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
33182
+ // Title
33183
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
33184
+ // Alt
33185
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
33186
+ // Link
33187
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
33188
+ // Size
33189
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
33190
+ // Margin
33191
+ if (j.o.image.editMargins) {
33192
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
33193
+ }
33194
+ if (opt.image.editClass) {
33195
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
33196
+ }
33197
+ if (opt.image.editId) {
33198
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
33199
+ }
33200
+ if (opt.image.editAlign) {
33201
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
33202
+ }
33203
+ }
33204
+
33205
+
33206
+ /***/ }),
33207
+
33208
+ /***/ 9144:
33209
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33210
+
33211
+ "use strict";
33212
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33213
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
33214
+ /* harmony export */ });
33215
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
33216
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97099);
33217
+ /*!
33218
+ * Jodit Editor (https://xdsoft.net/jodit/)
33219
+ * Released under MIT see LICENSE.txt in the project root for license information.
33220
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33221
+ */
33222
+
33223
+
33224
+ /** @private */
33225
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
33226
+ // Link
33227
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
33228
+ if (imageLink) {
33229
+ if (!link) {
33230
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
33231
+ }
33232
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
33233
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
33234
+ }
33235
+ else {
33236
+ if (link && link.parentNode) {
33237
+ link.parentNode.replaceChild(image, link);
33238
+ }
33239
+ }
33240
+ }
33241
+
33242
+
33243
+ /***/ }),
33244
+
33245
+ /***/ 82714:
33246
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33247
+
33248
+ "use strict";
33249
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33250
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
33251
+ /* harmony export */ });
33252
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4401);
33253
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10926);
33254
+ /*!
33255
+ * Jodit Editor (https://xdsoft.net/jodit/)
33256
+ * Released under MIT see LICENSE.txt in the project root for license information.
33257
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33258
+ */
33259
+
33260
+
33261
+ /** @private */
33262
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
33263
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
33264
+ const applyMargin = (key, value) => {
33265
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
33266
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
33267
+ if (oldValue.toString() !== v.toString()) {
33268
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
33269
+ }
33270
+ };
33271
+ if (!marginIsLocked) {
33272
+ const sides = [
33273
+ 'margin-top',
33274
+ 'margin-right',
33275
+ 'margin-bottom',
33276
+ 'margin-left'
33277
+ ];
33278
+ margins.forEach((margin, index) => {
33279
+ const side = sides[index];
33280
+ applyMargin(side, margin);
33281
+ });
33282
+ }
33283
+ else {
33284
+ applyMargin('margin', marginTop);
33285
+ }
33286
+ }
33287
+
33288
+
33289
+ /***/ }),
33290
+
33291
+ /***/ 26277:
33292
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
33293
+
33294
+ "use strict";
33295
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33296
+ /* harmony export */ q: function() { return /* binding */ applySize; }
33297
+ /* harmony export */ });
33298
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
33299
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4401);
33300
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10926);
33301
+ /*!
33302
+ * Jodit Editor (https://xdsoft.net/jodit/)
33303
+ * Released under MIT see LICENSE.txt in the project root for license information.
33304
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33305
+ */
33306
+
33307
+
33308
+
33309
+ /** @private */
33310
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
33311
+ // Size
33312
+ if (imageWidth !== image.offsetWidth ||
33313
+ imageHeight !== image.offsetHeight) {
33314
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
33315
+ let updatedHeight = imageHeight
33316
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
33317
+ : null;
33318
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
33319
+ width: updatedWidth,
33320
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
33321
+ });
33322
+ (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);
33323
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
33324
+ updatedHeight = null;
33325
+ }
33326
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
33327
+ }
32531
33328
  }
32532
33329
 
32533
33330
 
@@ -38891,7 +39688,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
38891
39688
  */
38892
39689
 
38893
39690
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
38894
- normalizeSelectionBeforeCutAndCopy: false
39691
+ normalizeSelectionBeforeCutAndCopy: false,
39692
+ normalizeTripleClick: true
38895
39693
  };
38896
39694
 
38897
39695
 
@@ -38967,7 +39765,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38967
39765
  }
38968
39766
  }
38969
39767
  /**
38970
- * @event outsideClick(e) - when user clicked in the outside of editor
39768
+ * @event outsideClick(e) - when user clicked on the outside of editor
38971
39769
  */
38972
39770
  onOutsideClick(e) {
38973
39771
  const node = e.target;
@@ -38979,7 +39777,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38979
39777
  this.j.e.fire('outsideClick', e);
38980
39778
  }
38981
39779
  }
38982
- beforeCommandCut(command) {
39780
+ beforeCommandCut() {
38983
39781
  const { s } = this.j;
38984
39782
  if (!s.isCollapsed()) {
38985
39783
  const current = s.current();
@@ -38988,13 +39786,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38988
39786
  }
38989
39787
  }
38990
39788
  }
38991
- beforeCommandSelectall(command) {
39789
+ beforeCommandSelectAll() {
38992
39790
  const { s } = this.j;
38993
39791
  s.focus();
38994
39792
  s.select(this.j.editor, true);
38995
39793
  s.expandSelection();
38996
39794
  return false;
38997
39795
  }
39796
+ /**
39797
+ * Normalize selection after triple click
39798
+ */
39799
+ onTripleClickNormalizeSelection(e) {
39800
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
39801
+ return;
39802
+ }
39803
+ const { s } = this.j;
39804
+ const { startContainer, startOffset } = s.range;
39805
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
39806
+ 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) ||
39807
+ startContainer, true);
39808
+ }
39809
+ }
38998
39810
  onCopyNormalizeSelectionBound(e) {
38999
39811
  const { s, editor, o } = this.j;
39000
39812
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -39020,7 +39832,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
39020
39832
  ], select.prototype, "beforeCommandCut", null);
39021
39833
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39022
39834
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
39023
- ], select.prototype, "beforeCommandSelectall", null);
39835
+ ], select.prototype, "beforeCommandSelectAll", null);
39836
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39837
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
39838
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
39024
39839
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
39025
39840
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
39026
39841
  ], select.prototype, "onCopyNormalizeSelectionBound", null);