@ckeditor/ckeditor5-track-changes 44.1.0-alpha.5 → 44.2.0-alpha.0

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 (597) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +1 -1
  3. package/build/track-changes.js +3 -3
  4. package/build/translations/af.js +1 -1
  5. package/build/translations/ar.js +1 -1
  6. package/build/translations/ast.js +1 -1
  7. package/build/translations/az.js +1 -1
  8. package/build/translations/bg.js +1 -1
  9. package/build/translations/bn.js +1 -1
  10. package/build/translations/bs.js +1 -1
  11. package/build/translations/ca.js +1 -1
  12. package/build/translations/cs.js +1 -1
  13. package/build/translations/da.js +1 -1
  14. package/build/translations/de-ch.js +1 -1
  15. package/build/translations/de.js +1 -1
  16. package/build/translations/el.js +1 -1
  17. package/build/translations/en-au.js +1 -1
  18. package/build/translations/en-gb.js +1 -1
  19. package/build/translations/eo.js +1 -1
  20. package/build/translations/es-co.js +1 -1
  21. package/build/translations/es.js +1 -1
  22. package/build/translations/et.js +1 -1
  23. package/build/translations/eu.js +1 -1
  24. package/build/translations/fa.js +1 -1
  25. package/build/translations/fi.js +1 -1
  26. package/build/translations/fr.js +1 -1
  27. package/build/translations/gl.js +1 -1
  28. package/build/translations/gu.js +1 -1
  29. package/build/translations/he.js +1 -1
  30. package/build/translations/hi.js +1 -1
  31. package/build/translations/hr.js +1 -1
  32. package/build/translations/hu.js +1 -1
  33. package/build/translations/hy.js +1 -1
  34. package/build/translations/id.js +1 -1
  35. package/build/translations/it.js +1 -1
  36. package/build/translations/ja.js +1 -1
  37. package/build/translations/jv.js +1 -1
  38. package/build/translations/kk.js +1 -1
  39. package/build/translations/km.js +1 -1
  40. package/build/translations/kn.js +1 -1
  41. package/build/translations/ko.js +1 -1
  42. package/build/translations/ku.js +1 -1
  43. package/build/translations/lt.js +1 -1
  44. package/build/translations/lv.js +1 -1
  45. package/build/translations/ms.js +1 -1
  46. package/build/translations/nb.js +1 -1
  47. package/build/translations/ne.js +1 -1
  48. package/build/translations/nl.js +1 -1
  49. package/build/translations/no.js +1 -1
  50. package/build/translations/oc.js +1 -1
  51. package/build/translations/pl.js +1 -1
  52. package/build/translations/pt-br.js +1 -1
  53. package/build/translations/pt.js +1 -1
  54. package/build/translations/ro.js +1 -1
  55. package/build/translations/ru.js +1 -1
  56. package/build/translations/si.js +1 -1
  57. package/build/translations/sk.js +1 -1
  58. package/build/translations/sl.js +1 -1
  59. package/build/translations/sq.js +1 -1
  60. package/build/translations/sr-latn.js +1 -1
  61. package/build/translations/sr.js +1 -1
  62. package/build/translations/sv.js +1 -1
  63. package/build/translations/th.js +1 -1
  64. package/build/translations/ti.js +1 -1
  65. package/build/translations/tk.js +1 -1
  66. package/build/translations/tr.js +1 -1
  67. package/build/translations/tt.js +1 -1
  68. package/build/translations/ug.js +1 -1
  69. package/build/translations/uk.js +1 -1
  70. package/build/translations/ur.js +1 -1
  71. package/build/translations/uz.js +1 -1
  72. package/build/translations/vi.js +1 -1
  73. package/build/translations/zh-cn.js +1 -1
  74. package/build/translations/zh.js +1 -1
  75. package/ckeditor5-metadata.json +7 -0
  76. package/dist/index-content.css +3 -2
  77. package/dist/index-editor.css +13 -2
  78. package/dist/index.css +24 -2
  79. package/dist/index.js +4 -4
  80. package/dist/translations/af.d.ts +2 -2
  81. package/dist/translations/af.js +2 -2
  82. package/dist/translations/af.umd.js +2 -2
  83. package/dist/translations/ar.d.ts +2 -2
  84. package/dist/translations/ar.js +2 -2
  85. package/dist/translations/ar.umd.js +2 -2
  86. package/dist/translations/ast.d.ts +2 -2
  87. package/dist/translations/ast.js +2 -2
  88. package/dist/translations/ast.umd.js +2 -2
  89. package/dist/translations/az.d.ts +2 -2
  90. package/dist/translations/az.js +2 -2
  91. package/dist/translations/az.umd.js +2 -2
  92. package/dist/translations/bg.d.ts +2 -2
  93. package/dist/translations/bg.js +2 -2
  94. package/dist/translations/bg.umd.js +2 -2
  95. package/dist/translations/bn.d.ts +2 -2
  96. package/dist/translations/bn.js +2 -2
  97. package/dist/translations/bn.umd.js +2 -2
  98. package/dist/translations/bs.d.ts +2 -2
  99. package/dist/translations/bs.js +2 -2
  100. package/dist/translations/bs.umd.js +2 -2
  101. package/dist/translations/ca.d.ts +2 -2
  102. package/dist/translations/ca.js +2 -2
  103. package/dist/translations/ca.umd.js +2 -2
  104. package/dist/translations/cs.d.ts +2 -2
  105. package/dist/translations/cs.js +2 -2
  106. package/dist/translations/cs.umd.js +2 -2
  107. package/dist/translations/da.d.ts +2 -2
  108. package/dist/translations/da.js +2 -2
  109. package/dist/translations/da.umd.js +2 -2
  110. package/dist/translations/de-ch.d.ts +2 -2
  111. package/dist/translations/de-ch.js +2 -2
  112. package/dist/translations/de-ch.umd.js +2 -2
  113. package/dist/translations/de.d.ts +2 -2
  114. package/dist/translations/de.js +2 -2
  115. package/dist/translations/de.umd.js +2 -2
  116. package/dist/translations/el.d.ts +2 -2
  117. package/dist/translations/el.js +2 -2
  118. package/dist/translations/el.umd.js +2 -2
  119. package/dist/translations/en-au.d.ts +2 -2
  120. package/dist/translations/en-au.js +2 -2
  121. package/dist/translations/en-au.umd.js +2 -2
  122. package/dist/translations/en-gb.d.ts +2 -2
  123. package/dist/translations/en-gb.js +2 -2
  124. package/dist/translations/en-gb.umd.js +2 -2
  125. package/dist/translations/en.d.ts +2 -2
  126. package/dist/translations/en.js +2 -2
  127. package/dist/translations/en.umd.js +2 -2
  128. package/dist/translations/eo.d.ts +2 -2
  129. package/dist/translations/eo.js +2 -2
  130. package/dist/translations/eo.umd.js +2 -2
  131. package/dist/translations/es-co.d.ts +2 -2
  132. package/dist/translations/es-co.js +2 -2
  133. package/dist/translations/es-co.umd.js +2 -2
  134. package/dist/translations/es.d.ts +2 -2
  135. package/dist/translations/es.js +2 -2
  136. package/dist/translations/es.umd.js +2 -2
  137. package/dist/translations/et.d.ts +2 -2
  138. package/dist/translations/et.js +2 -2
  139. package/dist/translations/et.umd.js +2 -2
  140. package/dist/translations/eu.d.ts +2 -2
  141. package/dist/translations/eu.js +2 -2
  142. package/dist/translations/eu.umd.js +2 -2
  143. package/dist/translations/fa.d.ts +2 -2
  144. package/dist/translations/fa.js +2 -2
  145. package/dist/translations/fa.umd.js +2 -2
  146. package/dist/translations/fi.d.ts +2 -2
  147. package/dist/translations/fi.js +2 -2
  148. package/dist/translations/fi.umd.js +2 -2
  149. package/dist/translations/fr.d.ts +2 -2
  150. package/dist/translations/fr.js +2 -2
  151. package/dist/translations/fr.umd.js +2 -2
  152. package/dist/translations/gl.d.ts +2 -2
  153. package/dist/translations/gl.js +2 -2
  154. package/dist/translations/gl.umd.js +2 -2
  155. package/dist/translations/gu.d.ts +2 -2
  156. package/dist/translations/gu.js +2 -2
  157. package/dist/translations/gu.umd.js +2 -2
  158. package/dist/translations/he.d.ts +2 -2
  159. package/dist/translations/he.js +2 -2
  160. package/dist/translations/he.umd.js +2 -2
  161. package/dist/translations/hi.d.ts +2 -2
  162. package/dist/translations/hi.js +2 -2
  163. package/dist/translations/hi.umd.js +2 -2
  164. package/dist/translations/hr.d.ts +2 -2
  165. package/dist/translations/hr.js +2 -2
  166. package/dist/translations/hr.umd.js +2 -2
  167. package/dist/translations/hu.d.ts +2 -2
  168. package/dist/translations/hu.js +2 -2
  169. package/dist/translations/hu.umd.js +2 -2
  170. package/dist/translations/hy.d.ts +2 -2
  171. package/dist/translations/hy.js +2 -2
  172. package/dist/translations/hy.umd.js +2 -2
  173. package/dist/translations/id.d.ts +2 -2
  174. package/dist/translations/id.js +2 -2
  175. package/dist/translations/id.umd.js +2 -2
  176. package/dist/translations/it.d.ts +2 -2
  177. package/dist/translations/it.js +2 -2
  178. package/dist/translations/it.umd.js +2 -2
  179. package/dist/translations/ja.d.ts +2 -2
  180. package/dist/translations/ja.js +2 -2
  181. package/dist/translations/ja.umd.js +2 -2
  182. package/dist/translations/jv.d.ts +2 -2
  183. package/dist/translations/jv.js +2 -2
  184. package/dist/translations/jv.umd.js +2 -2
  185. package/dist/translations/kk.d.ts +2 -2
  186. package/dist/translations/kk.js +2 -2
  187. package/dist/translations/kk.umd.js +2 -2
  188. package/dist/translations/km.d.ts +2 -2
  189. package/dist/translations/km.js +2 -2
  190. package/dist/translations/km.umd.js +2 -2
  191. package/dist/translations/kn.d.ts +2 -2
  192. package/dist/translations/kn.js +2 -2
  193. package/dist/translations/kn.umd.js +2 -2
  194. package/dist/translations/ko.d.ts +2 -2
  195. package/dist/translations/ko.js +2 -2
  196. package/dist/translations/ko.umd.js +2 -2
  197. package/dist/translations/ku.d.ts +2 -2
  198. package/dist/translations/ku.js +2 -2
  199. package/dist/translations/ku.umd.js +2 -2
  200. package/dist/translations/lt.d.ts +2 -2
  201. package/dist/translations/lt.js +2 -2
  202. package/dist/translations/lt.umd.js +2 -2
  203. package/dist/translations/lv.d.ts +2 -2
  204. package/dist/translations/lv.js +2 -2
  205. package/dist/translations/lv.umd.js +2 -2
  206. package/dist/translations/ms.d.ts +2 -2
  207. package/dist/translations/ms.js +2 -2
  208. package/dist/translations/ms.umd.js +2 -2
  209. package/dist/translations/nb.d.ts +2 -2
  210. package/dist/translations/nb.js +2 -2
  211. package/dist/translations/nb.umd.js +2 -2
  212. package/dist/translations/ne.d.ts +2 -2
  213. package/dist/translations/ne.js +2 -2
  214. package/dist/translations/ne.umd.js +2 -2
  215. package/dist/translations/nl.d.ts +2 -2
  216. package/dist/translations/nl.js +2 -2
  217. package/dist/translations/nl.umd.js +2 -2
  218. package/dist/translations/no.d.ts +2 -2
  219. package/dist/translations/no.js +2 -2
  220. package/dist/translations/no.umd.js +2 -2
  221. package/dist/translations/oc.d.ts +2 -2
  222. package/dist/translations/oc.js +2 -2
  223. package/dist/translations/oc.umd.js +2 -2
  224. package/dist/translations/pl.d.ts +2 -2
  225. package/dist/translations/pl.js +2 -2
  226. package/dist/translations/pl.umd.js +2 -2
  227. package/dist/translations/pt-br.d.ts +2 -2
  228. package/dist/translations/pt-br.js +2 -2
  229. package/dist/translations/pt-br.umd.js +2 -2
  230. package/dist/translations/pt.d.ts +2 -2
  231. package/dist/translations/pt.js +2 -2
  232. package/dist/translations/pt.umd.js +2 -2
  233. package/dist/translations/ro.d.ts +2 -2
  234. package/dist/translations/ro.js +2 -2
  235. package/dist/translations/ro.umd.js +2 -2
  236. package/dist/translations/ru.d.ts +2 -2
  237. package/dist/translations/ru.js +2 -2
  238. package/dist/translations/ru.umd.js +2 -2
  239. package/dist/translations/si.d.ts +2 -2
  240. package/dist/translations/si.js +2 -2
  241. package/dist/translations/si.umd.js +2 -2
  242. package/dist/translations/sk.d.ts +2 -2
  243. package/dist/translations/sk.js +2 -2
  244. package/dist/translations/sk.umd.js +2 -2
  245. package/dist/translations/sl.d.ts +2 -2
  246. package/dist/translations/sl.js +2 -2
  247. package/dist/translations/sl.umd.js +2 -2
  248. package/dist/translations/sq.d.ts +2 -2
  249. package/dist/translations/sq.js +2 -2
  250. package/dist/translations/sq.umd.js +2 -2
  251. package/dist/translations/sr-latn.d.ts +2 -2
  252. package/dist/translations/sr-latn.js +2 -2
  253. package/dist/translations/sr-latn.umd.js +2 -2
  254. package/dist/translations/sr.d.ts +2 -2
  255. package/dist/translations/sr.js +2 -2
  256. package/dist/translations/sr.umd.js +2 -2
  257. package/dist/translations/sv.d.ts +2 -2
  258. package/dist/translations/sv.js +2 -2
  259. package/dist/translations/sv.umd.js +2 -2
  260. package/dist/translations/th.d.ts +2 -2
  261. package/dist/translations/th.js +2 -2
  262. package/dist/translations/th.umd.js +2 -2
  263. package/dist/translations/ti.d.ts +2 -2
  264. package/dist/translations/ti.js +2 -2
  265. package/dist/translations/ti.umd.js +2 -2
  266. package/dist/translations/tk.d.ts +2 -2
  267. package/dist/translations/tk.js +2 -2
  268. package/dist/translations/tk.umd.js +2 -2
  269. package/dist/translations/tr.d.ts +2 -2
  270. package/dist/translations/tr.js +2 -2
  271. package/dist/translations/tr.umd.js +2 -2
  272. package/dist/translations/tt.d.ts +2 -2
  273. package/dist/translations/tt.js +2 -2
  274. package/dist/translations/tt.umd.js +2 -2
  275. package/dist/translations/ug.d.ts +2 -2
  276. package/dist/translations/ug.js +2 -2
  277. package/dist/translations/ug.umd.js +2 -2
  278. package/dist/translations/uk.d.ts +2 -2
  279. package/dist/translations/uk.js +2 -2
  280. package/dist/translations/uk.umd.js +2 -2
  281. package/dist/translations/ur.d.ts +2 -2
  282. package/dist/translations/ur.js +2 -2
  283. package/dist/translations/ur.umd.js +2 -2
  284. package/dist/translations/uz.d.ts +2 -2
  285. package/dist/translations/uz.js +2 -2
  286. package/dist/translations/uz.umd.js +2 -2
  287. package/dist/translations/vi.d.ts +2 -2
  288. package/dist/translations/vi.js +2 -2
  289. package/dist/translations/vi.umd.js +2 -2
  290. package/dist/translations/zh-cn.d.ts +2 -2
  291. package/dist/translations/zh-cn.js +2 -2
  292. package/dist/translations/zh-cn.umd.js +2 -2
  293. package/dist/translations/zh.d.ts +2 -2
  294. package/dist/translations/zh.js +2 -2
  295. package/dist/translations/zh.umd.js +2 -2
  296. package/lang/contexts.json +3 -1
  297. package/lang/translations/af.po +13 -5
  298. package/lang/translations/ar.po +13 -5
  299. package/lang/translations/ast.po +13 -5
  300. package/lang/translations/az.po +13 -5
  301. package/lang/translations/bg.po +13 -5
  302. package/lang/translations/bn.po +13 -5
  303. package/lang/translations/bs.po +13 -5
  304. package/lang/translations/ca.po +13 -5
  305. package/lang/translations/cs.po +13 -5
  306. package/lang/translations/da.po +13 -5
  307. package/lang/translations/de-ch.po +13 -5
  308. package/lang/translations/de.po +13 -5
  309. package/lang/translations/el.po +13 -5
  310. package/lang/translations/en-au.po +13 -5
  311. package/lang/translations/en-gb.po +13 -5
  312. package/lang/translations/en.po +13 -5
  313. package/lang/translations/eo.po +13 -5
  314. package/lang/translations/es-co.po +13 -5
  315. package/lang/translations/es.po +13 -5
  316. package/lang/translations/et.po +13 -5
  317. package/lang/translations/eu.po +13 -5
  318. package/lang/translations/fa.po +13 -5
  319. package/lang/translations/fi.po +13 -5
  320. package/lang/translations/fr.po +13 -5
  321. package/lang/translations/gl.po +13 -5
  322. package/lang/translations/gu.po +13 -5
  323. package/lang/translations/he.po +13 -5
  324. package/lang/translations/hi.po +13 -5
  325. package/lang/translations/hr.po +13 -5
  326. package/lang/translations/hu.po +13 -5
  327. package/lang/translations/hy.po +13 -5
  328. package/lang/translations/id.po +13 -5
  329. package/lang/translations/it.po +13 -5
  330. package/lang/translations/ja.po +13 -5
  331. package/lang/translations/jv.po +13 -5
  332. package/lang/translations/kk.po +13 -5
  333. package/lang/translations/km.po +13 -5
  334. package/lang/translations/kn.po +13 -5
  335. package/lang/translations/ko.po +13 -5
  336. package/lang/translations/ku.po +13 -5
  337. package/lang/translations/lt.po +13 -5
  338. package/lang/translations/lv.po +13 -5
  339. package/lang/translations/ms.po +13 -5
  340. package/lang/translations/nb.po +13 -5
  341. package/lang/translations/ne.po +13 -5
  342. package/lang/translations/nl.po +13 -5
  343. package/lang/translations/no.po +13 -5
  344. package/lang/translations/oc.po +13 -5
  345. package/lang/translations/pl.po +13 -5
  346. package/lang/translations/pt-br.po +13 -5
  347. package/lang/translations/pt.po +13 -5
  348. package/lang/translations/ro.po +13 -5
  349. package/lang/translations/ru.po +13 -5
  350. package/lang/translations/si.po +13 -5
  351. package/lang/translations/sk.po +13 -5
  352. package/lang/translations/sl.po +13 -5
  353. package/lang/translations/sq.po +13 -5
  354. package/lang/translations/sr-latn.po +13 -5
  355. package/lang/translations/sr.po +13 -5
  356. package/lang/translations/sv.po +13 -5
  357. package/lang/translations/th.po +13 -5
  358. package/lang/translations/ti.po +13 -5
  359. package/lang/translations/tk.po +13 -5
  360. package/lang/translations/tr.po +13 -5
  361. package/lang/translations/tt.po +13 -5
  362. package/lang/translations/ug.po +13 -5
  363. package/lang/translations/uk.po +13 -5
  364. package/lang/translations/ur.po +13 -5
  365. package/lang/translations/uz.po +13 -5
  366. package/lang/translations/vi.po +13 -5
  367. package/lang/translations/zh-cn.po +13 -5
  368. package/lang/translations/zh.po +13 -5
  369. package/package.json +47 -10
  370. package/src/augmentation.d.ts +4 -2
  371. package/src/augmentation.js +1 -1
  372. package/src/commands/acceptsuggestioncommand.d.ts +1 -1
  373. package/src/commands/acceptsuggestioncommand.js +2 -2
  374. package/src/commands/discardsuggestioncommand.d.ts +1 -1
  375. package/src/commands/discardsuggestioncommand.js +2 -2
  376. package/src/commands/executeonallsuggestionscommand.d.ts +1 -1
  377. package/src/commands/executeonallsuggestionscommand.js +2 -2
  378. package/src/commands/executeonselectedsuggestionscommand.d.ts +1 -1
  379. package/src/commands/executeonselectedsuggestionscommand.js +2 -2
  380. package/src/commands/previewfinalcontentcommand.d.ts +26 -0
  381. package/src/commands/previewfinalcontentcommand.js +23 -0
  382. package/src/commands/trackchangescommand.d.ts +1 -1
  383. package/src/commands/trackchangescommand.js +2 -2
  384. package/src/index.d.ts +3 -1
  385. package/src/index.js +2 -2
  386. package/src/integrations/aiassistant.d.ts +1 -1
  387. package/src/integrations/aiassistant.js +2 -2
  388. package/src/integrations/alignment.d.ts +1 -1
  389. package/src/integrations/alignment.js +2 -2
  390. package/src/integrations/basicstyles.d.ts +1 -1
  391. package/src/integrations/basicstyles.js +2 -2
  392. package/src/integrations/blockquote.d.ts +1 -1
  393. package/src/integrations/blockquote.js +2 -2
  394. package/src/integrations/bookmark.d.ts +1 -1
  395. package/src/integrations/bookmark.js +2 -2
  396. package/src/integrations/casechange.d.ts +1 -1
  397. package/src/integrations/casechange.js +2 -2
  398. package/src/integrations/ckbox.d.ts +1 -1
  399. package/src/integrations/ckbox.js +2 -2
  400. package/src/integrations/codeblock.d.ts +1 -1
  401. package/src/integrations/codeblock.js +2 -2
  402. package/src/integrations/comments.d.ts +1 -1
  403. package/src/integrations/comments.js +2 -2
  404. package/src/integrations/deletecommand.d.ts +1 -1
  405. package/src/integrations/deletecommand.js +2 -2
  406. package/src/integrations/entercommand.d.ts +1 -1
  407. package/src/integrations/entercommand.js +2 -2
  408. package/src/integrations/findandreplace.d.ts +1 -1
  409. package/src/integrations/findandreplace.js +2 -2
  410. package/src/integrations/font.d.ts +1 -1
  411. package/src/integrations/font.js +2 -2
  412. package/src/integrations/formatpainter.d.ts +1 -1
  413. package/src/integrations/formatpainter.js +2 -2
  414. package/src/integrations/heading.d.ts +1 -1
  415. package/src/integrations/heading.js +2 -2
  416. package/src/integrations/highlight.d.ts +1 -1
  417. package/src/integrations/highlight.js +2 -2
  418. package/src/integrations/horizontalline.d.ts +1 -1
  419. package/src/integrations/horizontalline.js +2 -2
  420. package/src/integrations/htmlembed.d.ts +1 -1
  421. package/src/integrations/htmlembed.js +2 -2
  422. package/src/integrations/image.d.ts +1 -1
  423. package/src/integrations/image.js +2 -2
  424. package/src/integrations/imagereplace.d.ts +1 -1
  425. package/src/integrations/imagereplace.js +2 -2
  426. package/src/integrations/imagestyle.d.ts +1 -1
  427. package/src/integrations/imagestyle.js +2 -2
  428. package/src/integrations/importword.d.ts +1 -1
  429. package/src/integrations/importword.js +2 -2
  430. package/src/integrations/indent.d.ts +1 -1
  431. package/src/integrations/indent.js +2 -2
  432. package/src/integrations/inputcommand.d.ts +1 -1
  433. package/src/integrations/inputcommand.js +2 -2
  434. package/src/integrations/legacylist.d.ts +1 -1
  435. package/src/integrations/legacylist.js +2 -2
  436. package/src/integrations/legacylistproperties.d.ts +1 -1
  437. package/src/integrations/legacylistproperties.js +2 -2
  438. package/src/integrations/link.d.ts +1 -1
  439. package/src/integrations/link.js +2 -2
  440. package/src/integrations/list.d.ts +1 -1
  441. package/src/integrations/list.js +2 -2
  442. package/src/integrations/listproperties.d.ts +1 -1
  443. package/src/integrations/listproperties.js +2 -2
  444. package/src/integrations/mediaembed.d.ts +1 -1
  445. package/src/integrations/mediaembed.js +2 -2
  446. package/src/integrations/mention.d.ts +1 -1
  447. package/src/integrations/mention.js +2 -2
  448. package/src/integrations/mergefields.d.ts +1 -1
  449. package/src/integrations/mergefields.js +2 -2
  450. package/src/integrations/multilevellist.d.ts +1 -1
  451. package/src/integrations/multilevellist.js +2 -2
  452. package/src/integrations/pagebreak.d.ts +1 -1
  453. package/src/integrations/pagebreak.js +2 -2
  454. package/src/integrations/paragraph.d.ts +1 -1
  455. package/src/integrations/paragraph.js +2 -2
  456. package/src/integrations/removeformat.d.ts +1 -1
  457. package/src/integrations/removeformat.js +2 -2
  458. package/src/integrations/restrictededitingmode.d.ts +1 -1
  459. package/src/integrations/restrictededitingmode.js +2 -2
  460. package/src/integrations/shiftentercommand.d.ts +1 -1
  461. package/src/integrations/shiftentercommand.js +2 -2
  462. package/src/integrations/standardeditingmode.d.ts +1 -1
  463. package/src/integrations/standardeditingmode.js +2 -2
  464. package/src/integrations/style.d.ts +1 -1
  465. package/src/integrations/style.js +2 -2
  466. package/src/integrations/table.d.ts +1 -1
  467. package/src/integrations/table.js +2 -2
  468. package/src/integrations/tablecaption.d.ts +1 -1
  469. package/src/integrations/tablecaption.js +2 -2
  470. package/src/integrations/tableclipboard.d.ts +1 -1
  471. package/src/integrations/tableclipboard.js +2 -2
  472. package/src/integrations/tablecolumnresize.d.ts +1 -1
  473. package/src/integrations/tablecolumnresize.js +2 -2
  474. package/src/integrations/tableheadings.d.ts +1 -1
  475. package/src/integrations/tableheadings.js +2 -2
  476. package/src/integrations/tablemergesplit.d.ts +1 -1
  477. package/src/integrations/tablemergesplit.js +2 -2
  478. package/src/integrations/tableofcontents.d.ts +1 -1
  479. package/src/integrations/tableofcontents.js +2 -2
  480. package/src/integrations/tableproperties.d.ts +1 -1
  481. package/src/integrations/tableproperties.js +2 -2
  482. package/src/integrations/template.d.ts +1 -1
  483. package/src/integrations/template.js +2 -2
  484. package/src/integrations/title.d.ts +1 -1
  485. package/src/integrations/title.js +2 -2
  486. package/src/integrations/undo.d.ts +1 -1
  487. package/src/integrations/undo.js +2 -2
  488. package/src/integrations/uploadcare.d.ts +17 -0
  489. package/src/integrations/uploadcare.js +23 -0
  490. package/src/integrations/utils.d.ts +1 -1
  491. package/src/integrations/utils.js +2 -2
  492. package/src/suggestion.d.ts +1 -1
  493. package/src/suggestion.js +3 -3
  494. package/src/suggestiondescriptionfactory.d.ts +1 -1
  495. package/src/suggestiondescriptionfactory.js +2 -2
  496. package/src/trackchanges.d.ts +1 -1
  497. package/src/trackchanges.js +2 -2
  498. package/src/trackchangesconfig.d.ts +23 -1
  499. package/src/trackchangesconfig.js +1 -1
  500. package/src/trackchangesdata.d.ts +2 -2
  501. package/src/trackchangesdata.js +2 -2
  502. package/src/trackchangesediting.d.ts +3 -2
  503. package/src/trackchangesediting.js +2 -2
  504. package/src/trackchangespreview.d.ts +31 -0
  505. package/src/trackchangespreview.js +23 -0
  506. package/src/trackchangesui.d.ts +1 -1
  507. package/src/trackchangesui.js +2 -2
  508. package/src/ui/suggestioncontroller.d.ts +1 -1
  509. package/src/ui/suggestioncontroller.js +3 -3
  510. package/src/ui/view/basesuggestionthreadview.d.ts +1 -1
  511. package/src/ui/view/basesuggestionthreadview.js +2 -2
  512. package/src/ui/view/suggestionthreadview.d.ts +1 -1
  513. package/src/ui/view/suggestionthreadview.js +2 -2
  514. package/src/ui/view/suggestionview.d.ts +1 -1
  515. package/src/ui/view/suggestionview.js +2 -2
  516. package/src/ui/view/trackchangespreviewview.d.ts +48 -0
  517. package/src/ui/view/trackchangespreviewview.js +23 -0
  518. package/src/utils/common-translations.d.ts +1 -1
  519. package/src/utils/common-translations.js +2 -2
  520. package/src/utils/utils.d.ts +1 -1
  521. package/src/utils/utils.js +2 -2
  522. package/theme/icons/track-changes-accept.svg +1 -1
  523. package/theme/icons/track-changes-discard.svg +1 -1
  524. package/theme/icons/track-changes.svg +1 -1
  525. package/theme/trackchangespreview.css +22 -0
  526. package/dist/augmentation.d.ts +0 -46
  527. package/dist/commands/acceptsuggestioncommand.d.ts +0 -28
  528. package/dist/commands/discardsuggestioncommand.d.ts +0 -28
  529. package/dist/commands/executeonallsuggestionscommand.d.ts +0 -28
  530. package/dist/commands/executeonselectedsuggestionscommand.d.ts +0 -28
  531. package/dist/commands/trackchangescommand.d.ts +0 -30
  532. package/dist/index.d.ts +0 -23
  533. package/dist/integrations/aiassistant.d.ts +0 -21
  534. package/dist/integrations/alignment.d.ts +0 -21
  535. package/dist/integrations/basicstyles.d.ts +0 -21
  536. package/dist/integrations/blockquote.d.ts +0 -21
  537. package/dist/integrations/bookmark.d.ts +0 -21
  538. package/dist/integrations/casechange.d.ts +0 -21
  539. package/dist/integrations/ckbox.d.ts +0 -21
  540. package/dist/integrations/codeblock.d.ts +0 -21
  541. package/dist/integrations/comments.d.ts +0 -18
  542. package/dist/integrations/deletecommand.d.ts +0 -21
  543. package/dist/integrations/entercommand.d.ts +0 -20
  544. package/dist/integrations/findandreplace.d.ts +0 -25
  545. package/dist/integrations/font.d.ts +0 -21
  546. package/dist/integrations/formatpainter.d.ts +0 -21
  547. package/dist/integrations/heading.d.ts +0 -21
  548. package/dist/integrations/highlight.d.ts +0 -21
  549. package/dist/integrations/horizontalline.d.ts +0 -21
  550. package/dist/integrations/htmlembed.d.ts +0 -21
  551. package/dist/integrations/image.d.ts +0 -21
  552. package/dist/integrations/imagereplace.d.ts +0 -21
  553. package/dist/integrations/imagestyle.d.ts +0 -21
  554. package/dist/integrations/importword.d.ts +0 -22
  555. package/dist/integrations/indent.d.ts +0 -21
  556. package/dist/integrations/inputcommand.d.ts +0 -20
  557. package/dist/integrations/legacylist.d.ts +0 -21
  558. package/dist/integrations/legacylistproperties.d.ts +0 -33
  559. package/dist/integrations/link.d.ts +0 -21
  560. package/dist/integrations/list.d.ts +0 -21
  561. package/dist/integrations/listproperties.d.ts +0 -24
  562. package/dist/integrations/mediaembed.d.ts +0 -21
  563. package/dist/integrations/mention.d.ts +0 -21
  564. package/dist/integrations/mergefields.d.ts +0 -21
  565. package/dist/integrations/multilevellist.d.ts +0 -28
  566. package/dist/integrations/pagebreak.d.ts +0 -21
  567. package/dist/integrations/paragraph.d.ts +0 -21
  568. package/dist/integrations/removeformat.d.ts +0 -21
  569. package/dist/integrations/restrictededitingmode.d.ts +0 -21
  570. package/dist/integrations/shiftentercommand.d.ts +0 -20
  571. package/dist/integrations/standardeditingmode.d.ts +0 -21
  572. package/dist/integrations/style.d.ts +0 -21
  573. package/dist/integrations/table.d.ts +0 -46
  574. package/dist/integrations/tablecaption.d.ts +0 -26
  575. package/dist/integrations/tableclipboard.d.ts +0 -23
  576. package/dist/integrations/tablecolumnresize.d.ts +0 -30
  577. package/dist/integrations/tableheadings.d.ts +0 -26
  578. package/dist/integrations/tablemergesplit.d.ts +0 -26
  579. package/dist/integrations/tableofcontents.d.ts +0 -21
  580. package/dist/integrations/tableproperties.d.ts +0 -39
  581. package/dist/integrations/template.d.ts +0 -21
  582. package/dist/integrations/title.d.ts +0 -21
  583. package/dist/integrations/undo.d.ts +0 -21
  584. package/dist/integrations/utils.d.ts +0 -21
  585. package/dist/suggestion.d.ts +0 -295
  586. package/dist/suggestiondescriptionfactory.d.ts +0 -187
  587. package/dist/trackchanges.d.ts +0 -192
  588. package/dist/trackchangesconfig.d.ts +0 -89
  589. package/dist/trackchangesdata.d.ts +0 -53
  590. package/dist/trackchangesediting.d.ts +0 -563
  591. package/dist/trackchangesui.d.ts +0 -50
  592. package/dist/ui/suggestioncontroller.d.ts +0 -41
  593. package/dist/ui/view/basesuggestionthreadview.d.ts +0 -209
  594. package/dist/ui/view/suggestionthreadview.d.ts +0 -98
  595. package/dist/ui/view/suggestionview.d.ts +0 -194
  596. package/dist/utils/common-translations.d.ts +0 -13
  597. package/dist/utils/utils.d.ts +0 -41
