@ckeditor/ckeditor5-engine 44.1.0 → 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 (369) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/index-content.css +2 -2
  3. package/dist/index-editor.css +2 -2
  4. package/dist/index.css +4 -4
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.js +646 -77
  7. package/dist/index.js.map +1 -1
  8. package/package.json +23 -3
  9. package/src/controller/datacontroller.d.ts +1 -1
  10. package/src/controller/datacontroller.js +1 -1
  11. package/src/controller/editingcontroller.d.ts +1 -1
  12. package/src/controller/editingcontroller.js +1 -1
  13. package/src/conversion/conversion.d.ts +1 -1
  14. package/src/conversion/conversion.js +1 -1
  15. package/src/conversion/conversionhelpers.d.ts +1 -1
  16. package/src/conversion/conversionhelpers.js +1 -1
  17. package/src/conversion/downcastdispatcher.d.ts +1 -1
  18. package/src/conversion/downcastdispatcher.js +1 -1
  19. package/src/conversion/downcasthelpers.d.ts +1 -1
  20. package/src/conversion/downcasthelpers.js +1 -1
  21. package/src/conversion/mapper.d.ts +249 -20
  22. package/src/conversion/mapper.js +524 -38
  23. package/src/conversion/modelconsumable.d.ts +1 -1
  24. package/src/conversion/modelconsumable.js +1 -1
  25. package/src/conversion/upcastdispatcher.d.ts +1 -1
  26. package/src/conversion/upcastdispatcher.js +1 -1
  27. package/src/conversion/upcasthelpers.d.ts +1 -1
  28. package/src/conversion/upcasthelpers.js +1 -1
  29. package/src/conversion/viewconsumable.d.ts +1 -1
  30. package/src/conversion/viewconsumable.js +1 -1
  31. package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
  32. package/src/dataprocessor/basichtmlwriter.js +1 -1
  33. package/src/dataprocessor/dataprocessor.d.ts +1 -1
  34. package/src/dataprocessor/dataprocessor.js +1 -1
  35. package/src/dataprocessor/htmldataprocessor.d.ts +1 -1
  36. package/src/dataprocessor/htmldataprocessor.js +1 -1
  37. package/src/dataprocessor/htmlwriter.d.ts +1 -1
  38. package/src/dataprocessor/htmlwriter.js +1 -1
  39. package/src/dataprocessor/xmldataprocessor.d.ts +1 -1
  40. package/src/dataprocessor/xmldataprocessor.js +1 -1
  41. package/src/dev-utils/model.d.ts +1 -1
  42. package/src/dev-utils/model.js +1 -1
  43. package/src/dev-utils/operationreplayer.d.ts +1 -1
  44. package/src/dev-utils/operationreplayer.js +1 -1
  45. package/src/dev-utils/utils.d.ts +1 -1
  46. package/src/dev-utils/utils.js +1 -1
  47. package/src/dev-utils/view.d.ts +1 -1
  48. package/src/dev-utils/view.js +1 -1
  49. package/src/index.d.ts +4 -2
  50. package/src/index.js +2 -1
  51. package/src/model/batch.d.ts +1 -1
  52. package/src/model/batch.js +7 -3
  53. package/src/model/differ.d.ts +1 -1
  54. package/src/model/differ.js +1 -1
  55. package/src/model/document.d.ts +1 -1
  56. package/src/model/document.js +1 -1
  57. package/src/model/documentfragment.d.ts +1 -1
  58. package/src/model/documentfragment.js +1 -1
  59. package/src/model/documentselection.d.ts +1 -1
  60. package/src/model/documentselection.js +1 -1
  61. package/src/model/element.d.ts +1 -1
  62. package/src/model/element.js +1 -1
  63. package/src/model/history.d.ts +1 -1
  64. package/src/model/history.js +1 -1
  65. package/src/model/item.d.ts +1 -1
  66. package/src/model/item.js +1 -1
  67. package/src/model/liveposition.d.ts +1 -1
  68. package/src/model/liveposition.js +1 -1
  69. package/src/model/liverange.d.ts +1 -1
  70. package/src/model/liverange.js +1 -1
  71. package/src/model/markercollection.d.ts +1 -1
  72. package/src/model/markercollection.js +1 -1
  73. package/src/model/model.d.ts +1 -1
  74. package/src/model/model.js +1 -1
  75. package/src/model/node.d.ts +1 -1
  76. package/src/model/node.js +1 -1
  77. package/src/model/nodelist.d.ts +1 -1
  78. package/src/model/nodelist.js +1 -1
  79. package/src/model/operation/attributeoperation.d.ts +1 -1
  80. package/src/model/operation/attributeoperation.js +1 -1
  81. package/src/model/operation/detachoperation.d.ts +1 -1
  82. package/src/model/operation/detachoperation.js +1 -1
  83. package/src/model/operation/insertoperation.d.ts +1 -1
  84. package/src/model/operation/insertoperation.js +1 -1
  85. package/src/model/operation/markeroperation.d.ts +1 -1
  86. package/src/model/operation/markeroperation.js +1 -1
  87. package/src/model/operation/mergeoperation.d.ts +1 -1
  88. package/src/model/operation/mergeoperation.js +1 -1
  89. package/src/model/operation/moveoperation.d.ts +1 -1
  90. package/src/model/operation/moveoperation.js +1 -1
  91. package/src/model/operation/nooperation.d.ts +1 -1
  92. package/src/model/operation/nooperation.js +1 -1
  93. package/src/model/operation/operation.d.ts +4 -1
  94. package/src/model/operation/operation.js +2 -2
  95. package/src/model/operation/operationfactory.d.ts +1 -1
  96. package/src/model/operation/operationfactory.js +1 -1
  97. package/src/model/operation/renameoperation.d.ts +1 -1
  98. package/src/model/operation/renameoperation.js +1 -1
  99. package/src/model/operation/rootattributeoperation.d.ts +1 -1
  100. package/src/model/operation/rootattributeoperation.js +1 -1
  101. package/src/model/operation/rootoperation.d.ts +1 -1
  102. package/src/model/operation/rootoperation.js +1 -1
  103. package/src/model/operation/splitoperation.d.ts +1 -1
  104. package/src/model/operation/splitoperation.js +1 -1
  105. package/src/model/operation/transform.d.ts +1 -1
  106. package/src/model/operation/transform.js +1 -1
  107. package/src/model/operation/utils.d.ts +1 -1
  108. package/src/model/operation/utils.js +1 -1
  109. package/src/model/position.d.ts +1 -1
  110. package/src/model/position.js +1 -1
  111. package/src/model/range.d.ts +1 -1
  112. package/src/model/range.js +1 -1
  113. package/src/model/rootelement.d.ts +1 -1
  114. package/src/model/rootelement.js +1 -1
  115. package/src/model/schema.d.ts +1 -1
  116. package/src/model/schema.js +1 -1
  117. package/src/model/selection.d.ts +1 -1
  118. package/src/model/selection.js +9 -2
  119. package/src/model/text.d.ts +1 -1
  120. package/src/model/text.js +1 -1
  121. package/src/model/textproxy.d.ts +1 -1
  122. package/src/model/textproxy.js +1 -1
  123. package/src/model/treewalker.d.ts +17 -1
  124. package/src/model/treewalker.js +26 -1
  125. package/src/model/typecheckable.d.ts +1 -1
  126. package/src/model/typecheckable.js +1 -1
  127. package/src/model/utils/autoparagraphing.d.ts +1 -1
  128. package/src/model/utils/autoparagraphing.js +1 -1
  129. package/src/model/utils/deletecontent.d.ts +1 -1
  130. package/src/model/utils/deletecontent.js +1 -1
  131. package/src/model/utils/getselectedcontent.d.ts +1 -1
  132. package/src/model/utils/getselectedcontent.js +1 -1
  133. package/src/model/utils/insertcontent.d.ts +1 -1
  134. package/src/model/utils/insertcontent.js +1 -1
  135. package/src/model/utils/insertobject.d.ts +1 -1
  136. package/src/model/utils/insertobject.js +1 -1
  137. package/src/model/utils/modifyselection.d.ts +1 -1
  138. package/src/model/utils/modifyselection.js +1 -1
  139. package/src/model/utils/selection-post-fixer.d.ts +1 -1
  140. package/src/model/utils/selection-post-fixer.js +1 -1
  141. package/src/model/writer.d.ts +1 -1
  142. package/src/model/writer.js +1 -1
  143. package/src/view/attributeelement.d.ts +1 -1
  144. package/src/view/attributeelement.js +1 -1
  145. package/src/view/containerelement.d.ts +1 -1
  146. package/src/view/containerelement.js +1 -1
  147. package/src/view/datatransfer.d.ts +1 -1
  148. package/src/view/datatransfer.js +1 -1
  149. package/src/view/document.d.ts +1 -1
  150. package/src/view/document.js +1 -1
  151. package/src/view/documentfragment.d.ts +6 -4
  152. package/src/view/documentfragment.js +7 -7
  153. package/src/view/documentselection.d.ts +1 -1
  154. package/src/view/documentselection.js +1 -1
  155. package/src/view/domconverter.d.ts +1 -1
  156. package/src/view/domconverter.js +1 -1
  157. package/src/view/downcastwriter.d.ts +1 -1
  158. package/src/view/downcastwriter.js +1 -1
  159. package/src/view/editableelement.d.ts +1 -1
  160. package/src/view/editableelement.js +1 -1
  161. package/src/view/element.d.ts +1 -1
  162. package/src/view/element.js +3 -3
  163. package/src/view/elementdefinition.d.ts +1 -1
  164. package/src/view/elementdefinition.js +1 -1
  165. package/src/view/emptyelement.d.ts +1 -1
  166. package/src/view/emptyelement.js +1 -1
  167. package/src/view/filler.d.ts +1 -1
  168. package/src/view/filler.js +1 -1
  169. package/src/view/item.d.ts +1 -1
  170. package/src/view/item.js +1 -1
  171. package/src/view/matcher.d.ts +1 -1
  172. package/src/view/matcher.js +1 -1
  173. package/src/view/node.d.ts +13 -4
  174. package/src/view/node.js +5 -4
  175. package/src/view/observer/arrowkeysobserver.d.ts +1 -1
  176. package/src/view/observer/arrowkeysobserver.js +1 -1
  177. package/src/view/observer/bubblingemittermixin.d.ts +1 -1
  178. package/src/view/observer/bubblingemittermixin.js +1 -1
  179. package/src/view/observer/bubblingeventinfo.d.ts +1 -1
  180. package/src/view/observer/bubblingeventinfo.js +1 -1
  181. package/src/view/observer/clickobserver.d.ts +1 -1
  182. package/src/view/observer/clickobserver.js +1 -1
  183. package/src/view/observer/compositionobserver.d.ts +1 -1
  184. package/src/view/observer/compositionobserver.js +1 -1
  185. package/src/view/observer/domeventdata.d.ts +1 -1
  186. package/src/view/observer/domeventdata.js +1 -1
  187. package/src/view/observer/domeventobserver.d.ts +1 -1
  188. package/src/view/observer/domeventobserver.js +1 -1
  189. package/src/view/observer/fakeselectionobserver.d.ts +1 -1
  190. package/src/view/observer/fakeselectionobserver.js +1 -1
  191. package/src/view/observer/focusobserver.d.ts +1 -1
  192. package/src/view/observer/focusobserver.js +1 -1
  193. package/src/view/observer/inputobserver.d.ts +1 -1
  194. package/src/view/observer/inputobserver.js +1 -1
  195. package/src/view/observer/keyobserver.d.ts +1 -1
  196. package/src/view/observer/keyobserver.js +1 -1
  197. package/src/view/observer/mouseobserver.d.ts +1 -1
  198. package/src/view/observer/mouseobserver.js +1 -1
  199. package/src/view/observer/mutationobserver.d.ts +1 -1
  200. package/src/view/observer/mutationobserver.js +1 -1
  201. package/src/view/observer/observer.d.ts +1 -1
  202. package/src/view/observer/observer.js +1 -1
  203. package/src/view/observer/selectionobserver.d.ts +1 -1
  204. package/src/view/observer/selectionobserver.js +1 -1
  205. package/src/view/observer/tabobserver.d.ts +1 -1
  206. package/src/view/observer/tabobserver.js +1 -1
  207. package/src/view/observer/touchobserver.d.ts +73 -0
  208. package/src/view/observer/touchobserver.js +29 -0
  209. package/src/view/placeholder.d.ts +1 -1
  210. package/src/view/placeholder.js +23 -17
  211. package/src/view/position.d.ts +1 -1
  212. package/src/view/position.js +1 -1
  213. package/src/view/range.d.ts +1 -1
  214. package/src/view/range.js +1 -1
  215. package/src/view/rawelement.d.ts +1 -1
  216. package/src/view/rawelement.js +1 -1
  217. package/src/view/renderer.d.ts +1 -1
  218. package/src/view/renderer.js +1 -1
  219. package/src/view/rooteditableelement.d.ts +1 -1
  220. package/src/view/rooteditableelement.js +1 -1
  221. package/src/view/selection.d.ts +1 -1
  222. package/src/view/selection.js +1 -1
  223. package/src/view/styles/background.d.ts +1 -1
  224. package/src/view/styles/background.js +1 -1
  225. package/src/view/styles/border.d.ts +1 -1
  226. package/src/view/styles/border.js +1 -1
  227. package/src/view/styles/margin.d.ts +1 -1
  228. package/src/view/styles/margin.js +1 -1
  229. package/src/view/styles/padding.d.ts +1 -1
  230. package/src/view/styles/padding.js +1 -1
  231. package/src/view/styles/utils.d.ts +1 -1
  232. package/src/view/styles/utils.js +1 -1
  233. package/src/view/stylesmap.d.ts +1 -1
  234. package/src/view/stylesmap.js +1 -1
  235. package/src/view/text.d.ts +1 -1
  236. package/src/view/text.js +1 -1
  237. package/src/view/textproxy.d.ts +1 -1
  238. package/src/view/textproxy.js +1 -1
  239. package/src/view/treewalker.d.ts +17 -1
  240. package/src/view/treewalker.js +25 -1
  241. package/src/view/typecheckable.d.ts +1 -1
  242. package/src/view/typecheckable.js +1 -1
  243. package/src/view/uielement.d.ts +1 -1
  244. package/src/view/uielement.js +1 -1
  245. package/src/view/upcastwriter.d.ts +1 -1
  246. package/src/view/upcastwriter.js +1 -1
  247. package/src/view/view.d.ts +1 -1
  248. package/src/view/view.js +1 -1
  249. package/theme/placeholder.css +1 -1
  250. package/theme/renderer.css +1 -1
  251. package/dist/controller/datacontroller.d.ts +0 -339
  252. package/dist/controller/editingcontroller.d.ts +0 -102
  253. package/dist/conversion/conversion.d.ts +0 -482
  254. package/dist/conversion/conversionhelpers.d.ts +0 -30
  255. package/dist/conversion/downcastdispatcher.d.ts +0 -566
  256. package/dist/conversion/downcasthelpers.d.ts +0 -1194
  257. package/dist/conversion/mapper.d.ts +0 -507
  258. package/dist/conversion/modelconsumable.d.ts +0 -205
  259. package/dist/conversion/upcastdispatcher.d.ts +0 -496
  260. package/dist/conversion/upcasthelpers.d.ts +0 -503
  261. package/dist/conversion/viewconsumable.d.ts +0 -373
  262. package/dist/dataprocessor/basichtmlwriter.d.ts +0 -22
  263. package/dist/dataprocessor/dataprocessor.d.ts +0 -65
  264. package/dist/dataprocessor/htmldataprocessor.d.ts +0 -80
  265. package/dist/dataprocessor/htmlwriter.d.ts +0 -20
  266. package/dist/dataprocessor/xmldataprocessor.d.ts +0 -94
  267. package/dist/dev-utils/model.d.ts +0 -130
  268. package/dist/dev-utils/operationreplayer.d.ts +0 -55
  269. package/dist/dev-utils/utils.d.ts +0 -41
  270. package/dist/dev-utils/view.d.ts +0 -324
  271. package/dist/index.d.ts +0 -122
  272. package/dist/model/batch.d.ts +0 -110
  273. package/dist/model/differ.d.ts +0 -511
  274. package/dist/model/document.d.ts +0 -278
  275. package/dist/model/documentfragment.d.ts +0 -223
  276. package/dist/model/documentselection.d.ts +0 -424
  277. package/dist/model/element.d.ts +0 -191
  278. package/dist/model/history.d.ts +0 -118
  279. package/dist/model/item.d.ts +0 -18
  280. package/dist/model/liveposition.d.ts +0 -81
  281. package/dist/model/liverange.d.ts +0 -106
  282. package/dist/model/markercollection.d.ts +0 -339
  283. package/dist/model/model.d.ts +0 -923
  284. package/dist/model/node.d.ts +0 -262
  285. package/dist/model/nodelist.d.ts +0 -119
  286. package/dist/model/operation/attributeoperation.d.ts +0 -107
  287. package/dist/model/operation/detachoperation.d.ts +0 -64
  288. package/dist/model/operation/insertoperation.d.ts +0 -94
  289. package/dist/model/operation/markeroperation.d.ts +0 -95
  290. package/dist/model/operation/mergeoperation.d.ts +0 -104
  291. package/dist/model/operation/moveoperation.d.ts +0 -100
  292. package/dist/model/operation/nooperation.d.ts +0 -42
  293. package/dist/model/operation/operation.d.ts +0 -100
  294. package/dist/model/operation/operationfactory.d.ts +0 -22
  295. package/dist/model/operation/renameoperation.d.ts +0 -87
  296. package/dist/model/operation/rootattributeoperation.d.ts +0 -102
  297. package/dist/model/operation/rootoperation.d.ts +0 -80
  298. package/dist/model/operation/splitoperation.d.ts +0 -113
  299. package/dist/model/operation/transform.d.ts +0 -104
  300. package/dist/model/operation/utils.d.ts +0 -75
  301. package/dist/model/position.d.ts +0 -549
  302. package/dist/model/range.d.ts +0 -462
  303. package/dist/model/rootelement.d.ts +0 -64
  304. package/dist/model/schema.d.ts +0 -1334
  305. package/dist/model/selection.d.ts +0 -486
  306. package/dist/model/text.d.ts +0 -70
  307. package/dist/model/textproxy.d.ts +0 -148
  308. package/dist/model/treewalker.d.ts +0 -190
  309. package/dist/model/typecheckable.d.ts +0 -289
  310. package/dist/model/utils/autoparagraphing.d.ts +0 -41
  311. package/dist/model/utils/deletecontent.d.ts +0 -62
  312. package/dist/model/utils/getselectedcontent.d.ts +0 -34
  313. package/dist/model/utils/insertcontent.d.ts +0 -50
  314. package/dist/model/utils/insertobject.d.ts +0 -51
  315. package/dist/model/utils/modifyselection.d.ts +0 -52
  316. package/dist/model/utils/selection-post-fixer.d.ts +0 -78
  317. package/dist/model/writer.d.ts +0 -855
  318. package/dist/view/attributeelement.d.ts +0 -112
  319. package/dist/view/containerelement.d.ts +0 -53
  320. package/dist/view/datatransfer.d.ts +0 -83
  321. package/dist/view/document.d.ts +0 -188
  322. package/dist/view/documentfragment.d.ts +0 -157
  323. package/dist/view/documentselection.d.ts +0 -310
  324. package/dist/view/domconverter.d.ts +0 -665
  325. package/dist/view/downcastwriter.d.ts +0 -1000
  326. package/dist/view/editableelement.d.ts +0 -66
  327. package/dist/view/element.d.ts +0 -472
  328. package/dist/view/elementdefinition.d.ts +0 -91
  329. package/dist/view/emptyelement.d.ts +0 -45
  330. package/dist/view/filler.d.ts +0 -115
  331. package/dist/view/item.d.ts +0 -18
  332. package/dist/view/matcher.d.ts +0 -490
  333. package/dist/view/node.d.ts +0 -166
  334. package/dist/view/observer/arrowkeysobserver.d.ts +0 -49
  335. package/dist/view/observer/bubblingemittermixin.d.ts +0 -170
  336. package/dist/view/observer/bubblingeventinfo.d.ts +0 -51
  337. package/dist/view/observer/clickobserver.d.ts +0 -47
  338. package/dist/view/observer/compositionobserver.d.ts +0 -86
  339. package/dist/view/observer/domeventdata.d.ts +0 -54
  340. package/dist/view/observer/domeventobserver.d.ts +0 -82
  341. package/dist/view/observer/fakeselectionobserver.d.ts +0 -51
  342. package/dist/view/observer/focusobserver.d.ts +0 -98
  343. package/dist/view/observer/inputobserver.d.ts +0 -90
  344. package/dist/view/observer/keyobserver.d.ts +0 -70
  345. package/dist/view/observer/mouseobserver.d.ts +0 -93
  346. package/dist/view/observer/mutationobserver.d.ts +0 -119
  347. package/dist/view/observer/observer.d.ts +0 -93
  348. package/dist/view/observer/selectionobserver.d.ts +0 -151
  349. package/dist/view/observer/tabobserver.d.ts +0 -50
  350. package/dist/view/placeholder.d.ts +0 -100
  351. package/dist/view/position.d.ts +0 -192
  352. package/dist/view/range.d.ts +0 -283
  353. package/dist/view/rawelement.d.ts +0 -77
  354. package/dist/view/renderer.d.ts +0 -281
  355. package/dist/view/rooteditableelement.d.ts +0 -45
  356. package/dist/view/selection.d.ts +0 -379
  357. package/dist/view/styles/background.d.ts +0 -37
  358. package/dist/view/styles/border.d.ts +0 -47
  359. package/dist/view/styles/margin.d.ts +0 -33
  360. package/dist/view/styles/padding.d.ts +0 -33
  361. package/dist/view/styles/utils.d.ts +0 -97
  362. package/dist/view/stylesmap.d.ts +0 -685
  363. package/dist/view/text.d.ts +0 -78
  364. package/dist/view/textproxy.d.ts +0 -101
  365. package/dist/view/treewalker.d.ts +0 -199
  366. package/dist/view/typecheckable.d.ts +0 -452
  367. package/dist/view/uielement.d.ts +0 -100
  368. package/dist/view/upcastwriter.d.ts +0 -421
  369. package/dist/view/view.d.ts +0 -488
