@ckeditor/ckeditor5-ui 0.0.0-internal-20241017.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 (677) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +26 -0
  4. package/ckeditor5-metadata.json +25 -0
  5. package/dist/arialiveannouncer.d.ts +113 -0
  6. package/dist/augmentation.d.ts +92 -0
  7. package/dist/autocomplete/autocompleteview.d.ts +85 -0
  8. package/dist/badge/badge.d.ts +133 -0
  9. package/dist/bindings/addkeyboardhandlingforgrid.d.ts +31 -0
  10. package/dist/bindings/clickoutsidehandler.d.ts +34 -0
  11. package/dist/bindings/csstransitiondisablermixin.d.ts +44 -0
  12. package/dist/bindings/draggableviewmixin.d.ts +50 -0
  13. package/dist/bindings/injectcsstransitiondisabler.d.ts +63 -0
  14. package/dist/bindings/preventdefault.d.ts +37 -0
  15. package/dist/bindings/submithandler.d.ts +61 -0
  16. package/dist/button/button.d.ts +179 -0
  17. package/dist/button/buttonlabel.d.ts +38 -0
  18. package/dist/button/buttonlabelview.d.ts +35 -0
  19. package/dist/button/buttonview.d.ts +201 -0
  20. package/dist/button/filedialogbuttonview.d.ts +111 -0
  21. package/dist/button/listitembuttonview.d.ts +82 -0
  22. package/dist/button/switchbuttonview.d.ts +49 -0
  23. package/dist/collapsible/collapsibleview.d.ts +74 -0
  24. package/dist/colorgrid/colorgridview.d.ts +136 -0
  25. package/dist/colorgrid/colortileview.d.ts +32 -0
  26. package/dist/colorgrid/utils.d.ts +51 -0
  27. package/dist/colorpicker/colorpickerview.d.ts +177 -0
  28. package/dist/colorpicker/utils.d.ts +52 -0
  29. package/dist/colorselector/colorgridsfragmentview.d.ts +199 -0
  30. package/dist/colorselector/colorpickerfragmentview.d.ts +137 -0
  31. package/dist/colorselector/colorselectorview.d.ts +246 -0
  32. package/dist/colorselector/documentcolorcollection.d.ts +74 -0
  33. package/dist/componentfactory.d.ts +85 -0
  34. package/dist/dialog/dialog.d.ts +281 -0
  35. package/dist/dialog/dialogactionsview.d.ts +73 -0
  36. package/dist/dialog/dialogcontentview.d.ts +31 -0
  37. package/dist/dialog/dialogview.d.ts +260 -0
  38. package/dist/dropdown/button/dropdownbutton.d.ts +29 -0
  39. package/dist/dropdown/button/dropdownbuttonview.d.ts +52 -0
  40. package/dist/dropdown/button/splitbuttonview.d.ts +166 -0
  41. package/dist/dropdown/dropdownpanelfocusable.d.ts +25 -0
  42. package/dist/dropdown/dropdownpanelview.d.ts +66 -0
  43. package/dist/dropdown/dropdownview.d.ts +332 -0
  44. package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +48 -0
  45. package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +40 -0
  46. package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +21 -0
  47. package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +26 -0
  48. package/dist/dropdown/menu/dropdownmenulistview.d.ts +28 -0
  49. package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +38 -0
  50. package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +135 -0
  51. package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +144 -0
  52. package/dist/dropdown/menu/utils.d.ts +128 -0
  53. package/dist/dropdown/utils.d.ts +297 -0
  54. package/dist/editableui/editableuiview.d.ts +76 -0
  55. package/dist/editableui/inline/inlineeditableuiview.d.ts +48 -0
  56. package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +59 -0
  57. package/dist/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +39 -0
  58. package/dist/editorui/bodycollection.d.ts +59 -0
  59. package/dist/editorui/boxed/boxededitoruiview.d.ts +44 -0
  60. package/dist/editorui/editorui.d.ts +358 -0
  61. package/dist/editorui/editoruiview.d.ts +48 -0
  62. package/dist/editorui/evaluationbadge.d.ts +37 -0
  63. package/dist/editorui/poweredby.d.ts +38 -0
  64. package/dist/focuscycler.d.ts +295 -0
  65. package/dist/formheader/formheaderview.d.ts +62 -0
  66. package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +34 -0
  67. package/dist/highlightedtext/highlightedtextview.d.ts +42 -0
  68. package/dist/highlightedtext/labelwithhighlightview.d.ts +30 -0
  69. package/dist/icon/iconview.d.ts +92 -0
  70. package/dist/iframe/iframeview.d.ts +54 -0
  71. package/dist/index-content.css +4 -0
  72. package/dist/index-editor.css +754 -0
  73. package/dist/index.css +1063 -0
  74. package/dist/index.css.map +1 -0
  75. package/dist/index.d.ts +97 -0
  76. package/dist/index.js +17688 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/input/inputbase.d.ts +123 -0
  79. package/dist/input/inputview.d.ts +40 -0
  80. package/dist/inputnumber/inputnumberview.d.ts +53 -0
  81. package/dist/inputtext/inputtextview.d.ts +22 -0
  82. package/dist/label/labelview.d.ts +40 -0
  83. package/dist/labeledfield/labeledfieldview.d.ts +191 -0
  84. package/dist/labeledfield/utils.d.ts +127 -0
  85. package/dist/labeledinput/labeledinputview.d.ts +129 -0
  86. package/dist/list/listitemgroupview.d.ts +63 -0
  87. package/dist/list/listitemview.d.ts +40 -0
  88. package/dist/list/listseparatorview.d.ts +22 -0
  89. package/dist/list/listview.d.ts +128 -0
  90. package/dist/menubar/menubarmenubuttonview.d.ts +39 -0
  91. package/dist/menubar/menubarmenulistitembuttonview.d.ts +25 -0
  92. package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +27 -0
  93. package/dist/menubar/menubarmenulistitemview.d.ts +29 -0
  94. package/dist/menubar/menubarmenulistview.d.ts +33 -0
  95. package/dist/menubar/menubarmenupanelview.d.ts +57 -0
  96. package/dist/menubar/menubarmenuview.d.ts +113 -0
  97. package/dist/menubar/menubarview.d.ts +177 -0
  98. package/dist/menubar/utils.d.ts +451 -0
  99. package/dist/model.d.ts +26 -0
  100. package/dist/notification/notification.d.ts +219 -0
  101. package/dist/panel/balloon/balloonpanelview.d.ts +701 -0
  102. package/dist/panel/balloon/contextualballoon.d.ts +313 -0
  103. package/dist/panel/sticky/stickypanelview.d.ts +160 -0
  104. package/dist/search/filteredview.d.ts +35 -0
  105. package/dist/search/filtergroupanditemnames.d.ts +19 -0
  106. package/dist/search/searchinfoview.d.ts +49 -0
  107. package/dist/search/searchresultsview.d.ts +58 -0
  108. package/dist/search/text/searchtextqueryview.d.ts +80 -0
  109. package/dist/search/text/searchtextview.d.ts +223 -0
  110. package/dist/spinner/spinnerview.d.ts +29 -0
  111. package/dist/template.d.ts +946 -0
  112. package/dist/textarea/textareaview.d.ts +108 -0
  113. package/dist/toolbar/balloon/balloontoolbar.d.ts +130 -0
  114. package/dist/toolbar/block/blockbuttonview.d.ts +39 -0
  115. package/dist/toolbar/block/blocktoolbar.d.ts +175 -0
  116. package/dist/toolbar/normalizetoolbarconfig.d.ts +44 -0
  117. package/dist/toolbar/toolbarlinebreakview.d.ts +22 -0
  118. package/dist/toolbar/toolbarseparatorview.d.ts +22 -0
  119. package/dist/toolbar/toolbarview.d.ts +271 -0
  120. package/dist/tooltipmanager.d.ts +192 -0
  121. package/dist/translations/af.d.ts +8 -0
  122. package/dist/translations/af.js +5 -0
  123. package/dist/translations/af.umd.js +11 -0
  124. package/dist/translations/ar.d.ts +8 -0
  125. package/dist/translations/ar.js +5 -0
  126. package/dist/translations/ar.umd.js +11 -0
  127. package/dist/translations/ast.d.ts +8 -0
  128. package/dist/translations/ast.js +5 -0
  129. package/dist/translations/ast.umd.js +11 -0
  130. package/dist/translations/az.d.ts +8 -0
  131. package/dist/translations/az.js +5 -0
  132. package/dist/translations/az.umd.js +11 -0
  133. package/dist/translations/bg.d.ts +8 -0
  134. package/dist/translations/bg.js +5 -0
  135. package/dist/translations/bg.umd.js +11 -0
  136. package/dist/translations/bn.d.ts +8 -0
  137. package/dist/translations/bn.js +5 -0
  138. package/dist/translations/bn.umd.js +11 -0
  139. package/dist/translations/bs.d.ts +8 -0
  140. package/dist/translations/bs.js +5 -0
  141. package/dist/translations/bs.umd.js +11 -0
  142. package/dist/translations/ca.d.ts +8 -0
  143. package/dist/translations/ca.js +5 -0
  144. package/dist/translations/ca.umd.js +11 -0
  145. package/dist/translations/cs.d.ts +8 -0
  146. package/dist/translations/cs.js +5 -0
  147. package/dist/translations/cs.umd.js +11 -0
  148. package/dist/translations/da.d.ts +8 -0
  149. package/dist/translations/da.js +5 -0
  150. package/dist/translations/da.umd.js +11 -0
  151. package/dist/translations/de-ch.d.ts +8 -0
  152. package/dist/translations/de-ch.js +5 -0
  153. package/dist/translations/de-ch.umd.js +11 -0
  154. package/dist/translations/de.d.ts +8 -0
  155. package/dist/translations/de.js +5 -0
  156. package/dist/translations/de.umd.js +11 -0
  157. package/dist/translations/el.d.ts +8 -0
  158. package/dist/translations/el.js +5 -0
  159. package/dist/translations/el.umd.js +11 -0
  160. package/dist/translations/en-au.d.ts +8 -0
  161. package/dist/translations/en-au.js +5 -0
  162. package/dist/translations/en-au.umd.js +11 -0
  163. package/dist/translations/en-gb.d.ts +8 -0
  164. package/dist/translations/en-gb.js +5 -0
  165. package/dist/translations/en-gb.umd.js +11 -0
  166. package/dist/translations/en.d.ts +8 -0
  167. package/dist/translations/en.js +5 -0
  168. package/dist/translations/en.umd.js +11 -0
  169. package/dist/translations/eo.d.ts +8 -0
  170. package/dist/translations/eo.js +5 -0
  171. package/dist/translations/eo.umd.js +11 -0
  172. package/dist/translations/es-co.d.ts +8 -0
  173. package/dist/translations/es-co.js +5 -0
  174. package/dist/translations/es-co.umd.js +11 -0
  175. package/dist/translations/es.d.ts +8 -0
  176. package/dist/translations/es.js +5 -0
  177. package/dist/translations/es.umd.js +11 -0
  178. package/dist/translations/et.d.ts +8 -0
  179. package/dist/translations/et.js +5 -0
  180. package/dist/translations/et.umd.js +11 -0
  181. package/dist/translations/eu.d.ts +8 -0
  182. package/dist/translations/eu.js +5 -0
  183. package/dist/translations/eu.umd.js +11 -0
  184. package/dist/translations/fa.d.ts +8 -0
  185. package/dist/translations/fa.js +5 -0
  186. package/dist/translations/fa.umd.js +11 -0
  187. package/dist/translations/fi.d.ts +8 -0
  188. package/dist/translations/fi.js +5 -0
  189. package/dist/translations/fi.umd.js +11 -0
  190. package/dist/translations/fr.d.ts +8 -0
  191. package/dist/translations/fr.js +5 -0
  192. package/dist/translations/fr.umd.js +11 -0
  193. package/dist/translations/gl.d.ts +8 -0
  194. package/dist/translations/gl.js +5 -0
  195. package/dist/translations/gl.umd.js +11 -0
  196. package/dist/translations/he.d.ts +8 -0
  197. package/dist/translations/he.js +5 -0
  198. package/dist/translations/he.umd.js +11 -0
  199. package/dist/translations/hi.d.ts +8 -0
  200. package/dist/translations/hi.js +5 -0
  201. package/dist/translations/hi.umd.js +11 -0
  202. package/dist/translations/hr.d.ts +8 -0
  203. package/dist/translations/hr.js +5 -0
  204. package/dist/translations/hr.umd.js +11 -0
  205. package/dist/translations/hu.d.ts +8 -0
  206. package/dist/translations/hu.js +5 -0
  207. package/dist/translations/hu.umd.js +11 -0
  208. package/dist/translations/id.d.ts +8 -0
  209. package/dist/translations/id.js +5 -0
  210. package/dist/translations/id.umd.js +11 -0
  211. package/dist/translations/it.d.ts +8 -0
  212. package/dist/translations/it.js +5 -0
  213. package/dist/translations/it.umd.js +11 -0
  214. package/dist/translations/ja.d.ts +8 -0
  215. package/dist/translations/ja.js +5 -0
  216. package/dist/translations/ja.umd.js +11 -0
  217. package/dist/translations/jv.d.ts +8 -0
  218. package/dist/translations/jv.js +5 -0
  219. package/dist/translations/jv.umd.js +11 -0
  220. package/dist/translations/km.d.ts +8 -0
  221. package/dist/translations/km.js +5 -0
  222. package/dist/translations/km.umd.js +11 -0
  223. package/dist/translations/kn.d.ts +8 -0
  224. package/dist/translations/kn.js +5 -0
  225. package/dist/translations/kn.umd.js +11 -0
  226. package/dist/translations/ko.d.ts +8 -0
  227. package/dist/translations/ko.js +5 -0
  228. package/dist/translations/ko.umd.js +11 -0
  229. package/dist/translations/ku.d.ts +8 -0
  230. package/dist/translations/ku.js +5 -0
  231. package/dist/translations/ku.umd.js +11 -0
  232. package/dist/translations/lt.d.ts +8 -0
  233. package/dist/translations/lt.js +5 -0
  234. package/dist/translations/lt.umd.js +11 -0
  235. package/dist/translations/lv.d.ts +8 -0
  236. package/dist/translations/lv.js +5 -0
  237. package/dist/translations/lv.umd.js +11 -0
  238. package/dist/translations/ms.d.ts +8 -0
  239. package/dist/translations/ms.js +5 -0
  240. package/dist/translations/ms.umd.js +11 -0
  241. package/dist/translations/nb.d.ts +8 -0
  242. package/dist/translations/nb.js +5 -0
  243. package/dist/translations/nb.umd.js +11 -0
  244. package/dist/translations/ne.d.ts +8 -0
  245. package/dist/translations/ne.js +5 -0
  246. package/dist/translations/ne.umd.js +11 -0
  247. package/dist/translations/nl.d.ts +8 -0
  248. package/dist/translations/nl.js +5 -0
  249. package/dist/translations/nl.umd.js +11 -0
  250. package/dist/translations/no.d.ts +8 -0
  251. package/dist/translations/no.js +5 -0
  252. package/dist/translations/no.umd.js +11 -0
  253. package/dist/translations/pl.d.ts +8 -0
  254. package/dist/translations/pl.js +5 -0
  255. package/dist/translations/pl.umd.js +11 -0
  256. package/dist/translations/pt-br.d.ts +8 -0
  257. package/dist/translations/pt-br.js +5 -0
  258. package/dist/translations/pt-br.umd.js +11 -0
  259. package/dist/translations/pt.d.ts +8 -0
  260. package/dist/translations/pt.js +5 -0
  261. package/dist/translations/pt.umd.js +11 -0
  262. package/dist/translations/ro.d.ts +8 -0
  263. package/dist/translations/ro.js +5 -0
  264. package/dist/translations/ro.umd.js +11 -0
  265. package/dist/translations/ru.d.ts +8 -0
  266. package/dist/translations/ru.js +5 -0
  267. package/dist/translations/ru.umd.js +11 -0
  268. package/dist/translations/sk.d.ts +8 -0
  269. package/dist/translations/sk.js +5 -0
  270. package/dist/translations/sk.umd.js +11 -0
  271. package/dist/translations/sl.d.ts +8 -0
  272. package/dist/translations/sl.js +5 -0
  273. package/dist/translations/sl.umd.js +11 -0
  274. package/dist/translations/sq.d.ts +8 -0
  275. package/dist/translations/sq.js +5 -0
  276. package/dist/translations/sq.umd.js +11 -0
  277. package/dist/translations/sr-latn.d.ts +8 -0
  278. package/dist/translations/sr-latn.js +5 -0
  279. package/dist/translations/sr-latn.umd.js +11 -0
  280. package/dist/translations/sr.d.ts +8 -0
  281. package/dist/translations/sr.js +5 -0
  282. package/dist/translations/sr.umd.js +11 -0
  283. package/dist/translations/sv.d.ts +8 -0
  284. package/dist/translations/sv.js +5 -0
  285. package/dist/translations/sv.umd.js +11 -0
  286. package/dist/translations/th.d.ts +8 -0
  287. package/dist/translations/th.js +5 -0
  288. package/dist/translations/th.umd.js +11 -0
  289. package/dist/translations/ti.d.ts +8 -0
  290. package/dist/translations/ti.js +5 -0
  291. package/dist/translations/ti.umd.js +11 -0
  292. package/dist/translations/tk.d.ts +8 -0
  293. package/dist/translations/tk.js +5 -0
  294. package/dist/translations/tk.umd.js +11 -0
  295. package/dist/translations/tr.d.ts +8 -0
  296. package/dist/translations/tr.js +5 -0
  297. package/dist/translations/tr.umd.js +11 -0
  298. package/dist/translations/tt.d.ts +8 -0
  299. package/dist/translations/tt.js +5 -0
  300. package/dist/translations/tt.umd.js +11 -0
  301. package/dist/translations/ug.d.ts +8 -0
  302. package/dist/translations/ug.js +5 -0
  303. package/dist/translations/ug.umd.js +11 -0
  304. package/dist/translations/uk.d.ts +8 -0
  305. package/dist/translations/uk.js +5 -0
  306. package/dist/translations/uk.umd.js +11 -0
  307. package/dist/translations/ur.d.ts +8 -0
  308. package/dist/translations/ur.js +5 -0
  309. package/dist/translations/ur.umd.js +11 -0
  310. package/dist/translations/uz.d.ts +8 -0
  311. package/dist/translations/uz.js +5 -0
  312. package/dist/translations/uz.umd.js +11 -0
  313. package/dist/translations/vi.d.ts +8 -0
  314. package/dist/translations/vi.js +5 -0
  315. package/dist/translations/vi.umd.js +11 -0
  316. package/dist/translations/zh-cn.d.ts +8 -0
  317. package/dist/translations/zh-cn.js +5 -0
  318. package/dist/translations/zh-cn.umd.js +11 -0
  319. package/dist/translations/zh.d.ts +8 -0
  320. package/dist/translations/zh.js +5 -0
  321. package/dist/translations/zh.umd.js +11 -0
  322. package/dist/view.d.ts +426 -0
  323. package/dist/viewcollection.d.ts +143 -0
  324. package/lang/contexts.json +51 -0
  325. package/lang/translations/af.po +214 -0
  326. package/lang/translations/ar.po +214 -0
  327. package/lang/translations/ast.po +214 -0
  328. package/lang/translations/az.po +214 -0
  329. package/lang/translations/bg.po +214 -0
  330. package/lang/translations/bn.po +214 -0
  331. package/lang/translations/bs.po +214 -0
  332. package/lang/translations/ca.po +214 -0
  333. package/lang/translations/cs.po +214 -0
  334. package/lang/translations/da.po +214 -0
  335. package/lang/translations/de-ch.po +214 -0
  336. package/lang/translations/de.po +214 -0
  337. package/lang/translations/el.po +214 -0
  338. package/lang/translations/en-au.po +214 -0
  339. package/lang/translations/en-gb.po +214 -0
  340. package/lang/translations/en.po +214 -0
  341. package/lang/translations/eo.po +214 -0
  342. package/lang/translations/es-co.po +214 -0
  343. package/lang/translations/es.po +214 -0
  344. package/lang/translations/et.po +214 -0
  345. package/lang/translations/eu.po +214 -0
  346. package/lang/translations/fa.po +214 -0
  347. package/lang/translations/fi.po +214 -0
  348. package/lang/translations/fr.po +214 -0
  349. package/lang/translations/gl.po +214 -0
  350. package/lang/translations/he.po +214 -0
  351. package/lang/translations/hi.po +214 -0
  352. package/lang/translations/hr.po +214 -0
  353. package/lang/translations/hu.po +214 -0
  354. package/lang/translations/id.po +214 -0
  355. package/lang/translations/it.po +214 -0
  356. package/lang/translations/ja.po +214 -0
  357. package/lang/translations/jv.po +214 -0
  358. package/lang/translations/km.po +214 -0
  359. package/lang/translations/kn.po +214 -0
  360. package/lang/translations/ko.po +214 -0
  361. package/lang/translations/ku.po +214 -0
  362. package/lang/translations/lt.po +214 -0
  363. package/lang/translations/lv.po +214 -0
  364. package/lang/translations/ms.po +214 -0
  365. package/lang/translations/nb.po +214 -0
  366. package/lang/translations/ne.po +214 -0
  367. package/lang/translations/nl.po +214 -0
  368. package/lang/translations/no.po +214 -0
  369. package/lang/translations/pl.po +214 -0
  370. package/lang/translations/pt-br.po +214 -0
  371. package/lang/translations/pt.po +214 -0
  372. package/lang/translations/ro.po +214 -0
  373. package/lang/translations/ru.po +214 -0
  374. package/lang/translations/sk.po +214 -0
  375. package/lang/translations/sl.po +214 -0
  376. package/lang/translations/sq.po +214 -0
  377. package/lang/translations/sr-latn.po +214 -0
  378. package/lang/translations/sr.po +214 -0
  379. package/lang/translations/sv.po +214 -0
  380. package/lang/translations/th.po +214 -0
  381. package/lang/translations/ti.po +214 -0
  382. package/lang/translations/tk.po +214 -0
  383. package/lang/translations/tr.po +214 -0
  384. package/lang/translations/tt.po +214 -0
  385. package/lang/translations/ug.po +214 -0
  386. package/lang/translations/uk.po +214 -0
  387. package/lang/translations/ur.po +214 -0
  388. package/lang/translations/uz.po +214 -0
  389. package/lang/translations/vi.po +214 -0
  390. package/lang/translations/zh-cn.po +214 -0
  391. package/lang/translations/zh.po +214 -0
  392. package/package.json +42 -0
  393. package/src/arialiveannouncer.d.ts +109 -0
  394. package/src/arialiveannouncer.js +165 -0
  395. package/src/augmentation.d.ts +88 -0
  396. package/src/augmentation.js +5 -0
  397. package/src/autocomplete/autocompleteview.d.ts +81 -0
  398. package/src/autocomplete/autocompleteview.js +154 -0
  399. package/src/badge/badge.d.ts +129 -0
  400. package/src/badge/badge.js +218 -0
  401. package/src/bindings/addkeyboardhandlingforgrid.d.ts +27 -0
  402. package/src/bindings/addkeyboardhandlingforgrid.js +107 -0
  403. package/src/bindings/clickoutsidehandler.d.ts +30 -0
  404. package/src/bindings/clickoutsidehandler.js +37 -0
  405. package/src/bindings/csstransitiondisablermixin.d.ts +40 -0
  406. package/src/bindings/csstransitiondisablermixin.js +55 -0
  407. package/src/bindings/draggableviewmixin.d.ts +46 -0
  408. package/src/bindings/draggableviewmixin.js +144 -0
  409. package/src/bindings/injectcsstransitiondisabler.d.ts +59 -0
  410. package/src/bindings/injectcsstransitiondisabler.js +71 -0
  411. package/src/bindings/preventdefault.d.ts +33 -0
  412. package/src/bindings/preventdefault.js +34 -0
  413. package/src/bindings/submithandler.d.ts +57 -0
  414. package/src/bindings/submithandler.js +47 -0
  415. package/src/button/button.d.ts +175 -0
  416. package/src/button/button.js +5 -0
  417. package/src/button/buttonlabel.d.ts +34 -0
  418. package/src/button/buttonlabel.js +5 -0
  419. package/src/button/buttonlabelview.d.ts +31 -0
  420. package/src/button/buttonlabelview.js +42 -0
  421. package/src/button/buttonview.d.ts +197 -0
  422. package/src/button/buttonview.js +248 -0
  423. package/src/button/filedialogbuttonview.d.ts +107 -0
  424. package/src/button/filedialogbuttonview.js +145 -0
  425. package/src/button/listitembuttonview.d.ts +78 -0
  426. package/src/button/listitembuttonview.js +129 -0
  427. package/src/button/switchbuttonview.d.ts +45 -0
  428. package/src/button/switchbuttonview.js +75 -0
  429. package/src/collapsible/collapsibleview.d.ts +70 -0
  430. package/src/collapsible/collapsibleview.js +95 -0
  431. package/src/colorgrid/colorgridview.d.ts +132 -0
  432. package/src/colorgrid/colorgridview.js +124 -0
  433. package/src/colorgrid/colortileview.d.ts +28 -0
  434. package/src/colorgrid/colortileview.js +42 -0
  435. package/src/colorgrid/utils.d.ts +47 -0
  436. package/src/colorgrid/utils.js +84 -0
  437. package/src/colorpicker/colorpickerview.d.ts +173 -0
  438. package/src/colorpicker/colorpickerview.js +326 -0
  439. package/src/colorpicker/utils.d.ts +48 -0
  440. package/src/colorpicker/utils.js +108 -0
  441. package/src/colorselector/colorgridsfragmentview.d.ts +195 -0
  442. package/src/colorselector/colorgridsfragmentview.js +291 -0
  443. package/src/colorselector/colorpickerfragmentview.d.ts +133 -0
  444. package/src/colorselector/colorpickerfragmentview.js +212 -0
  445. package/src/colorselector/colorselectorview.d.ts +242 -0
  446. package/src/colorselector/colorselectorview.js +257 -0
  447. package/src/colorselector/documentcolorcollection.d.ts +70 -0
  448. package/src/colorselector/documentcolorcollection.js +42 -0
  449. package/src/componentfactory.d.ts +81 -0
  450. package/src/componentfactory.js +104 -0
  451. package/src/dialog/dialog.d.ts +277 -0
  452. package/src/dialog/dialog.js +279 -0
  453. package/src/dialog/dialogactionsview.d.ts +69 -0
  454. package/src/dialog/dialogactionsview.js +98 -0
  455. package/src/dialog/dialogcontentview.d.ts +27 -0
  456. package/src/dialog/dialogcontentview.js +35 -0
  457. package/src/dialog/dialogview.d.ts +256 -0
  458. package/src/dialog/dialogview.js +453 -0
  459. package/src/dropdown/button/dropdownbutton.d.ts +25 -0
  460. package/src/dropdown/button/dropdownbutton.js +5 -0
  461. package/src/dropdown/button/dropdownbuttonview.d.ts +48 -0
  462. package/src/dropdown/button/dropdownbuttonview.js +66 -0
  463. package/src/dropdown/button/splitbuttonview.d.ts +162 -0
  464. package/src/dropdown/button/splitbuttonview.js +154 -0
  465. package/src/dropdown/dropdownpanelfocusable.d.ts +21 -0
  466. package/src/dropdown/dropdownpanelfocusable.js +5 -0
  467. package/src/dropdown/dropdownpanelview.d.ts +62 -0
  468. package/src/dropdown/dropdownpanelview.js +97 -0
  469. package/src/dropdown/dropdownview.d.ts +328 -0
  470. package/src/dropdown/dropdownview.js +380 -0
  471. package/src/dropdown/menu/dropdownmenubehaviors.d.ts +44 -0
  472. package/src/dropdown/menu/dropdownmenubehaviors.js +119 -0
  473. package/src/dropdown/menu/dropdownmenubuttonview.d.ts +36 -0
  474. package/src/dropdown/menu/dropdownmenubuttonview.js +65 -0
  475. package/src/dropdown/menu/dropdownmenulistitembuttonview.d.ts +17 -0
  476. package/src/dropdown/menu/dropdownmenulistitembuttonview.js +29 -0
  477. package/src/dropdown/menu/dropdownmenulistitemview.d.ts +22 -0
  478. package/src/dropdown/menu/dropdownmenulistitemview.js +34 -0
  479. package/src/dropdown/menu/dropdownmenulistview.d.ts +24 -0
  480. package/src/dropdown/menu/dropdownmenulistview.js +29 -0
  481. package/src/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +34 -0
  482. package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +63 -0
  483. package/src/dropdown/menu/dropdownmenunestedmenuview.d.ts +131 -0
  484. package/src/dropdown/menu/dropdownmenunestedmenuview.js +191 -0
  485. package/src/dropdown/menu/dropdownmenurootlistview.d.ts +140 -0
  486. package/src/dropdown/menu/dropdownmenurootlistview.js +160 -0
  487. package/src/dropdown/menu/utils.d.ts +124 -0
  488. package/src/dropdown/menu/utils.js +61 -0
  489. package/src/dropdown/utils.d.ts +293 -0
  490. package/src/dropdown/utils.js +562 -0
  491. package/src/editableui/editableuiview.d.ts +72 -0
  492. package/src/editableui/editableuiview.js +112 -0
  493. package/src/editableui/inline/inlineeditableuiview.d.ts +44 -0
  494. package/src/editableui/inline/inlineeditableuiview.js +71 -0
  495. package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +55 -0
  496. package/src/editorui/accessibilityhelp/accessibilityhelp.js +145 -0
  497. package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +35 -0
  498. package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js +112 -0
  499. package/src/editorui/bodycollection.d.ts +55 -0
  500. package/src/editorui/bodycollection.js +85 -0
  501. package/src/editorui/boxed/boxededitoruiview.d.ts +40 -0
  502. package/src/editorui/boxed/boxededitoruiview.js +81 -0
  503. package/src/editorui/editorui.d.ts +354 -0
  504. package/src/editorui/editorui.js +522 -0
  505. package/src/editorui/editoruiview.d.ts +44 -0
  506. package/src/editorui/editoruiview.js +38 -0
  507. package/src/editorui/evaluationbadge.d.ts +33 -0
  508. package/src/editorui/evaluationbadge.js +99 -0
  509. package/src/editorui/poweredby.d.ts +34 -0
  510. package/src/editorui/poweredby.js +127 -0
  511. package/src/focuscycler.d.ts +291 -0
  512. package/src/focuscycler.js +352 -0
  513. package/src/formheader/formheaderview.d.ts +58 -0
  514. package/src/formheader/formheaderview.js +69 -0
  515. package/src/highlightedtext/buttonlabelwithhighlightview.d.ts +30 -0
  516. package/src/highlightedtext/buttonlabelwithhighlightview.js +31 -0
  517. package/src/highlightedtext/highlightedtextview.d.ts +38 -0
  518. package/src/highlightedtext/highlightedtextview.js +102 -0
  519. package/src/highlightedtext/labelwithhighlightview.d.ts +26 -0
  520. package/src/highlightedtext/labelwithhighlightview.js +33 -0
  521. package/src/icon/iconview.d.ts +88 -0
  522. package/src/icon/iconview.js +115 -0
  523. package/src/iframe/iframeview.d.ts +50 -0
  524. package/src/iframe/iframeview.js +63 -0
  525. package/src/index.d.ts +93 -0
  526. package/src/index.js +90 -0
  527. package/src/input/inputbase.d.ts +119 -0
  528. package/src/input/inputbase.js +114 -0
  529. package/src/input/inputview.d.ts +36 -0
  530. package/src/input/inputview.js +24 -0
  531. package/src/inputnumber/inputnumberview.d.ts +49 -0
  532. package/src/inputnumber/inputnumberview.js +40 -0
  533. package/src/inputtext/inputtextview.d.ts +18 -0
  534. package/src/inputtext/inputtextview.js +27 -0
  535. package/src/label/labelview.d.ts +36 -0
  536. package/src/label/labelview.js +41 -0
  537. package/src/labeledfield/labeledfieldview.d.ts +187 -0
  538. package/src/labeledfield/labeledfieldview.js +157 -0
  539. package/src/labeledfield/utils.d.ts +123 -0
  540. package/src/labeledfield/utils.js +176 -0
  541. package/src/labeledinput/labeledinputview.d.ts +125 -0
  542. package/src/labeledinput/labeledinputview.js +125 -0
  543. package/src/list/listitemgroupview.d.ts +59 -0
  544. package/src/list/listitemgroupview.js +67 -0
  545. package/src/list/listitemview.d.ts +36 -0
  546. package/src/list/listitemview.js +42 -0
  547. package/src/list/listseparatorview.d.ts +18 -0
  548. package/src/list/listseparatorview.js +28 -0
  549. package/src/list/listview.d.ts +124 -0
  550. package/src/list/listview.js +188 -0
  551. package/src/menubar/menubarmenubuttonview.d.ts +35 -0
  552. package/src/menubar/menubarmenubuttonview.js +64 -0
  553. package/src/menubar/menubarmenulistitembuttonview.d.ts +21 -0
  554. package/src/menubar/menubarmenulistitembuttonview.js +30 -0
  555. package/src/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +23 -0
  556. package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +32 -0
  557. package/src/menubar/menubarmenulistitemview.d.ts +25 -0
  558. package/src/menubar/menubarmenulistitemview.js +34 -0
  559. package/src/menubar/menubarmenulistview.d.ts +29 -0
  560. package/src/menubar/menubarmenulistview.js +72 -0
  561. package/src/menubar/menubarmenupanelview.d.ts +53 -0
  562. package/src/menubar/menubarmenupanelview.js +60 -0
  563. package/src/menubar/menubarmenuview.d.ts +109 -0
  564. package/src/menubar/menubarmenuview.js +160 -0
  565. package/src/menubar/menubarview.d.ts +173 -0
  566. package/src/menubar/menubarview.js +261 -0
  567. package/src/menubar/utils.d.ts +447 -0
  568. package/src/menubar/utils.js +1388 -0
  569. package/src/model.d.ts +22 -0
  570. package/src/model.js +31 -0
  571. package/src/notification/notification.d.ts +215 -0
  572. package/src/notification/notification.js +193 -0
  573. package/src/panel/balloon/balloonpanelview.d.ts +697 -0
  574. package/src/panel/balloon/balloonpanelview.js +1055 -0
  575. package/src/panel/balloon/contextualballoon.d.ts +309 -0
  576. package/src/panel/balloon/contextualballoon.js +576 -0
  577. package/src/panel/sticky/stickypanelview.d.ts +156 -0
  578. package/src/panel/sticky/stickypanelview.js +234 -0
  579. package/src/search/filteredview.d.ts +31 -0
  580. package/src/search/filteredview.js +5 -0
  581. package/src/search/filtergroupanditemnames.d.ts +15 -0
  582. package/src/search/filtergroupanditemnames.js +38 -0
  583. package/src/search/searchinfoview.d.ts +45 -0
  584. package/src/search/searchinfoview.js +59 -0
  585. package/src/search/searchresultsview.d.ts +54 -0
  586. package/src/search/searchresultsview.js +65 -0
  587. package/src/search/text/searchtextqueryview.d.ts +76 -0
  588. package/src/search/text/searchtextqueryview.js +75 -0
  589. package/src/search/text/searchtextview.d.ts +219 -0
  590. package/src/search/text/searchtextview.js +202 -0
  591. package/src/spinner/spinnerview.d.ts +25 -0
  592. package/src/spinner/spinnerview.js +38 -0
  593. package/src/template.d.ts +942 -0
  594. package/src/template.js +1294 -0
  595. package/src/textarea/textareaview.d.ts +104 -0
  596. package/src/textarea/textareaview.js +182 -0
  597. package/src/toolbar/balloon/balloontoolbar.d.ts +126 -0
  598. package/src/toolbar/balloon/balloontoolbar.js +324 -0
  599. package/src/toolbar/block/blockbuttonview.d.ts +35 -0
  600. package/src/toolbar/block/blockbuttonview.js +41 -0
  601. package/src/toolbar/block/blocktoolbar.d.ts +171 -0
  602. package/src/toolbar/block/blocktoolbar.js +492 -0
  603. package/src/toolbar/normalizetoolbarconfig.d.ts +40 -0
  604. package/src/toolbar/normalizetoolbarconfig.js +52 -0
  605. package/src/toolbar/toolbarlinebreakview.d.ts +18 -0
  606. package/src/toolbar/toolbarlinebreakview.js +28 -0
  607. package/src/toolbar/toolbarseparatorview.d.ts +18 -0
  608. package/src/toolbar/toolbarseparatorview.js +28 -0
  609. package/src/toolbar/toolbarview.d.ts +267 -0
  610. package/src/toolbar/toolbarview.js +721 -0
  611. package/src/tooltipmanager.d.ts +188 -0
  612. package/src/tooltipmanager.js +413 -0
  613. package/src/view.d.ts +422 -0
  614. package/src/view.js +396 -0
  615. package/src/viewcollection.d.ts +139 -0
  616. package/src/viewcollection.js +206 -0
  617. package/theme/components/arialiveannouncer/arialiveannouncer.css +14 -0
  618. package/theme/components/autocomplete/autocomplete.css +22 -0
  619. package/theme/components/button/button.css +39 -0
  620. package/theme/components/button/listitembutton.css +48 -0
  621. package/theme/components/button/switchbutton.css +14 -0
  622. package/theme/components/collapsible/collapsible.css +10 -0
  623. package/theme/components/colorgrid/colorgrid.css +8 -0
  624. package/theme/components/colorpicker/colorpicker.css +34 -0
  625. package/theme/components/colorselector/colorselector.css +35 -0
  626. package/theme/components/dialog/dialog.css +39 -0
  627. package/theme/components/dialog/dialogactions.css +11 -0
  628. package/theme/components/dropdown/dropdown.css +95 -0
  629. package/theme/components/dropdown/listdropdown.css +10 -0
  630. package/theme/components/dropdown/menu/dropdownmenu.css +8 -0
  631. package/theme/components/dropdown/menu/dropdownmenubutton.css +9 -0
  632. package/theme/components/dropdown/menu/dropdownmenulistitem.css +10 -0
  633. package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +10 -0
  634. package/theme/components/dropdown/menu/dropdownmenupanel.css +11 -0
  635. package/theme/components/dropdown/splitbutton.css +14 -0
  636. package/theme/components/dropdown/toolbardropdown.css +20 -0
  637. package/theme/components/editorui/accessibilityhelp.css +10 -0
  638. package/theme/components/editorui/editorui.css +10 -0
  639. package/theme/components/formheader/formheader.css +16 -0
  640. package/theme/components/highlightedtext/highlightedtext.css +12 -0
  641. package/theme/components/icon/icon.css +8 -0
  642. package/theme/components/input/input.css +10 -0
  643. package/theme/components/label/label.css +12 -0
  644. package/theme/components/labeledfield/labeledfieldview.css +16 -0
  645. package/theme/components/labeledinput/labeledinput.css +10 -0
  646. package/theme/components/list/list.css +26 -0
  647. package/theme/components/menubar/menubar.css +10 -0
  648. package/theme/components/menubar/menubarmenu.css +9 -0
  649. package/theme/components/menubar/menubarmenubutton.css +11 -0
  650. package/theme/components/menubar/menubarmenulistitem.css +10 -0
  651. package/theme/components/menubar/menubarmenulistitembutton.css +10 -0
  652. package/theme/components/menubar/menubarmenupanel.css +62 -0
  653. package/theme/components/panel/balloonpanel.css +56 -0
  654. package/theme/components/panel/balloonrotator.css +17 -0
  655. package/theme/components/panel/fakepanel.css +23 -0
  656. package/theme/components/panel/stickypanel.css +17 -0
  657. package/theme/components/responsive-form/responsiveform.css +42 -0
  658. package/theme/components/search/search.css +43 -0
  659. package/theme/components/spinner/spinner.css +23 -0
  660. package/theme/components/textarea/textarea.css +10 -0
  661. package/theme/components/toolbar/blocktoolbar.css +9 -0
  662. package/theme/components/toolbar/toolbar.css +58 -0
  663. package/theme/components/tooltip/tooltip.css +12 -0
  664. package/theme/globals/_evaluationbadge.css +50 -0
  665. package/theme/globals/_hidden.css +13 -0
  666. package/theme/globals/_poweredby.css +72 -0
  667. package/theme/globals/_transition.css +12 -0
  668. package/theme/globals/_zindex.css +10 -0
  669. package/theme/globals/globals.css +10 -0
  670. package/theme/icons/accessibility.svg +1 -0
  671. package/theme/icons/color-tile-check.svg +1 -0
  672. package/theme/icons/dropdown-arrow.svg +1 -0
  673. package/theme/icons/project-logo.svg +1 -0
  674. package/theme/mixins/_dir.css +10 -0
  675. package/theme/mixins/_mediacolors.css +20 -0
  676. package/theme/mixins/_rwd.css +10 -0
  677. package/theme/mixins/_unselectable.css +14 -0