@@ -1,295 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module track-changes/suggestion
11
- * @publicApi
12
- */
13
- import { Element, type Marker, type Model, type Range, type Item } from 'ckeditor5/src/engine.js';
14
- import type { User } from 'ckeditor5-collaboration/src/collaboration-core.js';
15
- import type { CommentThread } from '@ckeditor/ckeditor5-comments';
16
- import type { FormatData, AttributeData } from './trackchangesediting.js';
17
- declare const Suggestion_base: {
18
- new (): import("ckeditor5/src/utils.js").Observable;
19
- prototype: import("ckeditor5/src/utils.js").Observable;
20
- };
21
- /**
22
- * Represents a singular suggestion that is tracked by track changes plugin.
23
- *
24
- * `Suggestion` instances are created and handled by {@link module:track-changes/trackchanges~TrackChanges track changes plugin}.
25
- */
26
- export default class Suggestion extends /* #__PURE__ -- @preserve */ Suggestion_base {
27
- /**
28
- * Suggestion ID.
29
- */
30
- readonly id: string;
31
- /**
32
- * Suggestion type.
33
- */
34
- type: SuggestionType;
35
- /**
36
- * Suggestion sub-type.
37
- *
38
- * This is an additional identifier for suggestions. Two suggestions of the same type may have different sub-types to differentiate
39
- * suggestions behavior and handle interactions between suggestions.
40
- *
41
- * Sub-type is used for:
42
- *
43
- * * suggestions joining (only suggestions with the same sub-type can be joined),
44
- * * suggestions custom callbacks (fired when adding, deleting and joining suggestions).
45
- */
46
- subType: string | null;
47
- /**
48
- * The author of the change marked by the suggestion.
49
- */
50
- author: User;
51
- /**
52
- * The user which saved the suggestion data in the database.
53
- *
54
- * Usually the same as author but may be different in some cases (e.g. when suggestion was added from an external source).
55
- */
56
- creator: User;
57
- /**
58
- * The flag indicating whether the suggestion comes from an external source.
59
- */
60
- isExternal: boolean;
61
- /**
62
- * Additional suggestion data.
63
- */
64
- data: FormatData | AttributeData | null;
65
- /**
66
- * Date when the suggestion was saved in the database.
67
- */
68
- createdAt: Date | null;
69
- /**
70
- * Date when the change marked by the suggestion was made.
71
- *
72
- * Usually the same as {@link #createdAt `createdAt`} but may be different in some cases
73
- * (e.g. when suggestion was added from an external source).
74
- *
75
- * @observable
76
- */
77
- authoredAt: Date | null;
78
- /**
79
- * Custom suggestion attributes. See also {@link #setAttribute} and {@link #removeAttribute}.
80
- *
81
- * @observable
82
- */
83
- attributes: {
84
- [k: string]: unknown;
85
- };
86
- /**
87
- * Previous suggestion in suggestions chain.
88
- *
89
- * Chained suggestions should be handled as one entity.
90
- *
91
- * @observable
92
- */
93
- previous: Suggestion | null;
94
- /**
95
- * Next suggestion in suggestions chain.
96
- *
97
- * Chained suggestions should be handled as one entity.
98
- *
99
- * @observable
100
- */
101
- next: Suggestion | null;
102
- /**
103
- * Comment thread model for comments added to this suggestion.
104
- *
105
- * @observable
106
- */
107
- commentThread: CommentThread | null;
108
- constructor(model: Model, options: SuggestionOptions);
109
- /**
110
- * The first (most-previous) suggestion in this suggestion chain.
111
- */
112
- get head(): Suggestion;
113
- /**
114
- * Informs whether suggestion has at least one comment.
115
- */
116
- get hasComments(): boolean;
117
- /**
118
- * Informs whether the suggestion is a multi-range suggestion or a single-range suggestion.
119
- *
120
- * This is evaluated basing on the marker name belonging to this suggestion.
121
- * Even if only one marker belongs to the suggestion at a given time it can still be a multi range suggestion.
122
- */
123
- get isMultiRange(): boolean;
124
- /**
125
- * Informs whether the suggestion is still in the editor content.
126
- *
127
- * Returns `true` if there is at least one marker suggestion in the editor content.
128
- */
129
- get isInContent(): boolean;
130
- /**
131
- * Binds given marker name to this suggestion.
132
- */
133
- addMarkerName(markerName: string): void;
134
- /**
135
- * Returns all names of markers belonging to this suggestion.
136
- */
137
- getMarkerNames(): Array<string>;
138
- /**
139
- * Returns all markers belonging to this suggestion.
140
- */
141
- getMarkers(): Array<Marker>;
142
- /**
143
- * Returns the first marker belonging to this suggestion, i.e the first marker that was added to this suggestion
144
- * and not removed yet.
145
- *
146
- * This method is useful if you know that the suggestion has only one marker and want to process it.
147
- */
148
- getFirstMarker(): Marker | null;
149
- /**
150
- * Removes all markers from the suggestion and the editor content.
151
- */
152
- removeMarkers(): void;
153
- /**
154
- * Removes marker with the given name from the suggestion and the editor content.
155
- */
156
- removeMarker(markerName: string): void;
157
- /**
158
- * Adds a new range to this suggestion. It is assumed that the suggestion is a multi-range suggestion.
159
- *
160
- * A marker name is generated from this suggestion's properties and a marker with that name is created and set to a given `range`.
161
- */
162
- addRange(range: Range): void;
163
- /**
164
- * Checks if given `range` is intersecting with any of the ranges of markers belonging to this suggestion.
165
- */
166
- isIntersectingWithRange(range: Range): boolean;
167
- /**
168
- * Returns all ranges of all markers belonging to this suggestion.
169
- */
170
- getRanges(): Array<Range>;
171
- /**
172
- * Returns all {@link module:engine/model/item~Item model items} that are in this suggestion.
173
- */
174
- getItems(): Array<Item>;
175
- /**
176
- * Returns the first range belonging to this suggestion, i.e. the range of the first marker that was added to
177
- * this suggestion and not removed yet.
178
- *
179
- * This method is useful if you know that the suggestion has only one marker and want to process its range.
180
- */
181
- getFirstRange(): Range | null;
182
- /**
183
- * Returns the model element contained in the suggestion.
184
- *
185
- * A {@link module:engine/model/element~Element model element} is considered as contained if there is exactly
186
- * one range in the suggestion, and that range contains exactly one element.
187
- *
188
- * Returns `null` if there is no contained element.
189
- */
190
- getContainedElement(): Element | null;
191
- /**
192
- * Accepts the suggestion.
193
- */
194
- accept(): void;
195
- /**
196
- * Discards the suggestion.
197
- */
198
- discard(): void;
199
- /**
200
- * Returns all suggestions that are in this suggestion chain.
201
- */
202
- getAllAdjacentSuggestions(): Array<Suggestion>;
203
- /**
204
- * Adds suggestion attribute.
205
- *
206
- * Suggestion attributes are custom data that can be set and used by features
207
- * built around suggestions. Use it to store your feature data with other suggestion data.
208
- *
209
- * ```ts
210
- * suggestion.setAttribute( 'isImportant', true );
211
- * ```
212
- *
213
- * You can group multiple values in an object, using dot notation:
214
- *
215
- * ```ts
216
- * suggestion.setAttribute( 'customData.type', 'image' );
217
- * suggestion.setAttribute( 'customData.src', 'foo.jpg' );
218
- * ```
219
- *
220
- * Attributes set on the suggestion can be accessed through `attribute` property:
221
- *
222
- * ```ts
223
- * const isImportant = suggestion.attributes.isImportant;
224
- * const type = suggestion.attributes.customData.type;
225
- * ```
226
- *
227
- * You can also observe `attributes` property or bind other properties to it:
228
- *
229
- * ```ts
230
- * myObj.bind( 'customData' ).to( suggestion, 'attributes', attributes => attributes.customData );
231
- * ```
232
- *
233
- * Whenever `setAttribute()` or `removeAttribute()` is called, `attributes` property
234
- * is re-set and observables are refreshed.
235
- */
236
- setAttribute(name: string, value: unknown): void;
237
- /**
238
- * Removes suggestion attribute.
239
- *
240
- * See also {@link #setAttribute}
241
- */
242
- removeAttribute(name: string): void;
243
- toJSON(): SuggestionJSON;
244
- /**
245
- * Returns a random string that can be used as additional identifier for the marker name for suggestions that are multi range.
246
- */
247
- static getMultiRangeId(): string;
248
- }
249
- export interface SuggestionOptions {
250
- id: string;
251
- type: SuggestionType;
252
- subType: string | null;
253
- attributes: {
254
- [k: string]: unknown;
255
- };
256
- author: User;
257
- creator: User;
258
- onAccept: Function;
259
- onDiscard: Function;
260
- onAttributesChange: Function;
261
- }
262
- export interface SuggestionJSON {
263
- /**
264
- * Suggestion ID.
265
- */
266
- id: string;
267
- /**
268
- * Contains the information about the type and subtype of the suggestion.
269
- */
270
- type: string;
271
- /**
272
- * The ID of the author.
273
- */
274
- authorId: string;
275
- /**
276
- * Date when the suggestion was saved in the database.
277
- */
278
- createdAt: Date | null;
279
- /**
280
- * Informs whether suggestion has at least one comment.
281
- */
282
- hasComments?: boolean;
283
- /**
284
- * Additional suggestion data.
285
- */
286
- data?: FormatData | AttributeData | null;
287
- /**
288
- * Custom suggestion attributes.
289
- */
290
- attributes: {
291
- [k: string]: unknown;
292
- };
293
- }
294
- export type SuggestionType = 'insertion' | 'deletion' | 'formatInline' | 'formatBlock' | 'attribute';
295
- export {};
@@ -1,187 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- import { type Locale, type PriorityString } from 'ckeditor5/src/utils.js';
10
- import type { Schema, Element } from 'ckeditor5/src/engine.js';
11
- import type Suggestion from './suggestion.js';
12
- /**
13
- * Creates descriptions for suggestions and suggestions chains.
14
- *
15
- * The class manages everything related to generating descriptions for suggestions. Here, you register labels for elements,
16
- * attributes, or custom callback for non-regular cases.
17
- *
18
- * One or more suggestions that are grouped together (based ond various conditions) create "suggestion chain".
19
- * In such chain one suggestion may impact other suggestion when it comes to the description of the whole chain.
20
- * For example, insertion next to deletion results in "Replaced" description.
21
- */
22
- export default class SuggestionDescriptionFactory {
23
- constructor(schema: Schema, locale: Locale);
24
- /**
25
- * Returns descriptions for given suggestion chain.
26
- *
27
- * The structure of the descriptions array is as follows (explained on an example):
28
- *
29
- * ```ts
30
- * [
31
- * { type: 'insertion', content: '*Insert:* 2 paragraphs' },
32
- * { type: 'insertion', content: '*Insert:* image },
33
- * { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
34
- * ]
35
- * ```
36
- *
37
- * In above example there are three description instances (or lines). Two new (empty) paragraphs were added,
38
- * an image was added and then "Foo" text was removed and "Bar" text was added. For example, above structure could be rendered as:
39
- *
40
- * ```html
41
- * <p><strong>Insert:</strong> 2 paragraphs</p>
42
- * <p><strong>Insert:</strong> image</p>
43
- * <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
44
- * ```
45
- */
46
- getDescriptions(suggestions: Array<Suggestion>): Array<Description>;
47
- /**
48
- * Registers a callback function that returns a custom description for a suggestion.
49
- *
50
- * Registered callback is fired for a suggestion whenever there is a need to generate a description for that suggestion.
51
- *
52
- * The callback takes the suggestion instance as a parameter and should return
53
- * {@link module:track-changes/suggestiondescriptionfactory~Description description object} or a falsy value
54
- * if the suggestion was not handled by the callback.
55
- *
56
- * Example of a description callback for the bold style:
57
- *
58
- * ```ts
59
- * suggestionDescriptionFactory.registerDescriptionCallback( suggestion => {
60
- * const { data } = suggestion;
61
- *
62
- * // Omit suggestions that are not bold style suggestions.
63
- * if ( !data || data.commandName !== 'bold' ) {
64
- * return;
65
- * }
66
- *
67
- * const isSet = !!data.commandParams[ 0 ].forceValue;
68
- * const content = isSet ? '*Set format:* bold' : '*Remove format:* bold';
69
- *
70
- * return {
71
- * type: 'format',
72
- * content
73
- * };
74
- * } );
75
- * ```
76
- */
77
- registerDescriptionCallback(callback: DescriptionCallback): void;
78
- /**
79
- * For given `elementName` registers how this element will be labeled in a description (for example when it is added
80
- * or removed).
81
- *
82
- * Instead of a string name you may provide a matching function that takes item {@link module:engine/model/item~Item} as an input
83
- * and should return boolean value.
84
- *
85
- * Provided label callback takes one parameter, `quantity`, and is expected to return the label for the element as a string.
86
- *
87
- * A simple use case without using internationalization:
88
- *
89
- * ```ts
90
- * suggestionDescriptionFactory.registerElementLabel(
91
- * 'paragraph',
92
- * quantity => quantity == 1 ? 'paragraph' : quantity + ' paragraphs'
93
- * );
94
- * ```
95
- *
96
- * If you want your feature to be localized to other languages, use localization service:
97
- *
98
- * ```ts
99
- * const t = editor.locale.t; // Remember that you have to use function named `t`.
100
- *
101
- * suggestionDescriptionFactory.registerElementLabel(
102
- * 'paragraph',
103
- * quantity => t( { string: 'paragraph', plural: '%0 paragraphs', id: 'ELEMENT_PARAGRAPH' }, quantity )
104
- * );
105
- * ```
106
- */
107
- registerElementLabel(elementNameOrCallback: string | Function, labelCallback: LabelCallback, priority?: PriorityString): void;
108
- /**
109
- * For given `attributeName` registers how this attribute will be labeled in a description (for example when it is added
110
- * or removed).
111
- *
112
- * Example usage with internationalization:
113
- *
114
- * ```ts
115
- * const t = editor.locale.t; // Remember that you have to use function named `t`.
116
- *
117
- * suggestionDescriptionFactory.registerAttributeLabel(
118
- * 'bold',
119
- * t( 'bold' )
120
- * );
121
- * ```
122
- */
123
- registerAttributeLabel(attributeName: string, attributeLabel: string): void;
124
- /**
125
- * Returns label registered for given element or the element name if there is no label registered for it.
126
- */
127
- getItemLabel(element: Element, quantity?: number): string;
128
- }
129
- /**
130
- * A description for the suggestion.
131
- *
132
- * ```ts
133
- * {
134
- * type: 'format',
135
- * label: '*Set format:* bold'
136
- * }
137
- * ```
138
- *
139
- * A description for the color-related suggestions like font color may specify the `color` property that will provide a better UX
140
- * by displaying a color box next to the suggestion.
141
- *
142
- * ```ts
143
- * {
144
- * type: 'format',
145
- * label: '*Set font color:*',
146
- * color: {
147
- * value: 'hsl( 60, 60%, 60% )',
148
- * title: 'yellow'
149
- * }
150
- * }
151
- * ```
152
- */
153
- export interface Description {
154
- type: 'insertion' | 'deletion' | 'replace' | 'format';
155
- /**
156
- * Description label. You may use `*` to bold part of the label.
157
- */
158
- content: string;
159
- /**
160
- * The optional `color` property used for color-related suggestions.
161
- * The object should provide the `value` (for displaying the color) and `title` (for describing the color) fields.
162
- */
163
- color?: {
164
- value: string;
165
- title: string;
166
- };
167
- }
168
- export type DescriptionCallback = (suggestion: Suggestion) => Description | DescriptionItem | undefined;
169
- export type LabelCallback = (quantity: number) => string;
170
- export interface LabelCallbackObject {
171
- matchingCallback: (element: Element) => boolean;
172
- label: LabelCallback;
173
- priority: PriorityString;
174
- }
175
- /**
176
- * An intermediate state which is easier to operate on when consecutive suggestion
177
- * ranges are traversed.
178
- */
179
- interface DescriptionItem {
180
- type: 'text' | 'addEmptyContainer' | 'addObject' | 'removeEmptyContainer' | 'removeObject' | 'addContainer' | 'removeContainer' | 'addFormat' | 'removeFormat';
181
- add?: string;
182
- remove?: string;
183
- element?: Element;
184
- quantity?: number;
185
- key?: string;
186
- }
187
- export {};
@@ -1,192 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module track-changes/trackchanges
11
- * @publicApi
12
- */
13
- import { Plugin } from 'ckeditor5/src/core.js';
14
- import TrackChangesUI from './trackchangesui.js';
15
- import TrackChangesEditing from './trackchangesediting.js';
16
- import 'ckeditor5-collaboration/src/collaboration-core.js';
17
- import type { default as Suggestion, SuggestionJSON } from './suggestion.js';
18
- /**
19
- * A plugin that provides track changes mode for the editor. In track changes mode, all insertions are visually marked and all deletions
20
- * are not deleted but also visually marked. Unsupported commands are disabled when the editor is in the track changes mode.
21
- *
22
- * To learn how to integrate the track changes feature with your editor, refer to the
23
- * {@glink features/collaboration/track-changes/track-changes-integration Track changes integration} guide.
24
- *
25
- * Basic API:
26
- *
27
- * ```ts
28
- * // Get the track changes plugin:
29
- * const trackChangesPlugin = editor.plugins.get( 'TrackChanges' );
30
- *
31
- * // Add a suggestion:
32
- * trackChangesPlugin.addSuggestion( suggestionData );
33
- *
34
- * // Get all suggestions:
35
- * trackChangesPlugin.getSuggestions();
36
- *
37
- * // Set the adapter:
38
- * trackChangesPlugin.adapter = {
39
- * // ...
40
- * }
41
- * ```
42
- *
43
- * The plugin registers several commands:
44
- *
45
- * * `trackChanges` &ndash; Toggles the track changes mode in the editor.
46
- * * `acceptSuggestion` &ndash; Accepts a suggestion with the specified ID.
47
- * * `discardSuggestion` &ndash; Discards a suggestion with the specified ID.
48
- * * `acceptAllSuggestions` &ndash; Accepts all suggestions.
49
- * * `discardAllSuggestions` &ndash; Discards all suggestions.
50
- * * `acceptSelectedSuggestions` &ndash; Accepts all suggestions in the current selection.
51
- * * `discardSelectedSuggestions` &ndash; Discards all suggestions in the current selection.
52
- *
53
- * Examples:
54
- *
55
- * ```ts
56
- * editor.execute( 'trackChanges' );
57
- * editor.execute( 'acceptSuggestion', 'suggestion-1' );
58
- * editor.execute( 'discardSuggestion', 'suggestion-1' );
59
- * editor.execute( 'acceptAllSuggestions' );
60
- * editor.execute( 'discardAllSuggestions' );
61
- * editor.execute( 'acceptSelectedSuggestions' );
62
- * editor.execute( 'discardSelectedSuggestions' )
63
- * ```
64
- *
65
- * Note that there is no command to add a suggestion. This is because suggestions
66
- * are added automatically when editing commands are executed while the editor is in track
67
- * changes mode. For instance:
68
- *
69
- * ```ts
70
- * // Turn on the track changes mode:
71
- * editor.execute( 'trackChanges' );
72
- *
73
- * // Insert some text. It will be automatically inserted as a suggestion:
74
- * editor.execute( 'input', { text: 'foo' } );
75
- * ```
76
- */
77
- export default class TrackChanges extends Plugin {
78
- static get requires(): readonly [typeof TrackChangesEditing, typeof TrackChangesUI, "Comments"];
79
- static get pluginName(): "TrackChanges";
80
- /**
81
- * @inheritDoc
82
- */
83
- static get isOfficialPlugin(): true;
84
- /**
85
- * @inheritDoc
86
- */
87
- static get isPremiumPlugin(): true;
88
- /**
89
- * An adapter object that should communicate with the data source to fetch or save the suggestion data.
90
- *
91
- * This is a shorthand to {@link module:track-changes/trackchangesediting~TrackChangesEditing#adapter `TrackChangesEditing#adapter`}.
92
- */
93
- set adapter(adapter: TrackChangesAdapter | null);
94
- get adapter(): TrackChangesAdapter | null;
95
- /**
96
- * Adds suggestion data.
97
- *
98
- * Use this method to load the suggestion data during the editor initialization if you do not use the adapter integration.
99
- */
100
- addSuggestion(suggestionData: SuggestionData): Suggestion;
101
- getSuggestions(options: {
102
- skipNotAttached?: boolean;
103
- toJSON: true;
104
- }): Array<SuggestionJSON>;
105
- getSuggestions(options?: {
106
- skipNotAttached?: boolean;
107
- toJSON?: false;
108
- }): Array<Suggestion>;
109
- getSuggestions(options: {
110
- skipNotAttached?: boolean;
111
- toJSON: boolean;
112
- }): Array<Suggestion> | Array<SuggestionJSON>;
113
- /**
114
- * Returns the suggestion instance for a given ID.
115
- */
116
- getSuggestion(id: string): Suggestion;
117
- }
118
- /**
119
- * Track changes adapter.
120
- *
121
- * The track changes adapter is an object that communicates asynchronously with the data source to fetch or save the suggestion data.
122
- * It is used internally by the track changes feature whenever a suggestion is loaded, created or deleted.
123
- *
124
- * The adapter is optional. You might need to provide it if you are {@glink features/collaboration/track-changes/track-changes-integration}
125
- * using the track changes feature without real-time collaboration.
126
- *
127
- * To set the adapter, overwrite {@link module:track-changes/trackchanges~TrackChanges#adapter the `TrackChanges#adapter` property}.
128
- */
129
- export interface TrackChangesAdapter {
130
- /**
131
- * Called each time the suggestion data is needed.
132
- *
133
- * The method should return a promise that resolves with the suggestion data object.
134
- *
135
- * @param id The ID of the suggestion to get.
136
- */
137
- getSuggestion(id: string): Promise<SuggestionData>;
138
- /**
139
- * Called each time a new suggestion is created.
140
- *
141
- * The method should save the suggestion data in the database
142
- * and return a promise that should be resolved when the save is
143
- * completed.
144
- *
145
- * If the promise resolves with an object with the `createdAt` property,
146
- * this suggestion property will be updated in the suggestion in the editor.
147
- * This lets you update the suggestion data with server-side information.
148
- *
149
- * The `suggestionData` object does not expect the `authorId` property.
150
- * For security reasons, the author of the suggestion should be set
151
- * on the server side.
152
- *
153
- * If `suggestionData.originalSuggestionId` is set, the new suggestion should
154
- * have the `authorId` property set to the same as the suggestion with
155
- * `originalSuggestionId`. This happens when one user splits
156
- * another user's suggestion, creating a new suggestion as a result. See
157
- * {@glink features/collaboration/track-changes/track-changes-integration#implementation Track changes integration} guide.
158
- *
159
- * **Note:** Failure to properly handle this property will result in editor crash in some scenarios.
160
- *
161
- * In any other case, use the current (local) user to set `authorId`.
162
- *
163
- * The `suggestionData` object does not expect the `createdAt` property either.
164
- * You should use the server-side time generator to ensure that all users
165
- * see the same date.
166
- *
167
- * It is recommended to stringify `suggestionData.attributes` value to JSON and save it as a string in your database,
168
- * and then to parse the strings when loading suggestions.
169
- */
170
- addSuggestion(suggestionData: AddSuggestionInput): Promise<SuggestionData>;
171
- /**
172
- * Called each time the suggestion properties change.
173
- *
174
- * The method should update the suggestion properties in the database
175
- * and return a promise that should be resolved when the save is
176
- * completed.
177
- *
178
- * Keep in mind that the `data` parameter only contains those
179
- * properties of a suggestion which changed.
180
- */
181
- updateSuggestion(id: string, suggestionData: UpdateSuggestionInput): Promise<void>;
182
- }
183
- export interface SuggestionData extends SuggestionJSON {
184
- /**
185
- * Original suggestion ID from which the current one was split.
186
- */
187
- originalSuggestionId?: string | null;
188
- }
189
- export type AddSuggestionInput = Omit<SuggestionData, 'authorId' | 'createdAt'>;
190
- export type UpdateSuggestionInput = Partial<Pick<SuggestionJSON, 'hasComments' | 'attributes'>> & {
191
- state?: 'open' | 'accepted' | 'rejected';
192
- };