@ckeditor/ckeditor5-emoji 0.0.1 → 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 (402) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +15 -5
  3. package/README.md +30 -3
  4. package/build/emoji.js +5 -0
  5. package/build/translations/af.js +1 -0
  6. package/build/translations/ar.js +1 -0
  7. package/build/translations/ast.js +1 -0
  8. package/build/translations/az.js +1 -0
  9. package/build/translations/bg.js +1 -0
  10. package/build/translations/bn.js +1 -0
  11. package/build/translations/bs.js +1 -0
  12. package/build/translations/ca.js +1 -0
  13. package/build/translations/cs.js +1 -0
  14. package/build/translations/da.js +1 -0
  15. package/build/translations/de-ch.js +1 -0
  16. package/build/translations/de.js +1 -0
  17. package/build/translations/el.js +1 -0
  18. package/build/translations/en-au.js +1 -0
  19. package/build/translations/en-gb.js +1 -0
  20. package/build/translations/eo.js +1 -0
  21. package/build/translations/es-co.js +1 -0
  22. package/build/translations/es.js +1 -0
  23. package/build/translations/et.js +1 -0
  24. package/build/translations/eu.js +1 -0
  25. package/build/translations/fa.js +1 -0
  26. package/build/translations/fi.js +1 -0
  27. package/build/translations/fr.js +1 -0
  28. package/build/translations/gl.js +1 -0
  29. package/build/translations/gu.js +1 -0
  30. package/build/translations/he.js +1 -0
  31. package/build/translations/hi.js +1 -0
  32. package/build/translations/hr.js +1 -0
  33. package/build/translations/hu.js +1 -0
  34. package/build/translations/hy.js +1 -0
  35. package/build/translations/id.js +1 -0
  36. package/build/translations/it.js +1 -0
  37. package/build/translations/ja.js +1 -0
  38. package/build/translations/jv.js +1 -0
  39. package/build/translations/kk.js +1 -0
  40. package/build/translations/km.js +1 -0
  41. package/build/translations/kn.js +1 -0
  42. package/build/translations/ko.js +1 -0
  43. package/build/translations/ku.js +1 -0
  44. package/build/translations/lt.js +1 -0
  45. package/build/translations/lv.js +1 -0
  46. package/build/translations/ms.js +1 -0
  47. package/build/translations/nb.js +1 -0
  48. package/build/translations/ne.js +1 -0
  49. package/build/translations/nl.js +1 -0
  50. package/build/translations/no.js +1 -0
  51. package/build/translations/oc.js +1 -0
  52. package/build/translations/pl.js +1 -0
  53. package/build/translations/pt-br.js +1 -0
  54. package/build/translations/pt.js +1 -0
  55. package/build/translations/ro.js +1 -0
  56. package/build/translations/ru.js +1 -0
  57. package/build/translations/si.js +1 -0
  58. package/build/translations/sk.js +1 -0
  59. package/build/translations/sl.js +1 -0
  60. package/build/translations/sq.js +1 -0
  61. package/build/translations/sr-latn.js +1 -0
  62. package/build/translations/sr.js +1 -0
  63. package/build/translations/sv.js +1 -0
  64. package/build/translations/th.js +1 -0
  65. package/build/translations/ti.js +1 -0
  66. package/build/translations/tk.js +1 -0
  67. package/build/translations/tr.js +1 -0
  68. package/build/translations/tt.js +1 -0
  69. package/build/translations/ug.js +1 -0
  70. package/build/translations/uk.js +1 -0
  71. package/build/translations/ur.js +1 -0
  72. package/build/translations/uz.js +1 -0
  73. package/build/translations/vi.js +1 -0
  74. package/build/translations/zh-cn.js +1 -0
  75. package/build/translations/zh.js +1 -0
  76. package/ckeditor5-metadata.json +32 -0
  77. package/dist/index-content.css +4 -0
  78. package/dist/index-editor.css +111 -0
  79. package/dist/index.css +143 -0
  80. package/dist/index.css.map +1 -0
  81. package/dist/index.js +1477 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/translations/af.d.ts +8 -0
  84. package/dist/translations/af.js +5 -0
  85. package/dist/translations/af.umd.js +11 -0
  86. package/dist/translations/ar.d.ts +8 -0
  87. package/dist/translations/ar.js +5 -0
  88. package/dist/translations/ar.umd.js +11 -0
  89. package/dist/translations/ast.d.ts +8 -0
  90. package/dist/translations/ast.js +5 -0
  91. package/dist/translations/ast.umd.js +11 -0
  92. package/dist/translations/az.d.ts +8 -0
  93. package/dist/translations/az.js +5 -0
  94. package/dist/translations/az.umd.js +11 -0
  95. package/dist/translations/bg.d.ts +8 -0
  96. package/dist/translations/bg.js +5 -0
  97. package/dist/translations/bg.umd.js +11 -0
  98. package/dist/translations/bn.d.ts +8 -0
  99. package/dist/translations/bn.js +5 -0
  100. package/dist/translations/bn.umd.js +11 -0
  101. package/dist/translations/bs.d.ts +8 -0
  102. package/dist/translations/bs.js +5 -0
  103. package/dist/translations/bs.umd.js +11 -0
  104. package/dist/translations/ca.d.ts +8 -0
  105. package/dist/translations/ca.js +5 -0
  106. package/dist/translations/ca.umd.js +11 -0
  107. package/dist/translations/cs.d.ts +8 -0
  108. package/dist/translations/cs.js +5 -0
  109. package/dist/translations/cs.umd.js +11 -0
  110. package/dist/translations/da.d.ts +8 -0
  111. package/dist/translations/da.js +5 -0
  112. package/dist/translations/da.umd.js +11 -0
  113. package/dist/translations/de-ch.d.ts +8 -0
  114. package/dist/translations/de-ch.js +5 -0
  115. package/dist/translations/de-ch.umd.js +11 -0
  116. package/dist/translations/de.d.ts +8 -0
  117. package/dist/translations/de.js +5 -0
  118. package/dist/translations/de.umd.js +11 -0
  119. package/dist/translations/el.d.ts +8 -0
  120. package/dist/translations/el.js +5 -0
  121. package/dist/translations/el.umd.js +11 -0
  122. package/dist/translations/en-au.d.ts +8 -0
  123. package/dist/translations/en-au.js +5 -0
  124. package/dist/translations/en-au.umd.js +11 -0
  125. package/dist/translations/en-gb.d.ts +8 -0
  126. package/dist/translations/en-gb.js +5 -0
  127. package/dist/translations/en-gb.umd.js +11 -0
  128. package/dist/translations/en.d.ts +8 -0
  129. package/dist/translations/en.js +5 -0
  130. package/dist/translations/en.umd.js +11 -0
  131. package/dist/translations/eo.d.ts +8 -0
  132. package/dist/translations/eo.js +5 -0
  133. package/dist/translations/eo.umd.js +11 -0
  134. package/dist/translations/es-co.d.ts +8 -0
  135. package/dist/translations/es-co.js +5 -0
  136. package/dist/translations/es-co.umd.js +11 -0
  137. package/dist/translations/es.d.ts +8 -0
  138. package/dist/translations/es.js +5 -0
  139. package/dist/translations/es.umd.js +11 -0
  140. package/dist/translations/et.d.ts +8 -0
  141. package/dist/translations/et.js +5 -0
  142. package/dist/translations/et.umd.js +11 -0
  143. package/dist/translations/eu.d.ts +8 -0
  144. package/dist/translations/eu.js +5 -0
  145. package/dist/translations/eu.umd.js +11 -0
  146. package/dist/translations/fa.d.ts +8 -0
  147. package/dist/translations/fa.js +5 -0
  148. package/dist/translations/fa.umd.js +11 -0
  149. package/dist/translations/fi.d.ts +8 -0
  150. package/dist/translations/fi.js +5 -0
  151. package/dist/translations/fi.umd.js +11 -0
  152. package/dist/translations/fr.d.ts +8 -0
  153. package/dist/translations/fr.js +5 -0
  154. package/dist/translations/fr.umd.js +11 -0
  155. package/dist/translations/gl.d.ts +8 -0
  156. package/dist/translations/gl.js +5 -0
  157. package/dist/translations/gl.umd.js +11 -0
  158. package/dist/translations/gu.d.ts +8 -0
  159. package/dist/translations/gu.js +5 -0
  160. package/dist/translations/gu.umd.js +11 -0
  161. package/dist/translations/he.d.ts +8 -0
  162. package/dist/translations/he.js +5 -0
  163. package/dist/translations/he.umd.js +11 -0
  164. package/dist/translations/hi.d.ts +8 -0
  165. package/dist/translations/hi.js +5 -0
  166. package/dist/translations/hi.umd.js +11 -0
  167. package/dist/translations/hr.d.ts +8 -0
  168. package/dist/translations/hr.js +5 -0
  169. package/dist/translations/hr.umd.js +11 -0
  170. package/dist/translations/hu.d.ts +8 -0
  171. package/dist/translations/hu.js +5 -0
  172. package/dist/translations/hu.umd.js +11 -0
  173. package/dist/translations/hy.d.ts +8 -0
  174. package/dist/translations/hy.js +5 -0
  175. package/dist/translations/hy.umd.js +11 -0
  176. package/dist/translations/id.d.ts +8 -0
  177. package/dist/translations/id.js +5 -0
  178. package/dist/translations/id.umd.js +11 -0
  179. package/dist/translations/it.d.ts +8 -0
  180. package/dist/translations/it.js +5 -0
  181. package/dist/translations/it.umd.js +11 -0
  182. package/dist/translations/ja.d.ts +8 -0
  183. package/dist/translations/ja.js +5 -0
  184. package/dist/translations/ja.umd.js +11 -0
  185. package/dist/translations/jv.d.ts +8 -0
  186. package/dist/translations/jv.js +5 -0
  187. package/dist/translations/jv.umd.js +11 -0
  188. package/dist/translations/kk.d.ts +8 -0
  189. package/dist/translations/kk.js +5 -0
  190. package/dist/translations/kk.umd.js +11 -0
  191. package/dist/translations/km.d.ts +8 -0
  192. package/dist/translations/km.js +5 -0
  193. package/dist/translations/km.umd.js +11 -0
  194. package/dist/translations/kn.d.ts +8 -0
  195. package/dist/translations/kn.js +5 -0
  196. package/dist/translations/kn.umd.js +11 -0
  197. package/dist/translations/ko.d.ts +8 -0
  198. package/dist/translations/ko.js +5 -0
  199. package/dist/translations/ko.umd.js +11 -0
  200. package/dist/translations/ku.d.ts +8 -0
  201. package/dist/translations/ku.js +5 -0
  202. package/dist/translations/ku.umd.js +11 -0
  203. package/dist/translations/lt.d.ts +8 -0
  204. package/dist/translations/lt.js +5 -0
  205. package/dist/translations/lt.umd.js +11 -0
  206. package/dist/translations/lv.d.ts +8 -0
  207. package/dist/translations/lv.js +5 -0
  208. package/dist/translations/lv.umd.js +11 -0
  209. package/dist/translations/ms.d.ts +8 -0
  210. package/dist/translations/ms.js +5 -0
  211. package/dist/translations/ms.umd.js +11 -0
  212. package/dist/translations/nb.d.ts +8 -0
  213. package/dist/translations/nb.js +5 -0
  214. package/dist/translations/nb.umd.js +11 -0
  215. package/dist/translations/ne.d.ts +8 -0
  216. package/dist/translations/ne.js +5 -0
  217. package/dist/translations/ne.umd.js +11 -0
  218. package/dist/translations/nl.d.ts +8 -0
  219. package/dist/translations/nl.js +5 -0
  220. package/dist/translations/nl.umd.js +11 -0
  221. package/dist/translations/no.d.ts +8 -0
  222. package/dist/translations/no.js +5 -0
  223. package/dist/translations/no.umd.js +11 -0
  224. package/dist/translations/oc.d.ts +8 -0
  225. package/dist/translations/oc.js +5 -0
  226. package/dist/translations/oc.umd.js +11 -0
  227. package/dist/translations/pl.d.ts +8 -0
  228. package/dist/translations/pl.js +5 -0
  229. package/dist/translations/pl.umd.js +11 -0
  230. package/dist/translations/pt-br.d.ts +8 -0
  231. package/dist/translations/pt-br.js +5 -0
  232. package/dist/translations/pt-br.umd.js +11 -0
  233. package/dist/translations/pt.d.ts +8 -0
  234. package/dist/translations/pt.js +5 -0
  235. package/dist/translations/pt.umd.js +11 -0
  236. package/dist/translations/ro.d.ts +8 -0
  237. package/dist/translations/ro.js +5 -0
  238. package/dist/translations/ro.umd.js +11 -0
  239. package/dist/translations/ru.d.ts +8 -0
  240. package/dist/translations/ru.js +5 -0
  241. package/dist/translations/ru.umd.js +11 -0
  242. package/dist/translations/si.d.ts +8 -0
  243. package/dist/translations/si.js +5 -0
  244. package/dist/translations/si.umd.js +11 -0
  245. package/dist/translations/sk.d.ts +8 -0
  246. package/dist/translations/sk.js +5 -0
  247. package/dist/translations/sk.umd.js +11 -0
  248. package/dist/translations/sl.d.ts +8 -0
  249. package/dist/translations/sl.js +5 -0
  250. package/dist/translations/sl.umd.js +11 -0
  251. package/dist/translations/sq.d.ts +8 -0
  252. package/dist/translations/sq.js +5 -0
  253. package/dist/translations/sq.umd.js +11 -0
  254. package/dist/translations/sr-latn.d.ts +8 -0
  255. package/dist/translations/sr-latn.js +5 -0
  256. package/dist/translations/sr-latn.umd.js +11 -0
  257. package/dist/translations/sr.d.ts +8 -0
  258. package/dist/translations/sr.js +5 -0
  259. package/dist/translations/sr.umd.js +11 -0
  260. package/dist/translations/sv.d.ts +8 -0
  261. package/dist/translations/sv.js +5 -0
  262. package/dist/translations/sv.umd.js +11 -0
  263. package/dist/translations/th.d.ts +8 -0
  264. package/dist/translations/th.js +5 -0
  265. package/dist/translations/th.umd.js +11 -0
  266. package/dist/translations/ti.d.ts +8 -0
  267. package/dist/translations/ti.js +5 -0
  268. package/dist/translations/ti.umd.js +11 -0
  269. package/dist/translations/tk.d.ts +8 -0
  270. package/dist/translations/tk.js +5 -0
  271. package/dist/translations/tk.umd.js +11 -0
  272. package/dist/translations/tr.d.ts +8 -0
  273. package/dist/translations/tr.js +5 -0
  274. package/dist/translations/tr.umd.js +11 -0
  275. package/dist/translations/tt.d.ts +8 -0
  276. package/dist/translations/tt.js +5 -0
  277. package/dist/translations/tt.umd.js +11 -0
  278. package/dist/translations/ug.d.ts +8 -0
  279. package/dist/translations/ug.js +5 -0
  280. package/dist/translations/ug.umd.js +11 -0
  281. package/dist/translations/uk.d.ts +8 -0
  282. package/dist/translations/uk.js +5 -0
  283. package/dist/translations/uk.umd.js +11 -0
  284. package/dist/translations/ur.d.ts +8 -0
  285. package/dist/translations/ur.js +5 -0
  286. package/dist/translations/ur.umd.js +11 -0
  287. package/dist/translations/uz.d.ts +8 -0
  288. package/dist/translations/uz.js +5 -0
  289. package/dist/translations/uz.umd.js +11 -0
  290. package/dist/translations/vi.d.ts +8 -0
  291. package/dist/translations/vi.js +5 -0
  292. package/dist/translations/vi.umd.js +11 -0
  293. package/dist/translations/zh-cn.d.ts +8 -0
  294. package/dist/translations/zh-cn.js +5 -0
  295. package/dist/translations/zh-cn.umd.js +11 -0
  296. package/dist/translations/zh.d.ts +8 -0
  297. package/dist/translations/zh.js +5 -0
  298. package/dist/translations/zh.umd.js +11 -0
  299. package/lang/contexts.json +24 -0
  300. package/lang/translations/af.po +100 -0
  301. package/lang/translations/ar.po +100 -0
  302. package/lang/translations/ast.po +100 -0
  303. package/lang/translations/az.po +100 -0
  304. package/lang/translations/bg.po +100 -0
  305. package/lang/translations/bn.po +100 -0
  306. package/lang/translations/bs.po +100 -0
  307. package/lang/translations/ca.po +100 -0
  308. package/lang/translations/cs.po +100 -0
  309. package/lang/translations/da.po +100 -0
  310. package/lang/translations/de-ch.po +100 -0
  311. package/lang/translations/de.po +100 -0
  312. package/lang/translations/el.po +100 -0
  313. package/lang/translations/en-au.po +100 -0
  314. package/lang/translations/en-gb.po +100 -0
  315. package/lang/translations/en.po +100 -0
  316. package/lang/translations/eo.po +100 -0
  317. package/lang/translations/es-co.po +100 -0
  318. package/lang/translations/es.po +100 -0
  319. package/lang/translations/et.po +100 -0
  320. package/lang/translations/eu.po +100 -0
  321. package/lang/translations/fa.po +100 -0
  322. package/lang/translations/fi.po +100 -0
  323. package/lang/translations/fr.po +100 -0
  324. package/lang/translations/gl.po +100 -0
  325. package/lang/translations/gu.po +100 -0
  326. package/lang/translations/he.po +100 -0
  327. package/lang/translations/hi.po +100 -0
  328. package/lang/translations/hr.po +100 -0
  329. package/lang/translations/hu.po +100 -0
  330. package/lang/translations/hy.po +100 -0
  331. package/lang/translations/id.po +100 -0
  332. package/lang/translations/it.po +100 -0
  333. package/lang/translations/ja.po +100 -0
  334. package/lang/translations/jv.po +100 -0
  335. package/lang/translations/kk.po +100 -0
  336. package/lang/translations/km.po +100 -0
  337. package/lang/translations/kn.po +100 -0
  338. package/lang/translations/ko.po +100 -0
  339. package/lang/translations/ku.po +100 -0
  340. package/lang/translations/lt.po +100 -0
  341. package/lang/translations/lv.po +100 -0
  342. package/lang/translations/ms.po +100 -0
  343. package/lang/translations/nb.po +100 -0
  344. package/lang/translations/ne.po +100 -0
  345. package/lang/translations/nl.po +100 -0
  346. package/lang/translations/no.po +100 -0
  347. package/lang/translations/oc.po +100 -0
  348. package/lang/translations/pl.po +100 -0
  349. package/lang/translations/pt-br.po +100 -0
  350. package/lang/translations/pt.po +100 -0
  351. package/lang/translations/ro.po +100 -0
  352. package/lang/translations/ru.po +100 -0
  353. package/lang/translations/si.po +100 -0
  354. package/lang/translations/sk.po +100 -0
  355. package/lang/translations/sl.po +100 -0
  356. package/lang/translations/sq.po +100 -0
  357. package/lang/translations/sr-latn.po +100 -0
  358. package/lang/translations/sr.po +100 -0
  359. package/lang/translations/sv.po +100 -0
  360. package/lang/translations/th.po +100 -0
  361. package/lang/translations/ti.po +100 -0
  362. package/lang/translations/tk.po +100 -0
  363. package/lang/translations/tr.po +100 -0
  364. package/lang/translations/tt.po +100 -0
  365. package/lang/translations/ug.po +100 -0
  366. package/lang/translations/uk.po +100 -0
  367. package/lang/translations/ur.po +100 -0
  368. package/lang/translations/uz.po +100 -0
  369. package/lang/translations/vi.po +100 -0
  370. package/lang/translations/zh-cn.po +100 -0
  371. package/lang/translations/zh.po +100 -0
  372. package/package.json +58 -5
  373. package/src/augmentation.d.ts +24 -0
  374. package/src/augmentation.js +5 -0
  375. package/src/emoji.d.ts +32 -0
  376. package/src/emoji.js +38 -0
  377. package/src/emojicommand.d.ts +24 -0
  378. package/src/emojicommand.js +33 -0
  379. package/src/emojiconfig.d.ts +80 -0
  380. package/src/emojiconfig.js +5 -0
  381. package/src/emojimention.d.ts +68 -0
  382. package/src/emojimention.js +193 -0
  383. package/src/emojipicker.d.ts +97 -0
  384. package/src/emojipicker.js +255 -0
  385. package/src/emojirepository.d.ts +139 -0
  386. package/src/emojirepository.js +267 -0
  387. package/src/index.d.ts +14 -0
  388. package/src/index.js +13 -0
  389. package/src/ui/emojicategoriesview.d.ts +68 -0
  390. package/src/ui/emojicategoriesview.js +131 -0
  391. package/src/ui/emojigridview.d.ts +140 -0
  392. package/src/ui/emojigridview.js +183 -0
  393. package/src/ui/emojipickerview.d.ts +91 -0
  394. package/src/ui/emojipickerview.js +172 -0
  395. package/src/ui/emojisearchview.d.ts +51 -0
  396. package/src/ui/emojisearchview.js +89 -0
  397. package/src/ui/emojitoneview.d.ts +46 -0
  398. package/src/ui/emojitoneview.js +89 -0
  399. package/theme/emojicategories.css +29 -0
  400. package/theme/emojigrid.css +55 -0
  401. package/theme/emojipicker.css +32 -0
  402. package/theme/emojitone.css +21 -0