@@ -0,0 +1,1055 @@
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
+ * @module ui/panel/balloon/balloonpanelview
7
+ */
8
+ import View from '../../view.js';
9
+ import { getOptimalPosition, global, isRange, toUnit, isVisible, isText, ResizeObserver } from '@ckeditor/ckeditor5-utils';
10
+ import { isElement } from 'lodash-es';
11
+ import '../../../theme/components/panel/balloonpanel.css';
12
+ const toPx = /* #__PURE__ */ toUnit('px');
13
+ // A static balloon panel positioning function that moves the balloon far off the viewport.
14
+ // It is used as a fallback when there is no way to position the balloon using provided
15
+ // positioning functions (see: `getOptimalPosition()`), for instance, when the target the
16
+ // balloon should be attached to gets obscured by scrollable containers or the viewport.
17
+ //
18
+ // It prevents the balloon from being attached to the void and possible degradation of the UX.
19
+ // At the same time, it keeps the balloon physically visible in the DOM so the focus remains
20
+ // uninterrupted.
21
+ const POSITION_OFF_SCREEN = {
22
+ top: -99999,
23
+ left: -99999,
24
+ name: 'arrowless',
25
+ config: {
26
+ withArrow: false
27
+ }
28
+ };
29
+ /**
30
+ * The balloon panel view class.
31
+ *
32
+ * A floating container which can
33
+ * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any
34
+ * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position
35
+ * e.g. when the web page is scrolled.
36
+ *
37
+ * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and
38
+ * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view
39
+ * collection.
40
+ *
41
+ * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}
42
+ * that the balloon can use, automatically switching from one to another when the viewport space becomes
43
+ * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also
44
+ * accept any custom position set provided by the user compatible with the
45
+ * {@link module:utils/dom/position~Options options}.
46
+ *
47
+ * ```ts
48
+ * const panel = new BalloonPanelView( locale );
49
+ * const childView = new ChildView();
50
+ * const positions = BalloonPanelView.defaultPositions;
51
+ *
52
+ * panel.render();
53
+ *
54
+ * // Add a child view to the panel's content collection.
55
+ * panel.content.add( childView );
56
+ *
57
+ * // Start pinning the panel to an element with the "target" id DOM.
58
+ * // The balloon will remain pinned until unpin() is called.
59
+ * panel.pin( {
60
+ * target: document.querySelector( '#target' ),
61
+ * positions: [
62
+ * positions.northArrowSouth,
63
+ * positions.southArrowNorth
64
+ * ]
65
+ * } );
66
+ * ```
67
+ */
68
+ class BalloonPanelView extends View {
69
+ /**
70
+ * @inheritDoc
71
+ */
72
+ constructor(locale) {
73
+ super(locale);
74
+ const bind = this.bindTemplate;
75
+ this.set('top', 0);
76
+ this.set('left', 0);
77
+ this.set('position', 'arrow_nw');
78
+ this.set('isVisible', false);
79
+ this.set('withArrow', true);
80
+ this.set('class', undefined);
81
+ this._pinWhenIsVisibleCallback = null;
82
+ this._resizeObserver = null;
83
+ this.content = this.createCollection();
84
+ this.setTemplate({
85
+ tag: 'div',
86
+ attributes: {
87
+ class: [
88
+ 'ck',
89
+ 'ck-balloon-panel',
90
+ bind.to('position', value => `ck-balloon-panel_${value}`),
91
+ bind.if('isVisible', 'ck-balloon-panel_visible'),
92
+ bind.if('withArrow', 'ck-balloon-panel_with-arrow'),
93
+ bind.to('class')
94
+ ],
95
+ style: {
96
+ top: bind.to('top', toPx),
97
+ left: bind.to('left', toPx)
98
+ }
99
+ },
100
+ children: this.content
101
+ });
102
+ }
103
+ /**
104
+ * @inheritDoc
105
+ */
106
+ destroy() {
107
+ this.hide();
108
+ super.destroy();
109
+ }
110
+ /**
111
+ * Shows the panel.
112
+ *
113
+ * See {@link #isVisible}.
114
+ */
115
+ show() {
116
+ this.isVisible = true;
117
+ }
118
+ /**
119
+ * Hides the panel.
120
+ *
121
+ * See {@link #isVisible}.
122
+ */
123
+ hide() {
124
+ this.isVisible = false;
125
+ }
126
+ /**
127
+ * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a
128
+ * smart positioning heuristics that chooses from available positions to make sure the panel
129
+ * is visible to the user i.e. within the limits of the viewport.
130
+ *
131
+ * This method accepts configuration {@link module:utils/dom/position~Options options}
132
+ * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
133
+ *
134
+ * ```ts
135
+ * const panel = new BalloonPanelView( locale );
136
+ * const positions = BalloonPanelView.defaultPositions;
137
+ *
138
+ * panel.render();
139
+ *
140
+ * // Attach the panel to an element with the "target" id DOM.
141
+ * panel.attachTo( {
142
+ * target: document.querySelector( '#target' ),
143
+ * positions: [
144
+ * positions.northArrowSouth,
145
+ * positions.southArrowNorth
146
+ * ]
147
+ * } );
148
+ * ```
149
+ *
150
+ * **Note**: Attaching the panel will also automatically {@link #show} it.
151
+ *
152
+ * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
153
+ * See the {@link #pin} method for a more permanent positioning strategy.
154
+ *
155
+ * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.
156
+ * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
157
+ * @returns Whether the balloon was shown and successfully attached or not. Attaching can fail if the target
158
+ * provided in the options is invisible (e.g. element detached from DOM).
159
+ */
160
+ attachTo(options) {
161
+ const target = getDomElement(options.target);
162
+ if (target && !isVisible(target)) {
163
+ return false;
164
+ }
165
+ this.show();
166
+ const defaultPositions = BalloonPanelView.defaultPositions;
167
+ const positionOptions = Object.assign({}, {
168
+ element: this.element,
169
+ positions: [
170
+ defaultPositions.southArrowNorth,
171
+ defaultPositions.southArrowNorthMiddleWest,
172
+ defaultPositions.southArrowNorthMiddleEast,
173
+ defaultPositions.southArrowNorthWest,
174
+ defaultPositions.southArrowNorthEast,
175
+ defaultPositions.northArrowSouth,
176
+ defaultPositions.northArrowSouthMiddleWest,
177
+ defaultPositions.northArrowSouthMiddleEast,
178
+ defaultPositions.northArrowSouthWest,
179
+ defaultPositions.northArrowSouthEast,
180
+ defaultPositions.viewportStickyNorth
181
+ ],
182
+ limiter: global.document.body,
183
+ fitInViewport: true
184
+ }, options);
185
+ const optimalPosition = BalloonPanelView._getOptimalPosition(positionOptions) || POSITION_OFF_SCREEN;
186
+ // Usually browsers make some problems with super accurate values like 104.345px
187
+ // so it is better to use int values.
188
+ const left = parseInt(optimalPosition.left);
189
+ const top = parseInt(optimalPosition.top);
190
+ const position = optimalPosition.name;
191
+ const config = optimalPosition.config || {};
192
+ const { withArrow = true } = config;
193
+ this.top = top;
194
+ this.left = left;
195
+ this.position = position;
196
+ this.withArrow = withArrow;
197
+ return true;
198
+ }
199
+ /**
200
+ * Works the same way as the {@link #attachTo} method except that the position of the panel is
201
+ * continuously updated when:
202
+ *
203
+ * * any ancestor of the {@link module:utils/dom/position~Options#target}
204
+ * or {@link module:utils/dom/position~Options#limiter} is scrolled,
205
+ * * the browser window gets resized or scrolled.
206
+ *
207
+ * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
208
+ * and is immune to the changing environment.
209
+ *
210
+ * ```ts
211
+ * const panel = new BalloonPanelView( locale );
212
+ * const positions = BalloonPanelView.defaultPositions;
213
+ *
214
+ * panel.render();
215
+ *
216
+ * // Pin the panel to an element with the "target" id DOM.
217
+ * panel.pin( {
218
+ * target: document.querySelector( '#target' ),
219
+ * positions: [
220
+ * positions.northArrowSouth,
221
+ * positions.southArrowNorth
222
+ * ]
223
+ * } );
224
+ * ```
225
+ *
226
+ * To leave the pinned state, use the {@link #unpin} method.
227
+ *
228
+ * **Note**: Pinning the panel will also automatically {@link #show} it.
229
+ *
230
+ * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.
231
+ * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
232
+ */
233
+ pin(options) {
234
+ this.unpin();
235
+ if (!this._startPinning(options)) {
236
+ return;
237
+ }
238
+ this._pinWhenIsVisibleCallback = () => {
239
+ if (this.isVisible) {
240
+ this._startPinning(options);
241
+ }
242
+ else {
243
+ this._stopPinning();
244
+ }
245
+ };
246
+ // Control the state of the listeners depending on whether the panel is visible
247
+ // or not.
248
+ // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
249
+ this.listenTo(this, 'change:isVisible', this._pinWhenIsVisibleCallback);
250
+ }
251
+ /**
252
+ * Stops pinning the panel, as set up by {@link #pin}.
253
+ */
254
+ unpin() {
255
+ if (this._pinWhenIsVisibleCallback) {
256
+ // Deactivate listeners attached by pin().
257
+ this._stopPinning();
258
+ // Deactivate the panel pin() control logic.
259
+ // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
260
+ this.stopListening(this, 'change:isVisible', this._pinWhenIsVisibleCallback);
261
+ this._pinWhenIsVisibleCallback = null;
262
+ this.hide();
263
+ }
264
+ }
265
+ /**
266
+ * Starts managing the pinned state of the panel. See {@link #pin}.
267
+ *
268
+ * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.
269
+ * @returns Whether the balloon was shown and successfully attached or not. Attaching can fail if the target
270
+ * provided in the options is invisible (e.g. element detached from DOM).
271
+ */
272
+ _startPinning(options) {
273
+ if (!this.attachTo(options)) {
274
+ return false;
275
+ }
276
+ let targetElement = getDomElement(options.target);
277
+ const limiterElement = options.limiter ? getDomElement(options.limiter) : global.document.body;
278
+ // Then we need to listen on scroll event of eny element in the document.
279
+ this.listenTo(global.document, 'scroll', (evt, domEvt) => {
280
+ const scrollTarget = domEvt.target;
281
+ // The position needs to be updated if the positioning target is within the scrolled element.
282
+ const isWithinScrollTarget = targetElement && scrollTarget.contains(targetElement);
283
+ // The position needs to be updated if the positioning limiter is within the scrolled element.
284
+ const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains(limiterElement);
285
+ // The positioning target and/or limiter can be a Rect, object etc..
286
+ // There's no way to optimize the listener then.
287
+ if (isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement) {
288
+ this.attachTo(options);
289
+ }
290
+ }, { useCapture: true });
291
+ // We need to listen on window resize event and update position.
292
+ this.listenTo(global.window, 'resize', () => {
293
+ this.attachTo(options);
294
+ });
295
+ // Hide the panel if the target element is no longer visible.
296
+ if (!this._resizeObserver) {
297
+ // If the target element is a text node, we need to check the parent element.
298
+ // It's because `ResizeObserver` accept only elements, not text nodes.
299
+ if (targetElement && isText(targetElement)) {
300
+ targetElement = targetElement.parentElement;
301
+ }
302
+ if (targetElement) {
303
+ const checkVisibility = () => {
304
+ // If the target element is no longer visible, hide the panel.
305
+ if (!isVisible(targetElement)) {
306
+ this.unpin();
307
+ }
308
+ };
309
+ // Element is being resized to 0x0 after it's parent became hidden,
310
+ // so we need to check size in order to determine if it's visible or not.
311
+ this._resizeObserver = new ResizeObserver(targetElement, checkVisibility);
312
+ }
313
+ }
314
+ return true;
315
+ }
316
+ /**
317
+ * Stops managing the pinned state of the panel. See {@link #pin}.
318
+ */
319
+ _stopPinning() {
320
+ this.stopListening(global.document, 'scroll');
321
+ this.stopListening(global.window, 'resize');
322
+ if (this._resizeObserver) {
323
+ this._resizeObserver.destroy();
324
+ this._resizeObserver = null;
325
+ }
326
+ }
327
+ /**
328
+ * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
329
+ * {@link module:utils/dom/position~PositioningFunction positioning functions} adjusted by the specific offsets.
330
+ *
331
+ * @internal
332
+ * @param options Options to generate positions. If not specified, this helper will simply return
333
+ * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
334
+ * @param options.sideOffset A custom side offset (in pixels) of each position. If
335
+ * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowSideOffset the default value}
336
+ * will be used.
337
+ * @param options.heightOffset A custom height offset (in pixels) of each position. If
338
+ * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHeightOffset the default value}
339
+ * will be used.
340
+ * @param options.stickyVerticalOffset A custom offset (in pixels) of the `viewportStickyNorth` positioning function.
341
+ * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}
342
+ * will be used.
343
+ * @param options.config Additional configuration of the balloon balloon panel view.
344
+ * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more
345
+ * about {@link module:utils/dom/position~PositioningFunction positioning functions}.
346
+ */
347
+ static generatePositions(options = {}) {
348
+ const { sideOffset = BalloonPanelView.arrowSideOffset, heightOffset = BalloonPanelView.arrowHeightOffset, stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset, config } = options;
349
+ return {
350
+ // ------- North west
351
+ northWestArrowSouthWest: (targetRect, balloonRect) => ({
352
+ top: getNorthTop(targetRect, balloonRect),
353
+ left: targetRect.left - sideOffset,
354
+ name: 'arrow_sw',
355
+ ...(config && { config })
356
+ }),
357
+ northWestArrowSouthMiddleWest: (targetRect, balloonRect) => ({
358
+ top: getNorthTop(targetRect, balloonRect),
359
+ left: targetRect.left - (balloonRect.width * .25) - sideOffset,
360
+ name: 'arrow_smw',
361
+ ...(config && { config })
362
+ }),
363
+ northWestArrowSouth: (targetRect, balloonRect) => ({
364
+ top: getNorthTop(targetRect, balloonRect),
365
+ left: targetRect.left - balloonRect.width / 2,
366
+ name: 'arrow_s',
367
+ ...(config && { config })
368
+ }),
369
+ northWestArrowSouthMiddleEast: (targetRect, balloonRect) => ({
370
+ top: getNorthTop(targetRect, balloonRect),
371
+ left: targetRect.left - (balloonRect.width * .75) + sideOffset,
372
+ name: 'arrow_sme',
373
+ ...(config && { config })
374
+ }),
375
+ northWestArrowSouthEast: (targetRect, balloonRect) => ({
376
+ top: getNorthTop(targetRect, balloonRect),
377
+ left: targetRect.left - balloonRect.width + sideOffset,
378
+ name: 'arrow_se',
379
+ ...(config && { config })
380
+ }),
381
+ // ------- North
382
+ northArrowSouthWest: (targetRect, balloonRect) => ({
383
+ top: getNorthTop(targetRect, balloonRect),
384
+ left: targetRect.left + targetRect.width / 2 - sideOffset,
385
+ name: 'arrow_sw',
386
+ ...(config && { config })
387
+ }),
388
+ northArrowSouthMiddleWest: (targetRect, balloonRect) => ({
389
+ top: getNorthTop(targetRect, balloonRect),
390
+ left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .25) - sideOffset,
391
+ name: 'arrow_smw',
392
+ ...(config && { config })
393
+ }),
394
+ northArrowSouth: (targetRect, balloonRect) => ({
395
+ top: getNorthTop(targetRect, balloonRect),
396
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
397
+ name: 'arrow_s',
398
+ ...(config && { config })
399
+ }),
400
+ northArrowSouthMiddleEast: (targetRect, balloonRect) => ({
401
+ top: getNorthTop(targetRect, balloonRect),
402
+ left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .75) + sideOffset,
403
+ name: 'arrow_sme',
404
+ ...(config && { config })
405
+ }),
406
+ northArrowSouthEast: (targetRect, balloonRect) => ({
407
+ top: getNorthTop(targetRect, balloonRect),
408
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,
409
+ name: 'arrow_se',
410
+ ...(config && { config })
411
+ }),
412
+ // ------- North east
413
+ northEastArrowSouthWest: (targetRect, balloonRect) => ({
414
+ top: getNorthTop(targetRect, balloonRect),
415
+ left: targetRect.right - sideOffset,
416
+ name: 'arrow_sw',
417
+ ...(config && { config })
418
+ }),
419
+ northEastArrowSouthMiddleWest: (targetRect, balloonRect) => ({
420
+ top: getNorthTop(targetRect, balloonRect),
421
+ left: targetRect.right - (balloonRect.width * .25) - sideOffset,
422
+ name: 'arrow_smw',
423
+ ...(config && { config })
424
+ }),
425
+ northEastArrowSouth: (targetRect, balloonRect) => ({
426
+ top: getNorthTop(targetRect, balloonRect),
427
+ left: targetRect.right - balloonRect.width / 2,
428
+ name: 'arrow_s',
429
+ ...(config && { config })
430
+ }),
431
+ northEastArrowSouthMiddleEast: (targetRect, balloonRect) => ({
432
+ top: getNorthTop(targetRect, balloonRect),
433
+ left: targetRect.right - (balloonRect.width * .75) + sideOffset,
434
+ name: 'arrow_sme',
435
+ ...(config && { config })
436
+ }),
437
+ northEastArrowSouthEast: (targetRect, balloonRect) => ({
438
+ top: getNorthTop(targetRect, balloonRect),
439
+ left: targetRect.right - balloonRect.width + sideOffset,
440
+ name: 'arrow_se',
441
+ ...(config && { config })
442
+ }),
443
+ // ------- South west
444
+ southWestArrowNorthWest: targetRect => ({
445
+ top: getSouthTop(targetRect),
446
+ left: targetRect.left - sideOffset,
447
+ name: 'arrow_nw',
448
+ ...(config && { config })
449
+ }),
450
+ southWestArrowNorthMiddleWest: (targetRect, balloonRect) => ({
451
+ top: getSouthTop(targetRect),
452
+ left: targetRect.left - (balloonRect.width * .25) - sideOffset,
453
+ name: 'arrow_nmw',
454
+ ...(config && { config })
455
+ }),
456
+ southWestArrowNorth: (targetRect, balloonRect) => ({
457
+ top: getSouthTop(targetRect),
458
+ left: targetRect.left - balloonRect.width / 2,
459
+ name: 'arrow_n',
460
+ ...(config && { config })
461
+ }),
462
+ southWestArrowNorthMiddleEast: (targetRect, balloonRect) => ({
463
+ top: getSouthTop(targetRect),
464
+ left: targetRect.left - (balloonRect.width * .75) + sideOffset,
465
+ name: 'arrow_nme',
466
+ ...(config && { config })
467
+ }),
468
+ southWestArrowNorthEast: (targetRect, balloonRect) => ({
469
+ top: getSouthTop(targetRect),
470
+ left: targetRect.left - balloonRect.width + sideOffset,
471
+ name: 'arrow_ne',
472
+ ...(config && { config })
473
+ }),
474
+ // ------- South
475
+ southArrowNorthWest: targetRect => ({
476
+ top: getSouthTop(targetRect),
477
+ left: targetRect.left + targetRect.width / 2 - sideOffset,
478
+ name: 'arrow_nw',
479
+ ...(config && { config })
480
+ }),
481
+ southArrowNorthMiddleWest: (targetRect, balloonRect) => ({
482
+ top: getSouthTop(targetRect),
483
+ left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.25) - sideOffset,
484
+ name: 'arrow_nmw',
485
+ ...(config && { config })
486
+ }),
487
+ southArrowNorth: (targetRect, balloonRect) => ({
488
+ top: getSouthTop(targetRect),
489
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
490
+ name: 'arrow_n',
491
+ ...(config && { config })
492
+ }),
493
+ southArrowNorthMiddleEast: (targetRect, balloonRect) => ({
494
+ top: getSouthTop(targetRect),
495
+ left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.75) + sideOffset,
496
+ name: 'arrow_nme',
497
+ ...(config && { config })
498
+ }),
499
+ southArrowNorthEast: (targetRect, balloonRect) => ({
500
+ top: getSouthTop(targetRect),
501
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,
502
+ name: 'arrow_ne',
503
+ ...(config && { config })
504
+ }),
505
+ // ------- South east
506
+ southEastArrowNorthWest: targetRect => ({
507
+ top: getSouthTop(targetRect),
508
+ left: targetRect.right - sideOffset,
509
+ name: 'arrow_nw',
510
+ ...(config && { config })
511
+ }),
512
+ southEastArrowNorthMiddleWest: (targetRect, balloonRect) => ({
513
+ top: getSouthTop(targetRect),
514
+ left: targetRect.right - (balloonRect.width * .25) - sideOffset,
515
+ name: 'arrow_nmw',
516
+ ...(config && { config })
517
+ }),
518
+ southEastArrowNorth: (targetRect, balloonRect) => ({
519
+ top: getSouthTop(targetRect),
520
+ left: targetRect.right - balloonRect.width / 2,
521
+ name: 'arrow_n',
522
+ ...(config && { config })
523
+ }),
524
+ southEastArrowNorthMiddleEast: (targetRect, balloonRect) => ({
525
+ top: getSouthTop(targetRect),
526
+ left: targetRect.right - (balloonRect.width * .75) + sideOffset,
527
+ name: 'arrow_nme',
528
+ ...(config && { config })
529
+ }),
530
+ southEastArrowNorthEast: (targetRect, balloonRect) => ({
531
+ top: getSouthTop(targetRect),
532
+ left: targetRect.right - balloonRect.width + sideOffset,
533
+ name: 'arrow_ne',
534
+ ...(config && { config })
535
+ }),
536
+ // ------- West
537
+ westArrowEast: (targetRect, balloonRect) => ({
538
+ top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,
539
+ left: targetRect.left - balloonRect.width - heightOffset,
540
+ name: 'arrow_e',
541
+ ...(config && { config })
542
+ }),
543
+ // ------- East
544
+ eastArrowWest: (targetRect, balloonRect) => ({
545
+ top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,
546
+ left: targetRect.right + heightOffset,
547
+ name: 'arrow_w',
548
+ ...(config && { config })
549
+ }),
550
+ // ------- Sticky
551
+ viewportStickyNorth: (targetRect, balloonRect, viewportRect, limiterRect) => {
552
+ const boundaryRect = limiterRect || viewportRect;
553
+ if (!targetRect.getIntersection(boundaryRect)) {
554
+ return null;
555
+ }
556
+ // Engage when the target top and bottom edges are close or off the boundary.
557
+ // By close, it means there's not enough space for the balloon arrow (offset).
558
+ if (boundaryRect.height - targetRect.height > stickyVerticalOffset) {
559
+ return null;
560
+ }
561
+ return {
562
+ top: boundaryRect.top + stickyVerticalOffset,
563
+ left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
564
+ name: 'arrowless',
565
+ config: {
566
+ withArrow: false,
567
+ ...config
568
+ }
569
+ };
570
+ }
571
+ };
572
+ /**
573
+ * Returns the top coordinate for positions starting with `north*`.
574
+ *
575
+ * @param targetRect A rect of the target.
576
+ * @param balloonRect A rect of the balloon.
577
+ */
578
+ function getNorthTop(targetRect, balloonRect) {
579
+ return targetRect.top - balloonRect.height - heightOffset;
580
+ }
581
+ /**
582
+ * Returns the top coordinate for positions starting with `south*`.
583
+ *
584
+ * @param targetRect A rect of the target.
585
+ */
586
+ function getSouthTop(targetRect) {
587
+ return targetRect.bottom + heightOffset;
588
+ }
589
+ }
590
+ }
591
+ /**
592
+ * A side offset of the arrow tip from the edge of the balloon. Controlled by CSS.
593
+ *
594
+ * ```
595
+ * ┌───────────────────────┐
596
+ * │ │
597
+ * │ Balloon │
598
+ * │ Content │
599
+ * │ │
600
+ * └──+ +───────────────┘
601
+ * | \ /
602
+ * | \/
603
+ * >┼─────┼< ─────────────────────── side offset
604
+ *
605
+ * ```
606
+ *
607
+ * @default 25
608
+ */
609
+ BalloonPanelView.arrowSideOffset = 25;
610
+ /**
611
+ * A height offset of the arrow from the edge of the balloon. Controlled by CSS.
612
+ *
613
+ * ```
614
+ * ┌───────────────────────┐
615
+ * │ │
616
+ * │ Balloon │
617
+ * │ Content │ ╱-- arrow height offset
618
+ * │ │ V
619
+ * └──+ +───────────────┘ --- ─┼───────
620
+ * \ / │
621
+ * \/ │
622
+ * ────────────────────────────────┼───────
623
+ * ^
624
+ *
625
+ *
626
+ * >┼────┼< arrow height offset
627
+ * │ │
628
+ * │ ┌────────────────────────┐
629
+ * │ │ │
630
+ * │ ╱ │
631
+ * │ ╱ Balloon │
632
+ * │ ╲ Content │
633
+ * │ ╲ │
634
+ * │ │ │
635
+ * │ └────────────────────────┘
636
+ * ```
637
+ *
638
+ * @default 10
639
+ */
640
+ BalloonPanelView.arrowHeightOffset = 10;
641
+ /**
642
+ * A vertical offset of the balloon panel from the edge of the viewport if sticky.
643
+ * It helps in accessing toolbar buttons underneath the balloon panel.
644
+ *
645
+ * ```
646
+ * ┌───────────────────────────────────────────────────┐
647
+ * │ Target │
648
+ * │ │
649
+ * │ /── vertical offset │
650
+ * ┌─────────────────────────────V─────────────────────────┐
651
+ * │ Toolbar ┌─────────────┐ │
652
+ * ├────────────────────│ Balloon │────────────────────┤
653
+ * │ │ └─────────────┘ │ │
654
+ * │ │ │ │
655
+ * │ │ │ │
656
+ * │ │ │ │
657
+ * │ └───────────────────────────────────────────────────┘ │
658
+ * │ Viewport │
659
+ * └───────────────────────────────────────────────────────┘
660
+ * ```
661
+ *
662
+ * @default 20
663
+ */
664
+ BalloonPanelView.stickyVerticalOffset = 20;
665
+ /**
666
+ * Function used to calculate the optimal position for the balloon.
667
+ */
668
+ BalloonPanelView._getOptimalPosition = getOptimalPosition;
669
+ /**
670
+ * A default set of positioning functions used by the balloon panel view
671
+ * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
672
+ *
673
+ * The available positioning functions are as follows:
674
+ *
675
+ * **North west**
676
+ *
677
+ * * `northWestArrowSouthWest`
678
+ *
679
+ * ```
680
+ * +-----------------+
681
+ * | Balloon |
682
+ * +-----------------+
683
+ * V
684
+ * [ Target ]
685
+ * ```
686
+ *
687
+ * * `northWestArrowSouthMiddleWest`
688
+ *
689
+ * ```
690
+ * +-----------------+
691
+ * | Balloon |
692
+ * +-----------------+
693
+ * V
694
+ * [ Target ]
695
+ * ```
696
+ *
697
+ * * `northWestArrowSouth`
698
+ *
699
+ * ```
700
+ * +-----------------+
701
+ * | Balloon |
702
+ * +-----------------+
703
+ * V
704
+ * [ Target ]
705
+ * ```
706
+ *
707
+ * * `northWestArrowSouthMiddleEast`
708
+ *
709
+ * ```
710
+ * +-----------------+
711
+ * | Balloon |
712
+ * +-----------------+
713
+ * V
714
+ * [ Target ]
715
+ * ```
716
+ *
717
+ * * `northWestArrowSouthEast`
718
+ *
719
+ * ```
720
+ * +-----------------+
721
+ * | Balloon |
722
+ * +-----------------+
723
+ * V
724
+ * [ Target ]
725
+ * ```
726
+ *
727
+ * **North**
728
+ *
729
+ * * `northArrowSouthWest`
730
+ *
731
+ * ```
732
+ * +-----------------+
733
+ * | Balloon |
734
+ * +-----------------+
735
+ * V
736
+ * [ Target ]
737
+ * ```
738
+ *
739
+ * * `northArrowSouthMiddleWest`
740
+ *
741
+ * ```
742
+ * +-----------------+
743
+ * | Balloon |
744
+ * +-----------------+
745
+ * V
746
+ * [ Target ]
747
+ * ```
748
+ * * `northArrowSouth`
749
+ *
750
+ * ```
751
+ * +-----------------+
752
+ * | Balloon |
753
+ * +-----------------+
754
+ * V
755
+ * [ Target ]
756
+ * ```
757
+ *
758
+ * * `northArrowSouthMiddleEast`
759
+ *
760
+ * ```
761
+ * +-----------------+
762
+ * | Balloon |
763
+ * +-----------------+
764
+ * V
765
+ * [ Target ]
766
+ * ```
767
+ *
768
+ * * `northArrowSouthEast`
769
+ *
770
+ * ```
771
+ * +-----------------+
772
+ * | Balloon |
773
+ * +-----------------+
774
+ * V
775
+ * [ Target ]
776
+ * ```
777
+ *
778
+ * **North east**
779
+ *
780
+ * * `northEastArrowSouthWest`
781
+ *
782
+ * ```
783
+ * +-----------------+
784
+ * | Balloon |
785
+ * +-----------------+
786
+ * V
787
+ * [ Target ]
788
+ * ```
789
+ *
790
+ * * `northEastArrowSouthMiddleWest`
791
+ *
792
+ * ```
793
+ * +-----------------+
794
+ * | Balloon |
795
+ * +-----------------+
796
+ * V
797
+ * [ Target ]
798
+ * ```
799
+ *
800
+ * * `northEastArrowSouth`
801
+ *
802
+ * ```
803
+ * +-----------------+
804
+ * | Balloon |
805
+ * +-----------------+
806
+ * V
807
+ * [ Target ]
808
+ * ```
809
+ *
810
+ * * `northEastArrowSouthMiddleEast`
811
+ *
812
+ * ```
813
+ * +-----------------+
814
+ * | Balloon |
815
+ * +-----------------+
816
+ * V
817
+ * [ Target ]
818
+ * ```
819
+ *
820
+ * * `northEastArrowSouthEast`
821
+ *
822
+ * ```
823
+ * +-----------------+
824
+ * | Balloon |
825
+ * +-----------------+
826
+ * V
827
+ * [ Target ]
828
+ * ```
829
+ *
830
+ * **South**
831
+ *
832
+ * * `southArrowNorthWest`
833
+ *
834
+ * ```
835
+ * [ Target ]
836
+ * ^
837
+ * +-----------------+
838
+ * | Balloon |
839
+ * +-----------------+
840
+ * ```
841
+ *
842
+ * * `southArrowNorthMiddleWest`
843
+ *
844
+ * ```
845
+ * [ Target ]
846
+ * ^
847
+ * +-----------------+
848
+ * | Balloon |
849
+ * +-----------------+
850
+ * ```
851
+ *
852
+ * * `southArrowNorth`
853
+ *
854
+ * ```
855
+ * [ Target ]
856
+ * ^
857
+ * +-----------------+
858
+ * | Balloon |
859
+ * +-----------------+
860
+ * ```
861
+ *
862
+ * * `southArrowNorthMiddleEast`
863
+ *
864
+ * ```
865
+ * [ Target ]
866
+ * ^
867
+ * +-----------------+
868
+ * | Balloon |
869
+ * +-----------------+
870
+ * ```
871
+ *
872
+ * * `southArrowNorthEast`
873
+ *
874
+ * ```
875
+ * [ Target ]
876
+ * ^
877
+ * +-----------------+
878
+ * | Balloon |
879
+ * +-----------------+
880
+ * ```
881
+ *
882
+ * **South west**
883
+ *
884
+ * * `southWestArrowNorthWest`
885
+ *
886
+ *
887
+ * ```
888
+ * [ Target ]
889
+ * ^
890
+ * +-----------------+
891
+ * | Balloon |
892
+ * +-----------------+
893
+ * ```
894
+ *
895
+ * * `southWestArrowNorthMiddleWest`
896
+ *
897
+ * ```
898
+ * [ Target ]
899
+ * ^
900
+ * +-----------------+
901
+ * | Balloon |
902
+ * +-----------------+
903
+ * ```
904
+ *
905
+ * * `southWestArrowNorth`
906
+ *
907
+ * ```
908
+ * [ Target ]
909
+ * ^
910
+ * +-----------------+
911
+ * | Balloon |
912
+ * +-----------------+
913
+ * ```
914
+ *
915
+ * * `southWestArrowNorthMiddleEast`
916
+ *
917
+ * ```
918
+ * [ Target ]
919
+ * ^
920
+ * +-----------------+
921
+ * | Balloon |
922
+ * +-----------------+
923
+ * ```
924
+ *
925
+ * * `southWestArrowNorthEast`
926
+ *
927
+ * ```
928
+ * [ Target ]
929
+ * ^
930
+ * +-----------------+
931
+ * | Balloon |
932
+ * +-----------------+
933
+ * ```
934
+ *
935
+ * **South east**
936
+ *
937
+ * * `southEastArrowNorthWest`
938
+ *
939
+ * ```
940
+ * [ Target ]
941
+ * ^
942
+ * +-----------------+
943
+ * | Balloon |
944
+ * +-----------------+
945
+ * ```
946
+ *
947
+ * * `southEastArrowNorthMiddleWest`
948
+ *
949
+ * ```
950
+ * [ Target ]
951
+ * ^
952
+ * +-----------------+
953
+ * | Balloon |
954
+ * +-----------------+
955
+ * ```
956
+ *
957
+ * * `southEastArrowNorth`
958
+ *
959
+ * ```
960
+ * [ Target ]
961
+ * ^
962
+ * +-----------------+
963
+ * | Balloon |
964
+ * +-----------------+
965
+ * ```
966
+ *
967
+ * * `southEastArrowNorthMiddleEast`
968
+ *
969
+ * ```
970
+ * [ Target ]
971
+ * ^
972
+ * +-----------------+
973
+ * | Balloon |
974
+ * +-----------------+
975
+ * ```
976
+ *
977
+ * * `southEastArrowNorthEast`
978
+ *
979
+ * ```
980
+ * [ Target ]
981
+ * ^
982
+ * +-----------------+
983
+ * | Balloon |
984
+ * +-----------------+
985
+ * ```
986
+ *
987
+ * **West**
988
+ *
989
+ * * `westArrowEast`
990
+ *
991
+ * ```
992
+ * +-----------------+
993
+ * | Balloon |>[ Target ]
994
+ * +-----------------+
995
+ * ```
996
+ *
997
+ * **East**
998
+ *
999
+ * * `eastArrowWest`
1000
+ *
1001
+ * ```
1002
+ * +-----------------+
1003
+ * [ Target ]<| Balloon |
1004
+ * +-----------------+
1005
+ * ```
1006
+ *
1007
+ * **Sticky**
1008
+ *
1009
+ * * `viewportStickyNorth`
1010
+ *
1011
+ * ```
1012
+ * +---------------------------+
1013
+ * | [ Target ] |
1014
+ * | |
1015
+ * +-----------------------------------+
1016
+ * | | +-----------------+ | |
1017
+ * | | | Balloon | | |
1018
+ * | | +-----------------+ | |
1019
+ * | | | |
1020
+ * | | | |
1021
+ * | | | |
1022
+ * | | | |
1023
+ * | +---------------------------+ |
1024
+ * | Viewport |
1025
+ * +-----------------------------------+
1026
+ * ```
1027
+ *
1028
+ * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
1029
+ *
1030
+ * Positioning functions must be compatible with {@link module:utils/dom/position~DomPoint}.
1031
+ *
1032
+ * Default positioning functions with customized offsets can be generated using
1033
+ * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.generatePositions}.
1034
+ *
1035
+ * The name that the position function returns will be reflected in the balloon panel's class that
1036
+ * controls the placement of the "arrow". See {@link #position} to learn more.
1037
+ */
1038
+ BalloonPanelView.defaultPositions = BalloonPanelView.generatePositions();
1039
+ export default BalloonPanelView;
1040
+ /**
1041
+ * Returns the DOM element for given object or null, if there is none,
1042
+ * e.g. when the passed object is a Rect instance or so.
1043
+ */
1044
+ function getDomElement(object) {
1045
+ if (isElement(object)) {
1046
+ return object;
1047
+ }
1048
+ if (isRange(object)) {
1049
+ return object.commonAncestorContainer;
1050
+ }
1051
+ if (typeof object == 'function') {
1052
+ return getDomElement(object());
1053
+ }
1054
+ return null;
1055
+ }