@progress/kendo-vue-editor 5.3.0-dev.202410141143 → 5.3.0-develop.1

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 (361) hide show
  1. package/Editor.js +8 -0
  2. package/Editor.mjs +584 -0
  3. package/README.md +25 -31
  4. package/config/defaultStyles.js +204 -0
  5. package/config/defaultStyles.mjs +209 -0
  6. package/config/schema.js +8 -0
  7. package/config/schema.mjs +44 -0
  8. package/config/shortcuts.js +8 -0
  9. package/config/shortcuts.mjs +41 -0
  10. package/config/toolsSettings.js +8 -0
  11. package/config/toolsSettings.mjs +558 -0
  12. package/dialogs/FindReplace.js +8 -0
  13. package/dialogs/FindReplace.mjs +366 -0
  14. package/dialogs/insertImage.js +8 -0
  15. package/dialogs/insertImage.mjs +211 -0
  16. package/dialogs/insertLink.js +8 -0
  17. package/dialogs/insertLink.mjs +164 -0
  18. package/dialogs/viewHtml.js +8 -0
  19. package/dialogs/viewHtml.mjs +128 -0
  20. package/dist/cdn/js/kendo-vue-editor.js +8 -1
  21. package/index.d.mts +2936 -0
  22. package/index.d.ts +2936 -0
  23. package/index.js +8 -0
  24. package/index.mjs +207 -0
  25. package/messages/main.js +8 -0
  26. package/messages/main.mjs +182 -0
  27. package/package-metadata.js +8 -0
  28. package/package-metadata.mjs +18 -0
  29. package/package.json +23 -62
  30. package/tools/align.js +8 -0
  31. package/tools/align.mjs +69 -0
  32. package/tools/applyColor.js +8 -0
  33. package/tools/applyColor.mjs +71 -0
  34. package/tools/cleanFormatting.js +8 -0
  35. package/tools/cleanFormatting.mjs +65 -0
  36. package/tools/findReplace.js +8 -0
  37. package/tools/findReplace.mjs +67 -0
  38. package/tools/fontStyle.js +8 -0
  39. package/tools/fontStyle.mjs +104 -0
  40. package/tools/formatBlock.js +8 -0
  41. package/tools/formatBlock.mjs +96 -0
  42. package/tools/indent.js +8 -0
  43. package/tools/indent.mjs +63 -0
  44. package/tools/inlineFormat.js +8 -0
  45. package/tools/inlineFormat.mjs +80 -0
  46. package/tools/insertImage.js +8 -0
  47. package/tools/insertImage.mjs +77 -0
  48. package/tools/insertLink.js +8 -0
  49. package/tools/insertLink.mjs +76 -0
  50. package/tools/insertTable/popup.js +8 -0
  51. package/tools/insertTable/popup.mjs +105 -0
  52. package/tools/insertTable/popupGrid.js +8 -0
  53. package/tools/insertTable/popupGrid.mjs +83 -0
  54. package/tools/insertTable/tool.js +8 -0
  55. package/tools/insertTable/tool.mjs +98 -0
  56. package/tools/lists.js +8 -0
  57. package/tools/lists.mjs +77 -0
  58. package/tools/outdent.js +8 -0
  59. package/tools/outdent.mjs +75 -0
  60. package/tools/pdf.js +8 -0
  61. package/tools/pdf.mjs +63 -0
  62. package/tools/print.js +8 -0
  63. package/tools/print.mjs +58 -0
  64. package/tools/proseMirrorTool.js +8 -0
  65. package/tools/proseMirrorTool.mjs +61 -0
  66. package/tools/selectAll.js +8 -0
  67. package/tools/selectAll.mjs +56 -0
  68. package/tools/unlink.js +8 -0
  69. package/tools/unlink.mjs +64 -0
  70. package/tools/utils.js +8 -0
  71. package/tools/utils.mjs +18 -0
  72. package/tools/viewHtml.js +8 -0
  73. package/tools/viewHtml.mjs +72 -0
  74. package/utils/browser-detection.js +8 -0
  75. package/utils/browser-detection.mjs +11 -0
  76. package/utils/controlled-value.js +8 -0
  77. package/utils/controlled-value.mjs +18 -0
  78. package/utils/main.js +8 -0
  79. package/utils/main.mjs +162 -0
  80. package/utils/props-key.js +8 -0
  81. package/utils/props-key.mjs +12 -0
  82. package/dist/es/Editor.d.ts +0 -283
  83. package/dist/es/Editor.js +0 -812
  84. package/dist/es/EditorProps.d.ts +0 -194
  85. package/dist/es/EditorProps.js +0 -1
  86. package/dist/es/additionalTypes.ts +0 -21
  87. package/dist/es/config/defaultStyles.d.ts +0 -12
  88. package/dist/es/config/defaultStyles.js +0 -12
  89. package/dist/es/config/pasteSettings.d.ts +0 -6
  90. package/dist/es/config/pasteSettings.js +0 -1
  91. package/dist/es/config/schema.d.ts +0 -8
  92. package/dist/es/config/schema.js +0 -51
  93. package/dist/es/config/shortcuts.d.ts +0 -24
  94. package/dist/es/config/shortcuts.js +0 -61
  95. package/dist/es/config/toolsSettings.d.ts +0 -489
  96. package/dist/es/config/toolsSettings.js +0 -528
  97. package/dist/es/dialogs/EditorDialogProps.d.ts +0 -23
  98. package/dist/es/dialogs/EditorDialogProps.js +0 -1
  99. package/dist/es/dialogs/FindReplace.d.ts +0 -70
  100. package/dist/es/dialogs/FindReplace.js +0 -909
  101. package/dist/es/dialogs/insertImage.d.ts +0 -54
  102. package/dist/es/dialogs/insertImage.js +0 -1164
  103. package/dist/es/dialogs/insertLink.d.ts +0 -52
  104. package/dist/es/dialogs/insertLink.js +0 -826
  105. package/dist/es/dialogs/main.d.ts +0 -1
  106. package/dist/es/dialogs/main.js +0 -42
  107. package/dist/es/dialogs/viewHtml.d.ts +0 -51
  108. package/dist/es/dialogs/viewHtml.js +0 -201
  109. package/dist/es/main.d.ts +0 -192
  110. package/dist/es/main.js +0 -217
  111. package/dist/es/messages/main.d.ts +0 -172
  112. package/dist/es/messages/main.js +0 -503
  113. package/dist/es/package-metadata.d.ts +0 -5
  114. package/dist/es/package-metadata.js +0 -11
  115. package/dist/es/tools/ToolProps.d.ts +0 -35
  116. package/dist/es/tools/ToolProps.js +0 -1
  117. package/dist/es/tools/align.d.ts +0 -42
  118. package/dist/es/tools/align.js +0 -111
  119. package/dist/es/tools/applyColor.d.ts +0 -45
  120. package/dist/es/tools/applyColor.js +0 -100
  121. package/dist/es/tools/cleanFormatting.d.ts +0 -49
  122. package/dist/es/tools/cleanFormatting.js +0 -107
  123. package/dist/es/tools/findReplace.d.ts +0 -43
  124. package/dist/es/tools/findReplace.js +0 -115
  125. package/dist/es/tools/fontStyle.d.ts +0 -55
  126. package/dist/es/tools/fontStyle.js +0 -150
  127. package/dist/es/tools/formatBlock.d.ts +0 -45
  128. package/dist/es/tools/formatBlock.js +0 -145
  129. package/dist/es/tools/history.d.ts +0 -18
  130. package/dist/es/tools/history.js +0 -3
  131. package/dist/es/tools/indent.d.ts +0 -44
  132. package/dist/es/tools/indent.js +0 -121
  133. package/dist/es/tools/inlineFormat.d.ts +0 -74
  134. package/dist/es/tools/inlineFormat.js +0 -120
  135. package/dist/es/tools/insertImage.d.ts +0 -46
  136. package/dist/es/tools/insertImage.js +0 -126
  137. package/dist/es/tools/insertLink.d.ts +0 -46
  138. package/dist/es/tools/insertLink.js +0 -126
  139. package/dist/es/tools/insertTable/popup.d.ts +0 -80
  140. package/dist/es/tools/insertTable/popup.js +0 -177
  141. package/dist/es/tools/insertTable/popupGrid.d.ts +0 -51
  142. package/dist/es/tools/insertTable/popupGrid.js +0 -131
  143. package/dist/es/tools/insertTable/tool.d.ts +0 -53
  144. package/dist/es/tools/insertTable/tool.js +0 -157
  145. package/dist/es/tools/lists.d.ts +0 -48
  146. package/dist/es/tools/lists.js +0 -124
  147. package/dist/es/tools/main.d.ts +0 -95
  148. package/dist/es/tools/main.js +0 -1
  149. package/dist/es/tools/outdent.d.ts +0 -44
  150. package/dist/es/tools/outdent.js +0 -123
  151. package/dist/es/tools/pdf.d.ts +0 -58
  152. package/dist/es/tools/pdf.js +0 -100
  153. package/dist/es/tools/print.d.ts +0 -49
  154. package/dist/es/tools/print.js +0 -103
  155. package/dist/es/tools/proseMirrorTool.d.ts +0 -48
  156. package/dist/es/tools/proseMirrorTool.js +0 -104
  157. package/dist/es/tools/selectAll.d.ts +0 -49
  158. package/dist/es/tools/selectAll.js +0 -97
  159. package/dist/es/tools/tableEdit.d.ts +0 -51
  160. package/dist/es/tools/tableEdit.js +0 -34
  161. package/dist/es/tools/unlink.d.ts +0 -47
  162. package/dist/es/tools/unlink.js +0 -104
  163. package/dist/es/tools/utils.d.ts +0 -18
  164. package/dist/es/tools/utils.js +0 -31
  165. package/dist/es/tools/viewHtml.d.ts +0 -54
  166. package/dist/es/tools/viewHtml.js +0 -121
  167. package/dist/es/utils/browser-detection.d.ts +0 -4
  168. package/dist/es/utils/browser-detection.js +0 -5
  169. package/dist/es/utils/controlled-value.d.ts +0 -5
  170. package/dist/es/utils/controlled-value.js +0 -31
  171. package/dist/es/utils/main.d.ts +0 -357
  172. package/dist/es/utils/main.js +0 -422
  173. package/dist/es/utils/props-key.d.ts +0 -5
  174. package/dist/es/utils/props-key.js +0 -5
  175. package/dist/esm/Editor.d.ts +0 -283
  176. package/dist/esm/Editor.js +0 -812
  177. package/dist/esm/EditorProps.d.ts +0 -194
  178. package/dist/esm/EditorProps.js +0 -1
  179. package/dist/esm/additionalTypes.ts +0 -21
  180. package/dist/esm/config/defaultStyles.d.ts +0 -12
  181. package/dist/esm/config/defaultStyles.js +0 -12
  182. package/dist/esm/config/pasteSettings.d.ts +0 -6
  183. package/dist/esm/config/pasteSettings.js +0 -1
  184. package/dist/esm/config/schema.d.ts +0 -8
  185. package/dist/esm/config/schema.js +0 -51
  186. package/dist/esm/config/shortcuts.d.ts +0 -24
  187. package/dist/esm/config/shortcuts.js +0 -61
  188. package/dist/esm/config/toolsSettings.d.ts +0 -489
  189. package/dist/esm/config/toolsSettings.js +0 -528
  190. package/dist/esm/dialogs/EditorDialogProps.d.ts +0 -23
  191. package/dist/esm/dialogs/EditorDialogProps.js +0 -1
  192. package/dist/esm/dialogs/FindReplace.d.ts +0 -70
  193. package/dist/esm/dialogs/FindReplace.js +0 -909
  194. package/dist/esm/dialogs/insertImage.d.ts +0 -54
  195. package/dist/esm/dialogs/insertImage.js +0 -1164
  196. package/dist/esm/dialogs/insertLink.d.ts +0 -52
  197. package/dist/esm/dialogs/insertLink.js +0 -826
  198. package/dist/esm/dialogs/main.d.ts +0 -1
  199. package/dist/esm/dialogs/main.js +0 -42
  200. package/dist/esm/dialogs/viewHtml.d.ts +0 -51
  201. package/dist/esm/dialogs/viewHtml.js +0 -201
  202. package/dist/esm/main.d.ts +0 -192
  203. package/dist/esm/main.js +0 -217
  204. package/dist/esm/messages/main.d.ts +0 -172
  205. package/dist/esm/messages/main.js +0 -503
  206. package/dist/esm/package-metadata.d.ts +0 -5
  207. package/dist/esm/package-metadata.js +0 -11
  208. package/dist/esm/package.json +0 -3
  209. package/dist/esm/tools/ToolProps.d.ts +0 -35
  210. package/dist/esm/tools/ToolProps.js +0 -1
  211. package/dist/esm/tools/align.d.ts +0 -42
  212. package/dist/esm/tools/align.js +0 -111
  213. package/dist/esm/tools/applyColor.d.ts +0 -45
  214. package/dist/esm/tools/applyColor.js +0 -100
  215. package/dist/esm/tools/cleanFormatting.d.ts +0 -49
  216. package/dist/esm/tools/cleanFormatting.js +0 -107
  217. package/dist/esm/tools/findReplace.d.ts +0 -43
  218. package/dist/esm/tools/findReplace.js +0 -115
  219. package/dist/esm/tools/fontStyle.d.ts +0 -55
  220. package/dist/esm/tools/fontStyle.js +0 -150
  221. package/dist/esm/tools/formatBlock.d.ts +0 -45
  222. package/dist/esm/tools/formatBlock.js +0 -145
  223. package/dist/esm/tools/history.d.ts +0 -18
  224. package/dist/esm/tools/history.js +0 -3
  225. package/dist/esm/tools/indent.d.ts +0 -44
  226. package/dist/esm/tools/indent.js +0 -121
  227. package/dist/esm/tools/inlineFormat.d.ts +0 -74
  228. package/dist/esm/tools/inlineFormat.js +0 -120
  229. package/dist/esm/tools/insertImage.d.ts +0 -46
  230. package/dist/esm/tools/insertImage.js +0 -126
  231. package/dist/esm/tools/insertLink.d.ts +0 -46
  232. package/dist/esm/tools/insertLink.js +0 -126
  233. package/dist/esm/tools/insertTable/popup.d.ts +0 -80
  234. package/dist/esm/tools/insertTable/popup.js +0 -177
  235. package/dist/esm/tools/insertTable/popupGrid.d.ts +0 -51
  236. package/dist/esm/tools/insertTable/popupGrid.js +0 -131
  237. package/dist/esm/tools/insertTable/tool.d.ts +0 -53
  238. package/dist/esm/tools/insertTable/tool.js +0 -157
  239. package/dist/esm/tools/lists.d.ts +0 -48
  240. package/dist/esm/tools/lists.js +0 -124
  241. package/dist/esm/tools/main.d.ts +0 -95
  242. package/dist/esm/tools/main.js +0 -1
  243. package/dist/esm/tools/outdent.d.ts +0 -44
  244. package/dist/esm/tools/outdent.js +0 -123
  245. package/dist/esm/tools/pdf.d.ts +0 -58
  246. package/dist/esm/tools/pdf.js +0 -100
  247. package/dist/esm/tools/print.d.ts +0 -49
  248. package/dist/esm/tools/print.js +0 -103
  249. package/dist/esm/tools/proseMirrorTool.d.ts +0 -48
  250. package/dist/esm/tools/proseMirrorTool.js +0 -104
  251. package/dist/esm/tools/selectAll.d.ts +0 -49
  252. package/dist/esm/tools/selectAll.js +0 -97
  253. package/dist/esm/tools/tableEdit.d.ts +0 -51
  254. package/dist/esm/tools/tableEdit.js +0 -34
  255. package/dist/esm/tools/unlink.d.ts +0 -47
  256. package/dist/esm/tools/unlink.js +0 -104
  257. package/dist/esm/tools/utils.d.ts +0 -18
  258. package/dist/esm/tools/utils.js +0 -31
  259. package/dist/esm/tools/viewHtml.d.ts +0 -54
  260. package/dist/esm/tools/viewHtml.js +0 -121
  261. package/dist/esm/utils/browser-detection.d.ts +0 -4
  262. package/dist/esm/utils/browser-detection.js +0 -5
  263. package/dist/esm/utils/controlled-value.d.ts +0 -5
  264. package/dist/esm/utils/controlled-value.js +0 -31
  265. package/dist/esm/utils/main.d.ts +0 -357
  266. package/dist/esm/utils/main.js +0 -422
  267. package/dist/esm/utils/props-key.d.ts +0 -5
  268. package/dist/esm/utils/props-key.js +0 -5
  269. package/dist/npm/Editor.d.ts +0 -283
  270. package/dist/npm/Editor.js +0 -819
  271. package/dist/npm/EditorProps.d.ts +0 -194
  272. package/dist/npm/EditorProps.js +0 -2
  273. package/dist/npm/additionalTypes.ts +0 -21
  274. package/dist/npm/config/defaultStyles.d.ts +0 -12
  275. package/dist/npm/config/defaultStyles.js +0 -15
  276. package/dist/npm/config/pasteSettings.d.ts +0 -6
  277. package/dist/npm/config/pasteSettings.js +0 -2
  278. package/dist/npm/config/schema.d.ts +0 -8
  279. package/dist/npm/config/schema.js +0 -55
  280. package/dist/npm/config/shortcuts.d.ts +0 -24
  281. package/dist/npm/config/shortcuts.js +0 -68
  282. package/dist/npm/config/toolsSettings.d.ts +0 -489
  283. package/dist/npm/config/toolsSettings.js +0 -531
  284. package/dist/npm/dialogs/EditorDialogProps.d.ts +0 -23
  285. package/dist/npm/dialogs/EditorDialogProps.js +0 -2
  286. package/dist/npm/dialogs/FindReplace.d.ts +0 -70
  287. package/dist/npm/dialogs/FindReplace.js +0 -916
  288. package/dist/npm/dialogs/insertImage.d.ts +0 -54
  289. package/dist/npm/dialogs/insertImage.js +0 -1171
  290. package/dist/npm/dialogs/insertLink.d.ts +0 -52
  291. package/dist/npm/dialogs/insertLink.js +0 -833
  292. package/dist/npm/dialogs/main.d.ts +0 -1
  293. package/dist/npm/dialogs/main.js +0 -42
  294. package/dist/npm/dialogs/viewHtml.d.ts +0 -51
  295. package/dist/npm/dialogs/viewHtml.js +0 -208
  296. package/dist/npm/main.d.ts +0 -192
  297. package/dist/npm/main.js +0 -217
  298. package/dist/npm/messages/main.d.ts +0 -172
  299. package/dist/npm/messages/main.js +0 -506
  300. package/dist/npm/package-metadata.d.ts +0 -5
  301. package/dist/npm/package-metadata.js +0 -14
  302. package/dist/npm/tools/ToolProps.d.ts +0 -35
  303. package/dist/npm/tools/ToolProps.js +0 -2
  304. package/dist/npm/tools/align.d.ts +0 -42
  305. package/dist/npm/tools/align.js +0 -118
  306. package/dist/npm/tools/applyColor.d.ts +0 -45
  307. package/dist/npm/tools/applyColor.js +0 -107
  308. package/dist/npm/tools/cleanFormatting.d.ts +0 -49
  309. package/dist/npm/tools/cleanFormatting.js +0 -114
  310. package/dist/npm/tools/findReplace.d.ts +0 -43
  311. package/dist/npm/tools/findReplace.js +0 -122
  312. package/dist/npm/tools/fontStyle.d.ts +0 -55
  313. package/dist/npm/tools/fontStyle.js +0 -157
  314. package/dist/npm/tools/formatBlock.d.ts +0 -45
  315. package/dist/npm/tools/formatBlock.js +0 -152
  316. package/dist/npm/tools/history.d.ts +0 -18
  317. package/dist/npm/tools/history.js +0 -8
  318. package/dist/npm/tools/indent.d.ts +0 -44
  319. package/dist/npm/tools/indent.js +0 -128
  320. package/dist/npm/tools/inlineFormat.d.ts +0 -74
  321. package/dist/npm/tools/inlineFormat.js +0 -127
  322. package/dist/npm/tools/insertImage.d.ts +0 -46
  323. package/dist/npm/tools/insertImage.js +0 -133
  324. package/dist/npm/tools/insertLink.d.ts +0 -46
  325. package/dist/npm/tools/insertLink.js +0 -133
  326. package/dist/npm/tools/insertTable/popup.d.ts +0 -80
  327. package/dist/npm/tools/insertTable/popup.js +0 -184
  328. package/dist/npm/tools/insertTable/popupGrid.d.ts +0 -51
  329. package/dist/npm/tools/insertTable/popupGrid.js +0 -138
  330. package/dist/npm/tools/insertTable/tool.d.ts +0 -53
  331. package/dist/npm/tools/insertTable/tool.js +0 -164
  332. package/dist/npm/tools/lists.d.ts +0 -48
  333. package/dist/npm/tools/lists.js +0 -131
  334. package/dist/npm/tools/main.d.ts +0 -95
  335. package/dist/npm/tools/main.js +0 -5
  336. package/dist/npm/tools/outdent.d.ts +0 -44
  337. package/dist/npm/tools/outdent.js +0 -130
  338. package/dist/npm/tools/pdf.d.ts +0 -58
  339. package/dist/npm/tools/pdf.js +0 -107
  340. package/dist/npm/tools/print.d.ts +0 -49
  341. package/dist/npm/tools/print.js +0 -110
  342. package/dist/npm/tools/proseMirrorTool.d.ts +0 -48
  343. package/dist/npm/tools/proseMirrorTool.js +0 -111
  344. package/dist/npm/tools/selectAll.d.ts +0 -49
  345. package/dist/npm/tools/selectAll.js +0 -104
  346. package/dist/npm/tools/tableEdit.d.ts +0 -51
  347. package/dist/npm/tools/tableEdit.js +0 -39
  348. package/dist/npm/tools/unlink.d.ts +0 -47
  349. package/dist/npm/tools/unlink.js +0 -111
  350. package/dist/npm/tools/utils.d.ts +0 -18
  351. package/dist/npm/tools/utils.js +0 -39
  352. package/dist/npm/tools/viewHtml.d.ts +0 -54
  353. package/dist/npm/tools/viewHtml.js +0 -128
  354. package/dist/npm/utils/browser-detection.d.ts +0 -4
  355. package/dist/npm/utils/browser-detection.js +0 -8
  356. package/dist/npm/utils/controlled-value.d.ts +0 -5
  357. package/dist/npm/utils/controlled-value.js +0 -35
  358. package/dist/npm/utils/main.d.ts +0 -357
  359. package/dist/npm/utils/main.js +0 -425
  360. package/dist/npm/utils/props-key.d.ts +0 -5
  361. package/dist/npm/utils/props-key.js +0 -8