@@ -0,0 +1,172 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module emoji/ui/emojipickerview
7
+ */
8
+ import { FocusCycler, SearchInfoView, View } from 'ckeditor5/src/ui.js';
9
+ import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
10
+ import EmojiGridView from './emojigridview.js';
11
+ import EmojiCategoriesView from './emojicategoriesview.js';
12
+ import EmojiSearchView from './emojisearchview.js';
13
+ import EmojiToneView from './emojitoneview.js';
14
+ /**
15
+ * A view that glues pieces of the emoji panel together.
16
+ */
17
+ export default class EmojiPickerView extends View {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ constructor(locale, { emojiCategories, getEmojiByQuery, skinTone, skinTones }) {
22
+ super(locale);
23
+ const categoryName = emojiCategories[0].title;
24
+ this.gridView = new EmojiGridView(locale, {
25
+ categoryName,
26
+ emojiCategories,
27
+ getEmojiByQuery,
28
+ skinTone
29
+ });
30
+ this.infoView = new SearchInfoView();
31
+ this.searchView = new EmojiSearchView(locale, {
32
+ gridView: this.gridView,
33
+ resultsView: this.infoView
34
+ });
35
+ this.categoriesView = new EmojiCategoriesView(locale, {
36
+ emojiCategories,
37
+ categoryName
38
+ });
39
+ this.toneView = new EmojiToneView(locale, {
40
+ skinTone,
41
+ skinTones
42
+ });
43
+ this.items = this.createCollection([
44
+ this.searchView,
45
+ this.toneView,
46
+ this.categoriesView,
47
+ this.gridView,
48
+ this.infoView
49
+ ]);
50
+ this.focusTracker = new FocusTracker();
51
+ this.keystrokes = new KeystrokeHandler();
52
+ this.focusCycler = new FocusCycler({
53
+ focusables: this.items,
54
+ focusTracker: this.focusTracker,
55
+ keystrokeHandler: this.keystrokes,
56
+ actions: {
57
+ focusPrevious: 'shift + tab',
58
+ focusNext: 'tab'
59
+ }
60
+ });
61
+ this.setTemplate({
62
+ tag: 'div',
63
+ children: [
64
+ {
65
+ tag: 'div',
66
+ children: [
67
+ this.searchView,
68
+ this.toneView
69
+ ],
70
+ attributes: {
71
+ class: ['ck', 'ck-emoji__search']
72
+ }
73
+ },
74
+ this.categoriesView,
75
+ this.gridView,
76
+ {
77
+ tag: 'div',
78
+ children: [
79
+ this.infoView
80
+ ],
81
+ attributes: {
82
+ class: ['ck', 'ck-search__results']
83
+ }
84
+ }
85
+ ],
86
+ attributes: {
87
+ tabindex: '-1',
88
+ class: ['ck', 'ck-emoji', 'ck-search']
89
+ }
90
+ });
91
+ this._setupEventListeners();
92
+ }
93
+ /**
94
+ * @inheritDoc
95
+ */
96
+ render() {
97
+ super.render();
98
+ this.focusTracker.add(this.searchView.element);
99
+ this.focusTracker.add(this.toneView.element);
100
+ this.focusTracker.add(this.categoriesView.element);
101
+ this.focusTracker.add(this.gridView.element);
102
+ this.focusTracker.add(this.infoView.element);
103
+ // Start listening for the keystrokes coming from #element.
104
+ this.keystrokes.listenTo(this.element);
105
+ }
106
+ /**
107
+ * @inheritDoc
108
+ */
109
+ destroy() {
110
+ super.destroy();
111
+ this.focusTracker.destroy();
112
+ this.keystrokes.destroy();
113
+ }
114
+ /**
115
+ * Focuses the search input.
116
+ */
117
+ focus() {
118
+ this.searchView.focus();
119
+ }
120
+ /**
121
+ * Initializes interactions between sub-views.
122
+ */
123
+ _setupEventListeners() {
124
+ const t = this.locale.t;
125
+ // Disable the category switcher when filtering by a query.
126
+ this.searchView.on('search', (evt, data) => {
127
+ if (data.query) {
128
+ this.categoriesView.disableCategories();
129
+ }
130
+ else {
131
+ this.categoriesView.enableCategories();
132
+ }
133
+ });
134
+ // Show a user-friendly message depending on the search query.
135
+ this.searchView.on('search', (evt, data) => {
136
+ if (data.query.length === 1) {
137
+ this.infoView.set({
138
+ primaryText: t('Keep on typing to see the emoji.'),
139
+ secondaryText: t('The query must contain at least two characters.'),
140
+ isVisible: true
141
+ });
142
+ }
143
+ else if (!data.resultsCount) {
144
+ this.infoView.set({
145
+ primaryText: t('No emojis were found matching "%0".', data.query),
146
+ secondaryText: t('Please try a different phrase or check the spelling.'),
147
+ isVisible: true
148
+ });
149
+ }
150
+ else {
151
+ this.infoView.set({
152
+ isVisible: false
153
+ });
154
+ }
155
+ });
156
+ // Emit an update event to react to balloon dimensions changes.
157
+ this.searchView.on('search', () => {
158
+ this.fire('update');
159
+ });
160
+ // Update the grid of emojis when the selected category is changed.
161
+ this.categoriesView.on('change:categoryName', (ev, args, categoryName) => {
162
+ this.gridView.categoryName = categoryName;
163
+ this.searchView.search('');
164
+ });
165
+ // Update the grid of emojis when the selected skin tone is changed.
166
+ // In such a case, the displayed emoji should use an updated skin tone value.
167
+ this.toneView.on('change:skinTone', (evt, propertyName, newValue) => {
168
+ this.gridView.skinTone = newValue;
169
+ this.searchView.search(this.searchView.getInputValue());
170
+ });
171
+ }
172
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import { SearchTextView, View, type SearchInfoView } from 'ckeditor5/src/ui.js';
6
+ import type { Locale } from 'ckeditor5/src/utils.js';
7
+ import type EmojiGridView from './emojigridview.js';
8
+ /**
9
+ * A view responsible for providing an input element that allows filtering emoji by the provided query.
10
+ */
11
+ export default class EmojiSearchView extends View {
12
+ /**
13
+ * The find in text input view that stores the searched string.
14
+ */
15
+ readonly inputView: SearchTextView;
16
+ /**
17
+ * An instance of the `EmojiGridView`.
18
+ */
19
+ readonly gridView: EmojiGridView;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ constructor(locale: Locale, { gridView, resultsView }: {
24
+ gridView: EmojiGridView;
25
+ resultsView: SearchInfoView;
26
+ });
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ destroy(): void;
31
+ /**
32
+ * Searches the {@link #gridView} for the given query.
33
+ *
34
+ * @param query The search query string.
35
+ */
36
+ search(query: string): void;
37
+ /**
38
+ * Allows defining the default value in the search text field.
39
+ *
40
+ * @param value The new value.
41
+ */
42
+ setInputValue(value: string): void;
43
+ /**
44
+ * Returns an input provided by a user in the search text field.
45
+ */
46
+ getInputValue(): string;
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ focus(): void;
51
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module emoji/ui/emojisearchview
7
+ */
8
+ import { escapeRegExp } from 'lodash-es';
9
+ import { createLabeledInputText, SearchTextView, View } from 'ckeditor5/src/ui.js';
10
+ /**
11
+ * A view responsible for providing an input element that allows filtering emoji by the provided query.
12
+ */
13
+ export default class EmojiSearchView extends View {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ constructor(locale, { gridView, resultsView }) {
18
+ super(locale);
19
+ this.gridView = gridView;
20
+ const t = locale.t;
21
+ this.inputView = new SearchTextView(this.locale, {
22
+ queryView: {
23
+ label: t('Find an emoji (min. 2 characters)'),
24
+ creator: createLabeledInputText
25
+ },
26
+ filteredView: this.gridView,
27
+ infoView: {
28
+ instance: resultsView
29
+ }
30
+ });
31
+ this.setTemplate({
32
+ tag: 'div',
33
+ attributes: {
34
+ class: [
35
+ 'ck',
36
+ 'ck-search'
37
+ ],
38
+ tabindex: '-1'
39
+ },
40
+ children: [
41
+ this.inputView.queryView
42
+ ]
43
+ });
44
+ // Pass through the `search` event to handle it by a parent view.
45
+ this.inputView.delegate('search').to(this);
46
+ }
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ destroy() {
51
+ super.destroy();
52
+ this.inputView.destroy();
53
+ }
54
+ /**
55
+ * Searches the {@link #gridView} for the given query.
56
+ *
57
+ * @param query The search query string.
58
+ */
59
+ search(query) {
60
+ const regExp = query ? new RegExp(escapeRegExp(query), 'ig') : null;
61
+ const filteringResults = this.gridView.filter(regExp);
62
+ this.inputView.fire('search', { query, ...filteringResults });
63
+ }
64
+ /**
65
+ * Allows defining the default value in the search text field.
66
+ *
67
+ * @param value The new value.
68
+ */
69
+ setInputValue(value) {
70
+ if (!value) {
71
+ this.inputView.queryView.fieldView.reset();
72
+ }
73
+ else {
74
+ this.inputView.queryView.fieldView.value = value;
75
+ }
76
+ }
77
+ /**
78
+ * Returns an input provided by a user in the search text field.
79
+ */
80
+ getInputValue() {
81
+ return this.inputView.queryView.fieldView.element.value;
82
+ }
83
+ /**
84
+ * @inheritDoc
85
+ */
86
+ focus() {
87
+ this.inputView.focus();
88
+ }
89
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module emoji/ui/emojitoneview
7
+ */
8
+ import { View, type DropdownView } from 'ckeditor5/src/ui.js';
9
+ import { type Locale } from 'ckeditor5/src/utils.js';
10
+ import type { SkinToneId } from '../emojiconfig.js';
11
+ import type { SkinTone } from '../emojirepository.js';
12
+ import '../../theme/emojitone.css';
13
+ /**
14
+ * A view responsible for selecting a skin tone for an emoji.
15
+ */
16
+ export default class EmojiToneView extends View {
17
+ /**
18
+ * Active skin tone.
19
+ *
20
+ * @observable
21
+ */
22
+ skinTone: SkinToneId;
23
+ /**
24
+ * A dropdown element for selecting an active skin tone.
25
+ */
26
+ readonly dropdownView: DropdownView;
27
+ /**
28
+ * An array of available skin tones.
29
+ */
30
+ private readonly _skinTones;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ constructor(locale: Locale, { skinTone, skinTones }: {
35
+ skinTone: SkinToneId;
36
+ skinTones: Array<SkinTone>;
37
+ });
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ focus(): void;
42
+ /**
43
+ * Helper method for receiving an object describing the active skin tone.
44
+ */
45
+ private _getSkinTone;
46
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module emoji/ui/emojitoneview
7
+ */
8
+ import { createDropdown, addListToDropdown, View, ViewModel } from 'ckeditor5/src/ui.js';
9
+ import { Collection } from 'ckeditor5/src/utils.js';
10
+ import '../../theme/emojitone.css';
11
+ /**
12
+ * A view responsible for selecting a skin tone for an emoji.
13
+ */
14
+ export default class EmojiToneView extends View {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ constructor(locale, { skinTone, skinTones }) {
19
+ super(locale);
20
+ this.set('skinTone', skinTone);
21
+ this._skinTones = skinTones;
22
+ const t = locale.t;
23
+ const accessibleLabel = t('Select skin tone');
24
+ const dropdownView = createDropdown(locale);
25
+ const itemDefinitions = new Collection();
26
+ for (const { id, icon, tooltip } of this._skinTones) {
27
+ const def = {
28
+ type: 'button',
29
+ model: new ViewModel({
30
+ value: id,
31
+ label: icon,
32
+ ariaLabel: tooltip,
33
+ tooltip,
34
+ tooltipPosition: 'e',
35
+ role: 'menuitemradio',
36
+ withText: true,
37
+ // To improve accessibility, disconnect a button and its label connection so that screen
38
+ // readers can read the `[aria-label]` attribute directly from the more descriptive button.
39
+ ariaLabelledBy: undefined
40
+ })
41
+ };
42
+ def.model.bind('isOn').to(this, 'skinTone', value => value === id);
43
+ itemDefinitions.add(def);
44
+ }
45
+ addListToDropdown(dropdownView, itemDefinitions, {
46
+ ariaLabel: accessibleLabel,
47
+ role: 'menu'
48
+ });
49
+ dropdownView.buttonView.set({
50
+ label: this._getSkinTone().icon,
51
+ ariaLabel: accessibleLabel,
52
+ ariaLabelledBy: undefined,
53
+ isOn: false,
54
+ withText: true,
55
+ tooltip: accessibleLabel
56
+ });
57
+ this.dropdownView = dropdownView;
58
+ // Execute command when an item from the dropdown is selected.
59
+ this.listenTo(dropdownView, 'execute', evt => {
60
+ this.skinTone = evt.source.value;
61
+ });
62
+ dropdownView.buttonView.bind('label').to(this, 'skinTone', () => {
63
+ return this._getSkinTone().icon;
64
+ });
65
+ dropdownView.buttonView.bind('ariaLabel').to(this, 'skinTone', () => {
66
+ // Render a current state, but also what the dropdown does.
67
+ return `${this._getSkinTone().tooltip}, ${accessibleLabel}`;
68
+ });
69
+ this.setTemplate({
70
+ tag: 'div',
71
+ attributes: {
72
+ class: ['ck', 'ck-emoji__skin-tone']
73
+ },
74
+ children: [dropdownView]
75
+ });
76
+ }
77
+ /**
78
+ * @inheritDoc
79
+ */
80
+ focus() {
81
+ this.dropdownView.buttonView.focus();
82
+ }
83
+ /**
84
+ * Helper method for receiving an object describing the active skin tone.
85
+ */
86
+ _getSkinTone() {
87
+ return this._skinTones.find(tone => tone.id === this.skinTone);
88
+ }
89
+ }
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+
6
+ .ck.ck-emoji__categories-list {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ margin: 0 var(--ck-spacing-large);
10
+
11
+ > .ck.ck-button.ck-button_with-text {
12
+ border-width: 0;
13
+ border-bottom-width: 2px;
14
+ border-bottom-style: solid;
15
+ border-bottom-color: transparent;
16
+ padding: 0;
17
+ font-size: var(--ck-font-size-big);
18
+ min-width: var(--ck-font-size-big);
19
+ min-height: var(--ck-font-size-big);
20
+
21
+ &.ck-emoji__category-item.ck-on {
22
+ border-bottom-color: var(--ck-color-base-active);
23
+ }
24
+
25
+ > span {
26
+ margin: auto;
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+
6
+ :root {
7
+ --ck-emoji-grid-tile-size: 27px;
8
+ }
9
+
10
+ .ck.ck-emoji {
11
+ & .ck.ck-emoji__tiles {
12
+ max-width: 100%;
13
+ max-height: 265px;
14
+
15
+ overflow-y: auto;
16
+ overflow-x: hidden;
17
+ border-top: 1px solid var(--ck-color-base-border);
18
+
19
+ & .ck-emoji__grid {
20
+ display: grid;
21
+ grid-template-columns: repeat(auto-fill, minmax(var(--ck-emoji-grid-tile-size), 1fr));
22
+ margin: var(--ck-spacing-standard) var(--ck-spacing-large);
23
+ grid-gap: var(--ck-spacing-small);
24
+ }
25
+
26
+ & .ck-emoji__tile {
27
+ width: var(--ck-emoji-grid-tile-size);
28
+ height: var(--ck-emoji-grid-tile-size);
29
+ min-width: var(--ck-emoji-grid-tile-size);
30
+ min-height: var(--ck-emoji-grid-tile-size);
31
+ font-size: 1.5em;
32
+ padding: 0;
33
+ transition: .2s ease box-shadow;
34
+ border: 0;
35
+
36
+ @media (prefers-reduced-motion: reduce) {
37
+ transition: none;
38
+ }
39
+
40
+ &:focus:not(.ck-disabled),
41
+ &:hover:not(.ck-disabled) {
42
+ /* Disable the default .ck-button's border ring. */
43
+ border: 0;
44
+ box-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);
45
+ }
46
+
47
+ /* Make sure the glyph is rendered in the center of the button */
48
+ & .ck-button__label {
49
+ line-height: var(--ck-emoji-grid-tile-size);
50
+ width: 100%;
51
+ text-align: center;
52
+ }
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+
6
+ .ck.ck-emoji {
7
+ width: 320px;
8
+ }
9
+
10
+ .ck .ck.ck-emoji__search {
11
+ display: flex;
12
+ padding: var(--ck-spacing-large);
13
+ padding-bottom: var(--ck-spacing-medium);
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ }
17
+
18
+ /*
19
+ * Classes used by the "fake visual selection" displayed in the content when an input
20
+ * in the emoji picker UI has focus (the browser does not render the native selection in this state).
21
+ */
22
+ .ck .ck-fake-emoji-selection {
23
+ background: var(--ck-color-link-fake-selection);
24
+ }
25
+
26
+ /* A collapsed fake visual selection. */
27
+ .ck .ck-fake-emoji-selection_collapsed {
28
+ height: 100%;
29
+ border-right: 1px solid var(--ck-color-base-text);
30
+ margin-right: -1px;
31
+ outline: solid 1px hsla(0, 0%, 100%, .5);
32
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+
6
+ .ck.ck-emoji__skin-tone {
7
+ margin-left: var(--ck-spacing-standard);
8
+
9
+ > .ck.ck-dropdown {
10
+
11
+ .ck.ck-list__item {
12
+ min-width: 1em;
13
+ }
14
+
15
+ .ck-button.ck-dropdown__button {
16
+ .ck-button__label {
17
+ width: initial;
18
+ }
19
+ }
20
+ }
21
+ }