@@ -1,665 +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 engine/view/domconverter
11
- */
12
- import ViewText from './text.js';
13
- import ViewElement from './element.js';
14
- import ViewUIElement from './uielement.js';
15
- import ViewPosition from './position.js';
16
- import ViewRange from './range.js';
17
- import ViewSelection from './selection.js';
18
- import ViewDocumentFragment from './documentfragment.js';
19
- import { type MatcherPattern } from './matcher.js';
20
- import type ViewNode from './node.js';
21
- import type Document from './document.js';
22
- import type DocumentSelection from './documentselection.js';
23
- import type EditableElement from './editableelement.js';
24
- import type ViewRawElement from './rawelement.js';
25
- type DomNode = globalThis.Node;
26
- type DomElement = globalThis.HTMLElement;
27
- type DomDocumentFragment = globalThis.DocumentFragment;
28
- type DomRange = globalThis.Range;
29
- type DomText = globalThis.Text;
30
- type DomSelection = globalThis.Selection;
31
- /**
32
- * `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles
33
- * {@link module:engine/view/domconverter~DomConverter#bindElements bindings} between these nodes.
34
- *
35
- * An instance of the DOM converter is available under
36
- * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.
37
- *
38
- * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the
39
- * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).
40
- *
41
- * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.
42
- * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.
43
- */
44
- export default class DomConverter {
45
- readonly document: Document;
46
- /**
47
- * Whether to leave the View-to-DOM conversion result unchanged or improve editing experience by filtering out interactive data.
48
- */
49
- readonly renderingMode: 'data' | 'editing';
50
- /**
51
- * The mode of a block filler used by the DOM converter.
52
- */
53
- blockFillerMode: BlockFillerMode;
54
- /**
55
- * Elements which are considered pre-formatted elements.
56
- */
57
- readonly preElements: Array<string>;
58
- /**
59
- * Elements which are considered block elements (and hence should be filled with a
60
- * {@link #isBlockFiller block filler}).
61
- *
62
- * Whether an element is considered a block element also affects handling of trailing whitespaces.
63
- *
64
- * You can extend this array if you introduce support for block elements which are not yet recognized here.
65
- */
66
- readonly blockElements: Array<string>;
67
- /**
68
- * A list of elements that exist inline (in text) but their inner structure cannot be edited because
69
- * of the way they are rendered by the browser. They are mostly HTML form elements but there are other
70
- * elements such as `<img>` or `<iframe>` that also have non-editable children or no children whatsoever.
71
- *
72
- * Whether an element is considered an inline object has an impact on white space rendering (trimming)
73
- * around (and inside of it). In short, white spaces in text nodes next to inline objects are not trimmed.
74
- *
75
- * You can extend this array if you introduce support for inline object elements which are not yet recognized here.
76
- */
77
- readonly inlineObjectElements: Array<string>;
78
- /**
79
- * A list of elements which may affect the editing experience. To avoid this, those elements are replaced with
80
- * `<span data-ck-unsafe-element="[element name]"></span>` while rendering in the editing mode.
81
- */
82
- readonly unsafeElements: Array<string>;
83
- /**
84
- * The DOM Document used to create DOM nodes.
85
- */
86
- private readonly _domDocument;
87
- /**
88
- * The DOM-to-view mapping.
89
- */
90
- private readonly _domToViewMapping;
91
- /**
92
- * The view-to-DOM mapping.
93
- */
94
- private readonly _viewToDomMapping;
95
- /**
96
- * Holds the mapping between fake selection containers and corresponding view selections.
97
- */
98
- private readonly _fakeSelectionMapping;
99
- /**
100
- * Matcher for view elements whose content should be treated as raw data
101
- * and not processed during the conversion from DOM nodes to view elements.
102
- */
103
- private readonly _rawContentElementMatcher;
104
- /**
105
- * Matcher for inline object view elements. This is an extension of a simple {@link #inlineObjectElements} array of element names.
106
- */
107
- private readonly _inlineObjectElementMatcher;
108
- /**
109
- * Set of elements with temporary custom properties that require clearing after render.
110
- */
111
- private readonly _elementsWithTemporaryCustomProperties;
112
- /**
113
- * Creates a DOM converter.
114
- *
115
- * @param document The view document instance.
116
- * @param options An object with configuration options.
117
- * @param options.blockFillerMode The type of the block filler to use.
118
- * Default value depends on the options.renderingMode:
119
- * 'nbsp' when options.renderingMode == 'data',
120
- * 'br' when options.renderingMode == 'editing'.
121
- * @param options.renderingMode Whether to leave the View-to-DOM conversion result unchanged
122
- * or improve editing experience by filtering out interactive data.
123
- */
124
- constructor(document: Document, { blockFillerMode, renderingMode }?: {
125
- blockFillerMode?: BlockFillerMode;
126
- renderingMode?: 'data' | 'editing';
127
- });
128
- /**
129
- * Binds a given DOM element that represents fake selection to a **position** of a
130
- * {@link module:engine/view/documentselection~DocumentSelection document selection}.
131
- * Document selection copy is stored and can be retrieved by the
132
- * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.
133
- */
134
- bindFakeSelection(domElement: DomElement, viewDocumentSelection: DocumentSelection): void;
135
- /**
136
- * Returns a {@link module:engine/view/selection~Selection view selection} instance corresponding to a given
137
- * DOM element that represents fake selection. Returns `undefined` if binding to the given DOM element does not exist.
138
- */
139
- fakeSelectionToView(domElement: DomElement): ViewSelection | undefined;
140
- /**
141
- * Binds DOM and view elements, so it will be possible to get corresponding elements using
142
- * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
143
- * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
144
- *
145
- * @param domElement The DOM element to bind.
146
- * @param viewElement The view element to bind.
147
- */
148
- bindElements(domElement: DomElement, viewElement: ViewElement): void;
149
- /**
150
- * Unbinds a given DOM element from the view element it was bound to. Unbinding is deep, meaning that all children of
151
- * the DOM element will be unbound too.
152
- *
153
- * @param domElement The DOM element to unbind.
154
- */
155
- unbindDomElement(domElement: DomElement): void;
156
- /**
157
- * Binds DOM and view document fragments, so it will be possible to get corresponding document fragments using
158
- * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
159
- * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
160
- *
161
- * @param domFragment The DOM document fragment to bind.
162
- * @param viewFragment The view document fragment to bind.
163
- */
164
- bindDocumentFragments(domFragment: DomDocumentFragment, viewFragment: ViewDocumentFragment): void;
165
- /**
166
- * Decides whether a given pair of attribute key and value should be passed further down the pipeline.
167
- *
168
- * @param elementName Element name in lower case.
169
- */
170
- shouldRenderAttribute(attributeKey: string, attributeValue: string, elementName: string): boolean;
171
- /**
172
- * Set `domElement`'s content using provided `html` argument. Apply necessary filtering for the editing pipeline.
173
- *
174
- * @param domElement DOM element that should have `html` set as its content.
175
- * @param html Textual representation of the HTML that will be set on `domElement`.
176
- */
177
- setContentOf(domElement: DomElement, html: string): void;
178
- viewToDom(viewNode: ViewText, options?: {
179
- bind?: boolean;
180
- withChildren?: boolean;
181
- }): DomText;
182
- viewToDom(viewNode: ViewElement, options?: {
183
- bind?: boolean;
184
- withChildren?: boolean;
185
- }): DomElement;
186
- viewToDom(viewNode: ViewNode, options?: {
187
- bind?: boolean;
188
- withChildren?: boolean;
189
- }): DomNode;
190
- viewToDom(viewNode: ViewDocumentFragment, options?: {
191
- bind?: boolean;
192
- withChildren?: boolean;
193
- }): DomDocumentFragment;
194
- /**
195
- * Sets the attribute on a DOM element.
196
- *
197
- * **Note**: To remove the attribute, use {@link #removeDomElementAttribute}.
198
- *
199
- * @param domElement The DOM element the attribute should be set on.
200
- * @param key The name of the attribute.
201
- * @param value The value of the attribute.
202
- * @param relatedViewElement The view element related to the `domElement` (if there is any).
203
- * It helps decide whether the attribute set is unsafe. For instance, view elements created via the
204
- * {@link module:engine/view/downcastwriter~DowncastWriter} methods can allow certain attributes that would normally be filtered out.
205
- */
206
- setDomElementAttribute(domElement: DomElement, key: string, value: string, relatedViewElement?: ViewElement): void;
207
- /**
208
- * Removes an attribute from a DOM element.
209
- *
210
- * **Note**: To set the attribute, use {@link #setDomElementAttribute}.
211
- *
212
- * @param domElement The DOM element the attribute should be removed from.
213
- * @param key The name of the attribute.
214
- */
215
- removeDomElementAttribute(domElement: DomElement, key: string): void;
216
- /**
217
- * Converts children of the view element to DOM using the
218
- * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.
219
- * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.
220
- *
221
- * @param viewElement Parent view element.
222
- * @param options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.
223
- * @returns DOM nodes.
224
- */
225
- viewChildrenToDom(viewElement: ViewElement | ViewDocumentFragment, options?: {
226
- bind?: boolean;
227
- withChildren?: boolean;
228
- }): IterableIterator<Node>;
229
- /**
230
- * Converts view {@link module:engine/view/range~Range} to DOM range.
231
- * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
232
- *
233
- * @param viewRange View range.
234
- * @returns DOM range.
235
- */
236
- viewRangeToDom(viewRange: ViewRange): DomRange;
237
- /**
238
- * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.
239
- *
240
- * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
241
- * If the converted position is directly before inline filler it is moved inside the filler.
242
- *
243
- * @param viewPosition View position.
244
- * @returns DOM position or `null` if view position could not be converted to DOM.
245
- * DOM position has two properties:
246
- * * `parent` - DOM position parent.
247
- * * `offset` - DOM position offset.
248
- */
249
- viewPositionToDom(viewPosition: ViewPosition): {
250
- parent: DomNode;
251
- offset: number;
252
- } | null;
253
- /**
254
- * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will
255
- * be created. For bound elements and document fragments function will return corresponding items. For
256
- * {@link module:engine/view/filler fillers} `null` will be returned.
257
- * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.
258
- *
259
- * @param domNode DOM node or document fragment to transform.
260
- * @param options Conversion options.
261
- * @param options.bind Determines whether new elements will be bound. False by default.
262
- * @param options.withChildren If `true`, node's and document fragment's children will be converted too. True by default.
263
- * @param options.keepOriginalCase If `false`, node's tag name will be converted to lower case. False by default.
264
- * @param options.skipComments If `false`, comment nodes will be converted to `$comment`
265
- * {@link module:engine/view/uielement~UIElement view UI elements}. False by default.
266
- * @returns Converted node or document fragment or `null` if DOM node is a {@link module:engine/view/filler filler}
267
- * or the given node is an empty text node.
268
- */
269
- domToView(domNode: DomNode, options?: {
270
- bind?: boolean;
271
- withChildren?: boolean;
272
- keepOriginalCase?: boolean;
273
- skipComments?: boolean;
274
- }): ViewNode | ViewDocumentFragment | null;
275
- /**
276
- * Converts children of the DOM element to view nodes using
277
- * the {@link module:engine/view/domconverter~DomConverter#domToView} method.
278
- * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.
279
- *
280
- * @param domElement Parent DOM element.
281
- * @param options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
282
- * @param inlineNodes An array that will be populated with inline nodes. It's used internally for whitespace processing.
283
- * @returns View nodes.
284
- */
285
- domChildrenToView(domElement: DomElement, options?: Parameters<DomConverter['domToView']>[1], inlineNodes?: Array<ViewNode>): IterableIterator<ViewNode>;
286
- /**
287
- * Converts DOM selection to view {@link module:engine/view/selection~Selection}.
288
- * Ranges which cannot be converted will be omitted.
289
- *
290
- * @param domSelection DOM selection.
291
- * @returns View selection.
292
- */
293
- domSelectionToView(domSelection: DomSelection): ViewSelection;
294
- /**
295
- * Converts DOM Range to view {@link module:engine/view/range~Range}.
296
- * If the start or end position can not be converted `null` is returned.
297
- *
298
- * @param domRange DOM range.
299
- * @returns View range.
300
- */
301
- domRangeToView(domRange: DomRange | StaticRange): ViewRange | null;
302
- /**
303
- * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.
304
- *
305
- * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,
306
- * position of the filler will be converted and returned.
307
- *
308
- * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}
309
- * that position will be converted to view position before that UIElement.
310
- *
311
- * If structures are too different and it is not possible to find corresponding position then `null` will be returned.
312
- *
313
- * @param domParent DOM position parent.
314
- * @param domOffset DOM position offset. You can skip it when converting the inline filler node.
315
- * @returns View position.
316
- */
317
- domPositionToView(domParent: DomNode, domOffset?: number): ViewPosition | null;
318
- /**
319
- * Returns corresponding view {@link module:engine/view/element~Element Element} or
320
- * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or
321
- * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}
322
- * to the given DOM - `undefined` is returned.
323
- *
324
- * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or
325
- * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
326
- *
327
- * @param domElementOrDocumentFragment DOM element or document fragment.
328
- * @returns Corresponding view element, document fragment or `undefined` if no element was bound.
329
- */
330
- mapDomToView(domElementOrDocumentFragment: DomElement | DomDocumentFragment): ViewElement | ViewDocumentFragment | undefined;
331
- /**
332
- * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
333
- * corresponding text node is returned based on the sibling or parent.
334
- *
335
- * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
336
- * to find the corresponding text node.
337
- *
338
- * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
339
- * element, it is used to find the corresponding text node.
340
- *
341
- * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or
342
- * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
343
- *
344
- * Otherwise `null` is returned.
345
- *
346
- * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.
347
- *
348
- * @param domText DOM text node.
349
- * @returns Corresponding view text node or `null`, if it was not possible to find a corresponding node.
350
- */
351
- findCorrespondingViewText(domText: DomText): ViewText | ViewUIElement | ViewRawElement | null;
352
- /**
353
- * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
354
- * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
355
- * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
356
- * use {@link #findCorrespondingDomText}.
357
- *
358
- * @label ELEMENT
359
- * @param element View element or document fragment.
360
- * @returns Corresponding DOM node or document fragment.
361
- */
362
- mapViewToDom(element: ViewElement): DomElement | undefined;
363
- /**
364
- * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
365
- * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
366
- * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
367
- * use {@link #findCorrespondingDomText}.
368
- *
369
- * @label DOCUMENT_FRAGMENT
370
- * @param documentFragment View element or document fragment.
371
- * @returns Corresponding DOM node or document fragment.
372
- */
373
- mapViewToDom(documentFragment: ViewDocumentFragment): DomDocumentFragment | undefined;
374
- /**
375
- * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
376
- * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
377
- * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
378
- * use {@link #findCorrespondingDomText}.
379
- *
380
- * @label DOCUMENT_FRAGMENT_OR_ELEMENT
381
- * @param documentFragmentOrElement View element or document fragment.
382
- * @returns Corresponding DOM node or document fragment.
383
- */
384
- mapViewToDom(documentFragmentOrElement: ViewElement | ViewDocumentFragment): DomElement | DomDocumentFragment | undefined;
385
- /**
386
- * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
387
- * corresponding text node is returned based on the sibling or parent.
388
- *
389
- * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
390
- * to find the corresponding text node.
391
- *
392
- * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
393
- * element, it is used to find the corresponding text node.
394
- *
395
- * Otherwise `null` is returned.
396
- *
397
- * @param viewText View text node.
398
- * @returns Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.
399
- */
400
- findCorrespondingDomText(viewText: ViewText): DomText | null;
401
- /**
402
- * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.
403
- */
404
- focus(viewEditable: EditableElement): void;
405
- /**
406
- * Remove DOM selection from blurred editable, so it won't interfere with clicking on dropdowns (especially on iOS).
407
- *
408
- * @internal
409
- */
410
- _clearDomSelection(): void;
411
- /**
412
- * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.
413
- *
414
- * @param node Node to check.
415
- */
416
- isElement(node: DomNode): node is DomElement;
417
- /**
418
- * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.
419
- *
420
- * @param node Node to check.
421
- */
422
- isDocumentFragment(node: DomNode): node is DomDocumentFragment;
423
- /**
424
- * Checks if the node is an instance of the block filler for this DOM converter.
425
- *
426
- * ```ts
427
- * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );
428
- *
429
- * converter.isBlockFiller( BR_FILLER( document ) ); // true
430
- * converter.isBlockFiller( NBSP_FILLER( document ) ); // false
431
- * ```
432
- *
433
- * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.
434
- *
435
- * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.
436
- *
437
- * @param domNode DOM node to check.
438
- * @returns True if a node is considered a block filler for given mode.
439
- */
440
- isBlockFiller(domNode: DomNode): boolean;
441
- /**
442
- * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.
443
- *
444
- * @param DOM Selection instance to check.
445
- */
446
- isDomSelectionBackward(selection: DomSelection): boolean;
447
- /**
448
- * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}
449
- * that hosts the provided DOM node. Returns `null` if there is no such parent.
450
- */
451
- getHostViewElement(domNode: DomNode): ViewUIElement | ViewRawElement | null;
452
- /**
453
- * Checks if the given selection's boundaries are at correct places.
454
- *
455
- * The following places are considered as incorrect for selection boundaries:
456
- *
457
- * * before or in the middle of an inline filler sequence,
458
- * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},
459
- * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.
460
- *
461
- * @param domSelection The DOM selection object to be checked.
462
- * @returns `true` if the given selection is at a correct place, `false` otherwise.
463
- */
464
- isDomSelectionCorrect(domSelection: DomSelection): boolean;
465
- /**
466
- * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
467
- * and not processed during the conversion from DOM nodes to view elements.
468
- *
469
- * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and
470
- * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.
471
- *
472
- * The raw data can be later accessed by a
473
- * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
474
- *
475
- * @param pattern Pattern matching a view element whose content should
476
- * be treated as raw data.
477
- */
478
- registerRawContentMatcher(pattern: MatcherPattern): void;
479
- /**
480
- * Registers a {@link module:engine/view/matcher~MatcherPattern} for inline object view elements.
481
- *
482
- * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and
483
- * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.
484
- *
485
- * This is an extension of a simple {@link #inlineObjectElements} array of element names.
486
- *
487
- * @param pattern Pattern matching a view element which should be treated as an inline object.
488
- */
489
- registerInlineObjectMatcher(pattern: MatcherPattern): void;
490
- /**
491
- * Clear temporary custom properties.
492
- *
493
- * @internal
494
- */
495
- _clearTemporaryCustomProperties(): void;
496
- /**
497
- * Returns the block {@link module:engine/view/filler filler} node based on the current {@link #blockFillerMode} setting.
498
- */
499
- private _getBlockFiller;
500
- /**
501
- * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.
502
- *
503
- * @param domParent Position parent.
504
- * @param offset Position offset.
505
- * @returns `true` if given position is at a correct place for selection boundary, `false` otherwise.
506
- */
507
- private _isDomSelectionPositionCorrect;
508
- /**
509
- * Internal generator for {@link #domToView}. Also used by {@link #domChildrenToView}.
510
- * Separates DOM nodes conversion from whitespaces processing.
511
- *
512
- * @param domNode DOM node or document fragment to transform.
513
- * @param inlineNodes An array of recently encountered inline nodes truncated to the block element boundaries.
514
- * Used later to process whitespaces.
515
- */
516
- private _domToView;
517
- /**
518
- * Internal helper that walks the list of inline view nodes already generated from DOM nodes
519
- * and handles whitespaces and NBSPs.
520
- *
521
- * @param domParent The DOM parent of the given inline nodes. This should be a document fragment or
522
- * a block element to whitespace processing start cleaning.
523
- * @param inlineNodes An array of recently encountered inline nodes truncated to the block element boundaries.
524
- */
525
- private _processDomInlineNodes;
526
- /**
527
- * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so
528
- * it is correctly displayed in the DOM.
529
- *
530
- * Following changes are done:
531
- *
532
- * * a space at the beginning is changed to `&nbsp;` if this is the first text node in its container
533
- * element or if a previous text node ends with a space character,
534
- * * space at the end of the text node is changed to `&nbsp;` if there are two spaces at the end of a node or if next node
535
- * starts with a space or if it is the last text node in its container,
536
- * * remaining spaces are replaced to a chain of spaces and `&nbsp;` (e.g. `'x x'` becomes `'x &nbsp; x'`).
537
- *
538
- * Content of {@link #preElements} is not processed.
539
- *
540
- * @param node View text node to process.
541
- * @returns Processed text data.
542
- */
543
- private _processDataFromViewText;
544
- /**
545
- * Checks whether given node ends with a space character after changing appropriate space characters to `&nbsp;`s.
546
- *
547
- * @param node Node to check.
548
- * @returns `true` if given `node` ends with space, `false` otherwise.
549
- */
550
- private _nodeEndsWithSpace;
551
- /**
552
- * Checks whether given text contains preformatted white space. This is the case if
553
- * * any of node ancestors has a name which is in `preElements` array, or
554
- * * the closest ancestor that has the `white-space` CSS property sets it to a value that preserves spaces
555
- *
556
- * @param node Node to check
557
- * @returns `true` if given node contains preformatted white space, `false` otherwise.
558
- */
559
- private _isPreFormatted;
560
- /**
561
- * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling
562
- * that is contained in the same container element. If there is no such sibling, `null` is returned.
563
- *
564
- * @param node Reference node.
565
- * @returns Touching text node, an inline object
566
- * or `null` if there is no next or previous touching text node.
567
- */
568
- private _getTouchingInlineViewNode;
569
- /**
570
- * Returns `true` if a DOM node belongs to {@link #blockElements}. `false` otherwise.
571
- */
572
- private _isBlockDomElement;
573
- /**
574
- * Returns `true` if a view node belongs to {@link #blockElements}. `false` otherwise.
575
- */
576
- private _isBlockViewElement;
577
- /**
578
- * Returns `true` if a DOM node belongs to {@link #inlineObjectElements}. `false` otherwise.
579
- */
580
- private _isInlineObjectElement;
581
- /**
582
- * Creates view element basing on the node type.
583
- *
584
- * @param node DOM node to check.
585
- * @param options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
586
- */
587
- private _createViewElement;
588
- /**
589
- * Checks if view element's content should be treated as a raw data.
590
- *
591
- * @param viewElement View element to check.
592
- * @param options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
593
- */
594
- private _isViewElementWithRawContent;
595
- /**
596
- * Checks whether a given element name should be renamed in a current rendering mode.
597
- *
598
- * @param elementName The name of view element.
599
- */
600
- private _shouldRenameElement;
601
- /**
602
- * Return a <span> element with a special attribute holding the name of the original element.
603
- * Optionally, copy all the attributes of the original element if that element is provided.
604
- *
605
- * @param elementName The name of view element.
606
- * @param originalDomElement The original DOM element to copy attributes and content from.
607
- */
608
- private _createReplacementDomElement;
609
- }
610
- /**
611
- * Enum representing the type of the block filler.
612
- *
613
- * Possible values:
614
- *
615
- * * `br` &ndash; For the `<br data-cke-filler="true">` block filler used in the editing view.
616
- * * `nbsp` &ndash; For the `&nbsp;` block fillers used in the data.
617
- * * `markedNbsp` &ndash; For the `&nbsp;` block fillers wrapped in `<span>` elements: `<span data-cke-filler="true">&nbsp;</span>`
618
- * used in the data.
619
- */
620
- type BlockFillerMode = 'br' | 'nbsp' | 'markedNbsp';
621
- export {};
622
- /**
623
- * While rendering the editor content, the {@link module:engine/view/domconverter~DomConverter} detected a `<script>` element that may
624
- * disrupt the editing experience. To avoid this, the `<script>` element was replaced with `<span data-ck-unsafe-element="script"></span>`.
625
- *
626
- * @error domconverter-unsafe-script-element-detected
627
- */
628
- /**
629
- * While rendering the editor content, the {@link module:engine/view/domconverter~DomConverter} detected a `<style>` element that may affect
630
- * the editing experience. To avoid this, the `<style>` element was replaced with `<span data-ck-unsafe-element="style"></span>`.
631
- *
632
- * @error domconverter-unsafe-style-element-detected
633
- */
634
- /**
635
- * The {@link module:engine/view/domconverter~DomConverter} detected an interactive attribute in the
636
- * {@glink framework/architecture/editing-engine#editing-pipeline editing pipeline}. For the best
637
- * editing experience, the attribute was renamed to `data-ck-unsafe-attribute-[original attribute name]`.
638
- *
639
- * If you are the author of the plugin that generated this attribute and you want it to be preserved
640
- * in the editing pipeline, you can configure this when creating the element
641
- * using {@link module:engine/view/downcastwriter~DowncastWriter} during the
642
- * {@glink framework/architecture/editing-engine#conversion model–view conversion}. Methods such as
643
- * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
644
- * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement}, or
645
- * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement}
646
- * accept an option that will disable filtering of specific attributes:
647
- *
648
- * ```ts
649
- * const paragraph = writer.createContainerElement( 'p',
650
- * {
651
- * class: 'clickable-paragraph',
652
- * onclick: 'alert( "Paragraph clicked!" )'
653
- * },
654
- * {
655
- * // Make sure the "onclick" attribute will pass through.
656
- * renderUnsafeAttributes: [ 'onclick' ]
657
- * }
658
- * );
659
- * ```
660
- *
661
- * @error domconverter-unsafe-attribute-detected
662
- * @param domElement The DOM element the attribute was set on.
663
- * @param key The original name of the attribute
664
- * @param value The value of the original attribute
665
- */