@@ -0,0 +1,366 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { defineComponent as U, createVNode as t, isVNode as V } from "vue";
9
+ import { Button as f } from "@progress/kendo-vue-buttons";
10
+ import { chevronRightIcon as W, chevronLeftIcon as $ } from "@progress/kendo-svg-icons";
11
+ import { Window as P } from "@progress/kendo-vue-dialogs";
12
+ import { TabStrip as q, TabStripTab as L } from "@progress/kendo-vue-layout";
13
+ import { provideLocalizationService as H } from "@progress/kendo-vue-intl";
14
+ import { messages as o } from "../messages/main.mjs";
15
+ import { EditorToolsSettings as G } from "../config/toolsSettings.mjs";
16
+ import { formatString as J } from "../tools/utils.mjs";
17
+ import { selectedLineTextOnly as Q, textHighlightKey as X, TextSelection as m, find as Y, replace as Z, replaceAll as ee, findAll as te } from "@progress/kendo-editor-common";
18
+ import { Icon as F } from "@progress/kendo-vue-common";
19
+ function N(e) {
20
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !V(e);
21
+ }
22
+ const ne = 13, ce = 27, ae = G.findAndReplace, ge = /* @__PURE__ */ U({
23
+ name: "KendoFindAndReplaceDialog",
24
+ emits: {
25
+ close: null
26
+ },
27
+ props: {
28
+ view: Object,
29
+ settings: {
30
+ type: Object,
31
+ default: function() {
32
+ return ae;
33
+ }
34
+ },
35
+ dir: String
36
+ },
37
+ inject: {
38
+ kendoLocalizationService: {
39
+ default: null
40
+ }
41
+ },
42
+ created() {
43
+ this._prevMatch = void 0, this.nextMatch = void 0;
44
+ },
45
+ data() {
46
+ return {
47
+ selectedTab: 0,
48
+ searchText: Q(this.$props.view.state),
49
+ replaceText: "",
50
+ matchCase: !1,
51
+ matchWord: !1,
52
+ matchCyclic: !1,
53
+ useRegExp: !1,
54
+ matches: [],
55
+ hasMounted: !1
56
+ };
57
+ },
58
+ mounted() {
59
+ this.$el && document.body.append(this.$el), this.setNextState(), this.hasMounted = !0, setTimeout(function() {
60
+ const e = document.getElementById("findWhatFind");
61
+ e && e.focus();
62
+ }, 10);
63
+ },
64
+ /**
65
+ * @hidden
66
+ */
67
+ updated() {
68
+ const e = this.matches || [], n = this.nextMatch, c = this.$props.view;
69
+ if (this._prevMatch !== n) {
70
+ const a = c.state, i = a.tr, s = [];
71
+ e.forEach((l) => {
72
+ s.push({
73
+ from: l.from,
74
+ to: l.to,
75
+ attrs: {
76
+ class: n && l.eq(n) ? "k-text-selected" : "k-text-highlighted"
77
+ }
78
+ });
79
+ }), i.setMeta(X, s), i.setSelection(n || m.create(a.doc, a.selection.from)), c.dispatch(i);
80
+ }
81
+ },
82
+ unmounted() {
83
+ this.$el && this.$el.remove();
84
+ },
85
+ render() {
86
+ let e, n;
87
+ const c = H(this), {
88
+ findReplaceDialogTitle: a,
89
+ findReplaceTabFind: i,
90
+ findReplaceTabReplace: s,
91
+ findReplaceFindWhat: l,
92
+ findReplaceReplaceWith: p,
93
+ findReplaceReplace: r,
94
+ findReplaceReplaceAll: d,
95
+ findReplaceMatchCase: g,
96
+ findReplaceMatchWord: x,
97
+ findReplaceMatchCyclic: k,
98
+ findReplaceUseRegExp: b,
99
+ findReplacePrevMatch: C,
100
+ findReplaceNextMatch: S,
101
+ findReplaceMatches: v
102
+ } = this.settings.messages, {
103
+ matchCase: E,
104
+ matchWord: _,
105
+ matchCyclic: j,
106
+ useRegExp: A,
107
+ searchText: B,
108
+ replaceText: I,
109
+ nextMatch: R
110
+ } = this, M = t("div", {
111
+ class: "k-search-options"
112
+ }, [t("span", null, [t("input", {
113
+ class: "k-checkbox k-checkbox-md k-rounded-md",
114
+ type: "checkbox",
115
+ id: "match-case",
116
+ checked: E,
117
+ onChange: this.onMatchCaseChecked
118
+ }, null), t("label", {
119
+ for: "match-case",
120
+ class: "k-checkbox-label"
121
+ }, [c.toLanguageString(g, o[g])])]), t("span", null, [t("input", {
122
+ class: "k-checkbox k-checkbox-md k-rounded-md",
123
+ type: "checkbox",
124
+ id: "match-whole",
125
+ checked: _,
126
+ onChange: this.onMatchWordChecked
127
+ }, null), t("label", {
128
+ for: "match-whole",
129
+ class: "k-checkbox-label"
130
+ }, [c.toLanguageString(x, o[x])])]), t("span", null, [t("input", {
131
+ class: "k-checkbox k-checkbox-md k-rounded-md",
132
+ type: "checkbox",
133
+ id: "match-cyclic",
134
+ checked: j,
135
+ onChange: this.onMatchCyclicChecked
136
+ }, null), t("label", {
137
+ for: "match-cyclic",
138
+ class: "k-checkbox-label"
139
+ }, [c.toLanguageString(k, o[k])])]), t("span", null, [t("input", {
140
+ class: "k-checkbox k-checkbox-md k-rounded-md",
141
+ type: "checkbox",
142
+ id: "regular-expression",
143
+ checked: A,
144
+ onChange: this.onUseRegExpChecked
145
+ }, null), t("label", {
146
+ for: "regular-expression",
147
+ class: "k-checkbox-label"
148
+ }, [c.toLanguageString(b, o[b])])])]), y = function(h) {
149
+ const u = this.$props.dir === "rtl", D = t(f, {
150
+ fillMode: "flat",
151
+ themeColor: "primary",
152
+ onClick: this.onFindPrev
153
+ }, {
154
+ default: () => [t(F, {
155
+ name: `chevron-${u ? "right" : "left"}`,
156
+ icon: u ? W : $
157
+ }, null), c.toLanguageString(C, o[C])]
158
+ }), K = t(f, {
159
+ fillMode: "flat",
160
+ themeColor: "primary",
161
+ onClick: this.onFindNext
162
+ }, {
163
+ default: () => [c.toLanguageString(S, o[S]), t(F, {
164
+ name: `chevron-${u ? "left" : "right"}`,
165
+ icon: u ? $ : W
166
+ }, null)]
167
+ });
168
+ return t("div", {
169
+ class: "k-matches-container"
170
+ }, [D, this.hasMounted && t("span", {
171
+ ref: h
172
+ }, [this.matchesMessage(c.toLanguageString(v, o[v]))]), K]);
173
+ }, T = function(h) {
174
+ return t("div", {
175
+ class: "k-edit-label"
176
+ }, [t("label", {
177
+ ref: h,
178
+ for: h
179
+ }, [c.toLanguageString(l, o[l])])]);
180
+ }, w = function(h) {
181
+ return t("div", {
182
+ class: "k-edit-field"
183
+ }, [t("span", {
184
+ class: "k-textbox k-input k-input-md k-rounded-md k-input-solid"
185
+ }, [t("input", {
186
+ id: h,
187
+ ref: h,
188
+ type: "text",
189
+ class: "k-input-inner",
190
+ value: B,
191
+ onInput: this.onSearchChange,
192
+ onFocus: this.onSearchChange,
193
+ onKeydown: this.onKeyDown
194
+ }, null)])]);
195
+ }, O = t("div", {
196
+ class: "k-edit-label"
197
+ }, [t("label", {
198
+ for: "replaceWith"
199
+ }, [c.toLanguageString(p, o[p])])]), z = t("div", {
200
+ class: "k-edit-field"
201
+ }, [t("span", {
202
+ class: "k-textbox k-input k-input-md k-rounded-md k-input-solid"
203
+ }, [t("input", {
204
+ id: "replaceWith",
205
+ class: "k-input-inner",
206
+ type: "text",
207
+ value: I,
208
+ onInput: this.onReplaceChange
209
+ }, null)])]);
210
+ return t(P, {
211
+ title: c.toLanguageString(a, o[a]),
212
+ onClose: this.onClose,
213
+ windowStyle: {
214
+ width: "auto",
215
+ height: "auto",
216
+ userSelect: "none"
217
+ },
218
+ resizable: !1,
219
+ minimizeButton: () => null,
220
+ maximizeButton: () => null,
221
+ dir: this.$props.dir
222
+ }, {
223
+ default: () => [t(q, {
224
+ dir: this.$props.dir,
225
+ selected: this.selectedTab,
226
+ class: "k-editor-find-replace",
227
+ onSelect: this.onTabSelect,
228
+ animation: !1
229
+ }, {
230
+ default: () => [t(L, {
231
+ title: c.toLanguageString(i, o[i])
232
+ }, {
233
+ default: () => [t("div", {
234
+ class: "k-edit-form-container"
235
+ }, [T.call(this, "findWhatFind"), w.call(this, "findWhatFind")]), t("div", {
236
+ class: "k-actions k-hstack k-justify-content-end"
237
+ }, null), M, y.call(this, "findWhatFind")]
238
+ }), t(L, {
239
+ title: c.toLanguageString(s, o[s])
240
+ }, {
241
+ default: () => [t("div", {
242
+ class: "k-edit-form-container"
243
+ }, [T.call(this, "findWhatReplace"), w.call(this, "findWhatReplace"), O, z]), t("div", {
244
+ class: "k-actions k-hstack k-justify-content-end"
245
+ }, [t(f, {
246
+ disabled: !R,
247
+ onClick: this.onReplace
248
+ }, N(e = c.toLanguageString(r, o[r])) ? e : {
249
+ default: () => [e]
250
+ }), t(f, {
251
+ disabled: !R,
252
+ onClick: this.onReplaceAll
253
+ }, N(n = c.toLanguageString(d, o[d])) ? n : {
254
+ default: () => [n]
255
+ })]), M, y.call(this, "findWhatReplace")]
256
+ })]
257
+ })]
258
+ });
259
+ },
260
+ methods: {
261
+ onTabSelect(e) {
262
+ this.selectedTab = e.selected;
263
+ },
264
+ onClose() {
265
+ const e = this.$props.view, n = e.state, c = n.tr.setSelection(m.create(n.doc, n.selection.from, n.selection.to));
266
+ e.updateState(n.apply(c)), e.focus(), this.$emit("close");
267
+ },
268
+ matchesMessage(e) {
269
+ const n = this.matches, c = this.nextMatch;
270
+ let a = 0, i = 0;
271
+ if (n && c) {
272
+ const s = n.findIndex((l) => l.eq(c));
273
+ a = s === -1 ? n.length : s + 1, i = n.length;
274
+ }
275
+ return J(e, a, i);
276
+ },
277
+ onFindNext() {
278
+ this.onFind();
279
+ },
280
+ onFindPrev() {
281
+ this.onFind(!0);
282
+ },
283
+ onFind(e = !1) {
284
+ const n = this.$props.view, {
285
+ searchText: c,
286
+ matchCase: a,
287
+ matchCyclic: i,
288
+ matchWord: s,
289
+ useRegExp: l
290
+ } = this.$data, p = {
291
+ text: c,
292
+ matchWord: s,
293
+ matchCase: a,
294
+ useRegExp: l,
295
+ backward: e,
296
+ matchCyclic: i
297
+ }, r = Y(n.state, p);
298
+ if (r) {
299
+ const d = n.state.tr.setSelection(r);
300
+ d.scrollIntoView(), n.updateState(n.state.apply(d)), this._prevMatch = this.nextMatch, this.nextMatch = r, this._prevMatch !== this.nextMatch && this.$forceUpdate();
301
+ }
302
+ },
303
+ onReplace() {
304
+ const e = this.$props.view, n = e.state.selection, {
305
+ replaceText: c
306
+ } = this.$data;
307
+ if (!n.empty) {
308
+ const a = n.from, i = a + c.length, s = Z(n, c, e.state.tr);
309
+ s.setSelection(m.create(s.doc, a, i)), s.scrollIntoView(), e.dispatch(s), this.setNextState({});
310
+ }
311
+ },
312
+ onReplaceAll() {
313
+ const e = this.$props.view, {
314
+ searchText: n,
315
+ replaceText: c,
316
+ matchCase: a,
317
+ matchWord: i,
318
+ useRegExp: s
319
+ } = this.$data, l = {
320
+ text: n,
321
+ matchWord: i,
322
+ matchCase: a,
323
+ useRegExp: s
324
+ };
325
+ e.dispatch(ee(e.state, c, l)), this.setNextState({});
326
+ },
327
+ onKeyDown(e) {
328
+ e.keyCode === ne ? this.onFindNext() : e.keyCode === ce && this.onClose();
329
+ },
330
+ onMatchCaseChecked(e) {
331
+ this.matchCase = e.target.checked, this.setNextState();
332
+ },
333
+ onMatchWordChecked(e) {
334
+ this.matchWord = e.target.checked, this.setNextState();
335
+ },
336
+ onMatchCyclicChecked(e) {
337
+ this.matchCyclic = e.target.checked, this.setNextState();
338
+ },
339
+ onUseRegExpChecked(e) {
340
+ this.useRegExp = e.target.checked, this.setNextState();
341
+ },
342
+ onSearchChange(e) {
343
+ this.searchText = e.target.value, this.setNextState();
344
+ },
345
+ onReplaceChange(e) {
346
+ this.replaceText = e.target.value, this.setNextState();
347
+ },
348
+ setNextState() {
349
+ const e = this.$props.view;
350
+ if (this.searchText) {
351
+ const n = {
352
+ text: this.searchText,
353
+ matchWord: this.matchWord,
354
+ matchCase: this.matchCase,
355
+ useRegExp: this.useRegExp
356
+ }, c = e.state.selection, a = te(e.state.doc, n);
357
+ let i = !this.searchText && a[0] || a.find((s) => s.from >= c.from) || this.matchCyclic && a[0] || void 0;
358
+ this._prevMatch = this.nextMatch, this.matches = a, this.nextMatch = i;
359
+ } else
360
+ this._prevMatch = this.nextMatch, this.matches = [], this.nextMatch = void 0;
361
+ }
362
+ }
363
+ });
364
+ export {
365
+ ge as FindAndReplaceDialog
366
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("@progress/kendo-vue-dialogs"),S=require("@progress/kendo-vue-buttons"),I=require("@progress/kendo-editor-common"),y=require("@progress/kendo-vue-intl"),d=require("../messages/main.js"),s=require("@progress/kendo-vue-common"),u=require("@progress/kendo-vue-form"),m=require("@progress/kendo-vue-inputs");function k(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const T=e.defineComponent({name:"KendoInsertImageDialog",emits:{close:null},props:{view:Object,settings:Object,dir:String},inject:{kendoLocalizationService:{default:null}},data(){const{view:t,settings:o}=this.$props,a=t&&t.state;let i={};return a&&a.selection instanceof I.NodeSelection&&a.selection.node.type===a.schema.nodes[o.node]&&(i=a.selection.node.attrs),{srcValue:i.src,altValue:i.alt,titleValue:i.title,widthValue:i.width,heightValue:i.height}},mounted(){this.src=s.getRef(this,"src"),this.altText=s.getRef(this,"altText"),this.title=s.getRef(this,"title"),this.width=s.getRef(this,"width"),this.height=s.getRef(this,"height"),this.src&&this.src.focus()},render(){let t,o;const{view:a,settings:i,dir:l}=this.$props,{insertImageDialogTitle:c,insertImageAddress:f,insertImageTitle:p,insertImageAltText:n,insertImageWidth:h,insertImageHeight:N,insertImageCancel:w,insertImageInsert:v}=i.messages,r=y.provideLocalizationService(this),g=a&&a.state;g&&g.selection instanceof I.NodeSelection&&g.selection.node.type===g.schema.nodes[i.node]&&g.selection.node.attrs;const C=e.createVNode(u.Form,null,{default:()=>[e.createVNode(u.FormElement,{horizontal:!0},{default:()=>[e.createVNode(u.FieldWrapper,null,{default:()=>[e.createVNode("label",{for:"k-editor-image-url",class:"k-form-label"},[r.toLanguageString(f,d.messages[f])]),e.createVNode("div",{class:"k-form-field-wrap"},[e.createVNode(m.Input,{id:"k-editor-image-url",value:this.srcValue,onInput:this.handleSrcInput,ref:s.setRef(this,"src")},null)])]}),e.createVNode(u.FieldWrapper,null,{default:()=>[e.createVNode("label",{for:"k-editor-image-url",class:"k-form-label"},[r.toLanguageString(n,d.messages[n])]),e.createVNode("div",{class:"k-form-field-wrap"},[e.createVNode(m.Input,{id:"k-editor-image-alt",value:this.altValue,onInput:this.handleAltInput,ref:s.setRef(this,"altText")},null)])]}),e.createVNode(u.FieldWrapper,null,{default:()=>[e.createVNode("label",{for:"k-editor-image-title",class:"k-form-label"},[r.toLanguageString(p,d.messages[p])]),e.createVNode("div",{class:"k-form-field-wrap"},[e.createVNode(m.Input,{id:"k-editor-image-title",value:this.titleValue,onInput:this.handleTitleInput,ref:s.setRef(this,"title")},null)])]}),e.createVNode(u.FieldWrapper,null,{default:()=>[e.createVNode("label",{for:"k-editor-image-width",class:"k-form-label"},[r.toLanguageString(h,d.messages[h])]),e.createVNode("div",{class:"k-form-field-wrap"},[e.createVNode(m.Input,{id:"k-editor-image-width",value:this.widthValue,onInput:this.handleWidthInput,ref:s.setRef(this,"width")},null)])]}),e.createVNode(u.FieldWrapper,null,{default:()=>[e.createVNode("label",{for:"k-editor-image-height",class:"k-form-label"},[r.toLanguageString(N,d.messages[N])]),e.createVNode("div",{class:"k-form-field-wrap"},[e.createVNode(m.Input,{id:"k-editor-image-height",value:this.heightValue,onInput:this.handleHeightInput,ref:s.setRef(this,"height")},null)])]})]})]}),V=[e.createVNode(S.Button,{type:"button",onClick:this.onClose,dir:l,key:"cancel"},k(t=r.toLanguageString(w,d.messages[w]))?t:{default:()=>[t]}),e.createVNode(S.Button,{type:"button",disabled:!this.srcValue,onClick:this.onInsert,themeColor:"primary",dir:l,key:"insert"},k(o=r.toLanguageString(v,d.messages[v]))?o:{default:()=>[o]})];return e.createVNode(b.Window,{initialWidth:500,initialHeight:360,windowClass:"k-editor-window",title:r.toLanguageString(c,d.messages[c]),onClose:this.onClose,key:"dialog",dir:l,style:l==="rtl"?{textAlign:"right"}:void 0,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},{default:()=>[C,e.createVNode(b.DialogActionsBar,null,k(V)?V:{default:()=>[V]})]})},methods:{handleSrcInput(t){this.srcValue=t.value},handleAltInput(t){this.altValue=t.value},handleTitleInput(t){this.titleValue=t.value},handleWidthInput(t){this.widthValue=t.value},handleHeightInput(t){this.heightValue=t.value},onClose(){this.$props.view.focus(),this.$emit("close")},onInsert(){const{view:t,settings:o}=this.$props,i=t.state.schema.nodes[o.node],l={src:this.src?this.srcValue:null,title:this.title?this.titleValue:null,alt:this.altText?this.altValue:null,width:this.width?this.widthValue:null,height:this.height?this.heightValue:null},c=Object.keys(l).filter(n=>l[n]!==null&&l[n]!=="").reduce((n,h)=>Object.assign(n,{[h]:l[h]}),{}),f=i.createAndFill(c);I.insertNode(f,!0)(t.state,n=>t.dispatch(n.setMeta("commandName",o.commandName).setMeta("args",c))),this.onClose()}}});exports.InsertImageDialog=T;
@@ -0,0 +1,211 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { defineComponent as L, createVNode as t, isVNode as T } from "vue";
9
+ import { Window as j, DialogActionsBar as x } from "@progress/kendo-vue-dialogs";
10
+ import { Button as S } from "@progress/kendo-vue-buttons";
11
+ import { NodeSelection as C, insertNode as z } from "@progress/kendo-editor-common";
12
+ import { provideLocalizationService as A } from "@progress/kendo-vue-intl";
13
+ import { messages as r } from "../messages/main.mjs";
14
+ import { getRef as c, setRef as g } from "@progress/kendo-vue-common";
15
+ import { Form as N, FormElement as O, FieldWrapper as m } from "@progress/kendo-vue-form";
16
+ import { Input as f } from "@progress/kendo-vue-inputs";
17
+ function k(e) {
18
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !T(e);
19
+ }
20
+ const K = /* @__PURE__ */ L({
21
+ name: "KendoInsertImageDialog",
22
+ emits: {
23
+ close: null
24
+ },
25
+ props: {
26
+ view: Object,
27
+ settings: Object,
28
+ dir: String
29
+ },
30
+ inject: {
31
+ kendoLocalizationService: {
32
+ default: null
33
+ }
34
+ },
35
+ data() {
36
+ const {
37
+ view: e,
38
+ settings: n
39
+ } = this.$props, l = e && e.state;
40
+ let i = {};
41
+ return l && l.selection instanceof C && l.selection.node.type === l.schema.nodes[n.node] && (i = l.selection.node.attrs), {
42
+ srcValue: i.src,
43
+ altValue: i.alt,
44
+ titleValue: i.title,
45
+ widthValue: i.width,
46
+ heightValue: i.height
47
+ };
48
+ },
49
+ mounted() {
50
+ this.src = c(this, "src"), this.altText = c(this, "altText"), this.title = c(this, "title"), this.width = c(this, "width"), this.height = c(this, "height"), this.src && this.src.focus();
51
+ },
52
+ render() {
53
+ let e, n;
54
+ const {
55
+ view: l,
56
+ settings: i,
57
+ dir: s
58
+ } = this.$props, {
59
+ insertImageDialogTitle: d,
60
+ insertImageAddress: p,
61
+ insertImageTitle: I,
62
+ insertImageAltText: a,
63
+ insertImageWidth: h,
64
+ insertImageHeight: v,
65
+ insertImageCancel: V,
66
+ insertImageInsert: b
67
+ } = i.messages, o = A(this), u = l && l.state;
68
+ u && u.selection instanceof C && u.selection.node.type === u.schema.nodes[i.node] && u.selection.node.attrs;
69
+ const y = t(N, null, {
70
+ default: () => [t(O, {
71
+ horizontal: !0
72
+ }, {
73
+ default: () => [t(m, null, {
74
+ default: () => [t("label", {
75
+ for: "k-editor-image-url",
76
+ class: "k-form-label"
77
+ }, [o.toLanguageString(p, r[p])]), t("div", {
78
+ class: "k-form-field-wrap"
79
+ }, [t(f, {
80
+ id: "k-editor-image-url",
81
+ value: this.srcValue,
82
+ onInput: this.handleSrcInput,
83
+ ref: g(this, "src")
84
+ }, null)])]
85
+ }), t(m, null, {
86
+ default: () => [t("label", {
87
+ for: "k-editor-image-url",
88
+ class: "k-form-label"
89
+ }, [o.toLanguageString(a, r[a])]), t("div", {
90
+ class: "k-form-field-wrap"
91
+ }, [t(f, {
92
+ id: "k-editor-image-alt",
93
+ value: this.altValue,
94
+ onInput: this.handleAltInput,
95
+ ref: g(this, "altText")
96
+ }, null)])]
97
+ }), t(m, null, {
98
+ default: () => [t("label", {
99
+ for: "k-editor-image-title",
100
+ class: "k-form-label"
101
+ }, [o.toLanguageString(I, r[I])]), t("div", {
102
+ class: "k-form-field-wrap"
103
+ }, [t(f, {
104
+ id: "k-editor-image-title",
105
+ value: this.titleValue,
106
+ onInput: this.handleTitleInput,
107
+ ref: g(this, "title")
108
+ }, null)])]
109
+ }), t(m, null, {
110
+ default: () => [t("label", {
111
+ for: "k-editor-image-width",
112
+ class: "k-form-label"
113
+ }, [o.toLanguageString(h, r[h])]), t("div", {
114
+ class: "k-form-field-wrap"
115
+ }, [t(f, {
116
+ id: "k-editor-image-width",
117
+ value: this.widthValue,
118
+ onInput: this.handleWidthInput,
119
+ ref: g(this, "width")
120
+ }, null)])]
121
+ }), t(m, null, {
122
+ default: () => [t("label", {
123
+ for: "k-editor-image-height",
124
+ class: "k-form-label"
125
+ }, [o.toLanguageString(v, r[v])]), t("div", {
126
+ class: "k-form-field-wrap"
127
+ }, [t(f, {
128
+ id: "k-editor-image-height",
129
+ value: this.heightValue,
130
+ onInput: this.handleHeightInput,
131
+ ref: g(this, "height")
132
+ }, null)])]
133
+ })]
134
+ })]
135
+ }), w = [t(S, {
136
+ type: "button",
137
+ onClick: this.onClose,
138
+ dir: s,
139
+ key: "cancel"
140
+ }, k(e = o.toLanguageString(V, r[V])) ? e : {
141
+ default: () => [e]
142
+ }), t(S, {
143
+ type: "button",
144
+ disabled: !this.srcValue,
145
+ onClick: this.onInsert,
146
+ themeColor: "primary",
147
+ dir: s,
148
+ key: "insert"
149
+ }, k(n = o.toLanguageString(b, r[b])) ? n : {
150
+ default: () => [n]
151
+ })];
152
+ return t(j, {
153
+ initialWidth: 500,
154
+ initialHeight: 360,
155
+ windowClass: "k-editor-window",
156
+ title: o.toLanguageString(d, r[d]),
157
+ onClose: this.onClose,
158
+ key: "dialog",
159
+ dir: s,
160
+ style: s === "rtl" ? {
161
+ textAlign: "right"
162
+ } : void 0,
163
+ modal: !0,
164
+ minimizeButton: () => null,
165
+ maximizeButton: () => null,
166
+ resizable: !1
167
+ }, {
168
+ default: () => [y, t(x, null, k(w) ? w : {
169
+ default: () => [w]
170
+ })]
171
+ });
172
+ },
173
+ methods: {
174
+ handleSrcInput(e) {
175
+ this.srcValue = e.value;
176
+ },
177
+ handleAltInput(e) {
178
+ this.altValue = e.value;
179
+ },
180
+ handleTitleInput(e) {
181
+ this.titleValue = e.value;
182
+ },
183
+ handleWidthInput(e) {
184
+ this.widthValue = e.value;
185
+ },
186
+ handleHeightInput(e) {
187
+ this.heightValue = e.value;
188
+ },
189
+ onClose() {
190
+ this.$props.view.focus(), this.$emit("close");
191
+ },
192
+ onInsert() {
193
+ const {
194
+ view: e,
195
+ settings: n
196
+ } = this.$props, i = e.state.schema.nodes[n.node], s = {
197
+ src: this.src ? this.srcValue : null,
198
+ title: this.title ? this.titleValue : null,
199
+ alt: this.altText ? this.altValue : null,
200
+ width: this.width ? this.widthValue : null,
201
+ height: this.height ? this.heightValue : null
202
+ }, d = Object.keys(s).filter((a) => s[a] !== null && s[a] !== "").reduce((a, h) => Object.assign(a, {
203
+ [h]: s[h]
204
+ }), {}), p = i.createAndFill(d);
205
+ z(p, !0)(e.state, (a) => e.dispatch(a.setMeta("commandName", n.commandName).setMeta("args", d))), this.onClose();
206
+ }
207
+ }
208
+ });
209
+ export {
210
+ K as InsertImageDialog
211
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),p=require("@progress/kendo-vue-dialogs"),m=require("@progress/kendo-vue-buttons"),V=require("@progress/kendo-editor-common"),v=require("@progress/kendo-vue-intl"),s=require("../messages/main.js"),o=require("@progress/kendo-vue-common"),a=require("@progress/kendo-vue-form"),d=require("@progress/kendo-vue-inputs");function C(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const y=t.defineComponent({name:"KendoInsertLinkDialog",emits:{close:null},props:{view:Object,settings:Object,dir:String},data(){const{view:e,settings:n}=this.$props,i=e?V.getMark(e.state,e.state.schema.marks[n.mark]):!1;return{hrefValue:i&&i.attrs.href||void 0,titleValue:i&&i.attrs.title||void 0,targetValue:i&&!!i.attrs.target||void 0}},inject:{kendoLocalizationService:{default:null}},mounted(){this.href=o.getRef(this,"href"),this.title=o.getRef(this,"title"),this.target=o.getRef(this,"target"),this.href&&this.href.focus()},render(){let e,n;const{settings:i,dir:l}=this.$props,r=v.provideLocalizationService(this),{insertHyperlinkDialogTitle:u,insertHyperlinkAddress:c,insertHyperlinkTitle:h,insertHyperlinkNewWindow:g,insertHyperlinkCancel:f,insertHyperlinkInsert:k}=i.messages,N=r.toLanguageString(g,s.messages[g]),b=t.createVNode(a.Form,null,{default:()=>[t.createVNode(a.FormElement,{horizontal:!0},{default:()=>[t.createVNode(a.FieldWrapper,null,{default:()=>[t.createVNode("label",{for:"k-editor-link-url",class:"k-form-label"},[r.toLanguageString(c,s.messages[c])]),t.createVNode("div",{class:"k-form-field-wrap"},[t.createVNode(d.Input,{id:"k-editor-link-url",ref:o.setRef(this,"href"),onInput:this.hrefChange,value:this.hrefValue},null)])]}),t.createVNode(a.FieldWrapper,null,{default:()=>[t.createVNode("label",{for:"k-editor-link-text",class:"k-form-label"},[r.toLanguageString(h,s.messages[h])]),t.createVNode("div",{class:"k-form-field-wrap"},[t.createVNode(d.Input,{id:"k-editor-link-text",ref:o.setRef(this,"title"),onInput:this.titleChange,value:this.titleValue},null)])]}),i.linkTarget!==!1&&t.createVNode(a.FieldWrapper,null,{default:()=>[t.createVNode("div",{class:"k-form-label"},null),t.createVNode("div",{class:"k-form-field-wrap"},[t.createVNode(d.Checkbox,{id:"k-editor-link-target",ref:o.setRef(this,"target"),label:N,onChange:this.targetChange,checked:this.targetValue},null)])]})]})]});return t.createVNode(p.Window,{initialWidth:450,initialHeight:250,windowClass:"k-editor-window",title:r.toLanguageString(u,s.messages[u]),onClose:this.onClose,dir:l,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},{default:()=>[b,t.createVNode(p.DialogActionsBar,null,{default:()=>[t.createVNode(m.Button,{type:"button",onClick:this.onClose,dir:l,key:"cancel"},C(e=r.toLanguageString(f,s.messages[f]))?e:{default:()=>[e]}),t.createVNode(m.Button,{type:"button",onClick:this.onInsert,themeColor:"primary",dir:l,key:"insert"},C(n=r.toLanguageString(k,s.messages[k]))?n:{default:()=>[n]})]})]})},methods:{hrefChange(e){this.hrefValue=e.value},titleChange(e){this.titleValue=e.value},targetChange(e){this.targetValue=e.value},onClose(){this.$props.view.focus(),this.$emit("close")},onInsert(){const e=this.$props.view,n=this.$props.settings.mark,i={href:this.href?this.hrefValue:void 0,title:this.title?this.titleValue:void 0,target:this.target&&this.targetValue?"_blank":void 0};V.applyLink({mark:n,attrs:i},this.$props.settings.commandName)(e.state,e.dispatch),this.onClose()}}});exports.InsertLinkDialog=y;