@atlaskit/editor-core 188.8.0 → 188.9.2

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 (290) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/composable-editor/editor-internal.js +2 -2
  3. package/dist/cjs/create-editor/ReactEditorView.js +796 -8
  4. package/dist/cjs/labs/next/presets/default.js +2 -2
  5. package/dist/cjs/labs/next/presets/universal.js +7 -4
  6. package/dist/cjs/plugins/index.js +0 -28
  7. package/dist/cjs/plugins/insert-block/index.js +4 -6
  8. package/dist/cjs/plugins/tasks-and-decisions/index.js +4 -3
  9. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +26 -6
  10. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +45 -13
  11. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +15 -7
  12. package/dist/cjs/version-wrapper.js +1 -1
  13. package/dist/es2019/composable-editor/editor-internal.js +1 -1
  14. package/dist/es2019/create-editor/ReactEditorView.js +753 -2
  15. package/dist/es2019/labs/next/presets/default.js +1 -1
  16. package/dist/es2019/labs/next/presets/universal.js +4 -1
  17. package/dist/es2019/plugins/index.js +0 -4
  18. package/dist/es2019/plugins/insert-block/index.js +4 -6
  19. package/dist/es2019/plugins/tasks-and-decisions/index.js +4 -3
  20. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +26 -6
  21. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +43 -10
  22. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +13 -6
  23. package/dist/es2019/version-wrapper.js +1 -1
  24. package/dist/esm/composable-editor/editor-internal.js +1 -1
  25. package/dist/esm/create-editor/ReactEditorView.js +797 -8
  26. package/dist/esm/labs/next/presets/default.js +1 -1
  27. package/dist/esm/labs/next/presets/universal.js +4 -1
  28. package/dist/esm/plugins/index.js +0 -4
  29. package/dist/esm/plugins/insert-block/index.js +4 -6
  30. package/dist/esm/plugins/tasks-and-decisions/index.js +4 -3
  31. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +26 -6
  32. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +45 -12
  33. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +14 -7
  34. package/dist/esm/version-wrapper.js +1 -1
  35. package/dist/types/create-editor/ReactEditorView.d.ts +119 -5
  36. package/dist/types/labs/next/presets/default.d.ts +43 -43
  37. package/dist/types/plugins/index.d.ts +0 -4
  38. package/dist/types/plugins/insert-block/types.d.ts +3 -1
  39. package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -5
  40. package/dist/types/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +9 -4
  41. package/dist/types/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +9 -4
  42. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +4 -2
  43. package/dist/types/plugins/tasks-and-decisions/types.d.ts +6 -1
  44. package/dist/types/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +1 -1
  45. package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +119 -5
  46. package/dist/types-ts4.5/labs/next/presets/default.d.ts +43 -43
  47. package/dist/types-ts4.5/plugins/index.d.ts +0 -4
  48. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
  49. package/dist/types-ts4.5/plugins/tasks-and-decisions/index.d.ts +2 -5
  50. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +9 -4
  51. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +9 -4
  52. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/main.d.ts +4 -2
  53. package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +8 -1
  54. package/dist/types-ts4.5/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +1 -1
  55. package/package.json +7 -7
  56. package/dist/cjs/create-editor/ReactEditorViewInternal.js +0 -812
  57. package/dist/cjs/create-editor/ReactEditorViewNext.js +0 -15
  58. package/dist/cjs/plugins/save-on-enter/index.js +0 -70
  59. package/dist/cjs/plugins/scroll-into-view/index.js +0 -55
  60. package/dist/cjs/plugins/status/actions.js +0 -158
  61. package/dist/cjs/plugins/status/analytics.js +0 -31
  62. package/dist/cjs/plugins/status/index.js +0 -143
  63. package/dist/cjs/plugins/status/keymap.js +0 -22
  64. package/dist/cjs/plugins/status/nodeviews/status.js +0 -58
  65. package/dist/cjs/plugins/status/plugin-key.js +0 -9
  66. package/dist/cjs/plugins/status/plugin.js +0 -133
  67. package/dist/cjs/plugins/status/types.js +0 -5
  68. package/dist/cjs/plugins/status/ui/statusPicker.js +0 -314
  69. package/dist/cjs/plugins/status/utils.js +0 -22
  70. package/dist/cjs/plugins/type-ahead/api.js +0 -215
  71. package/dist/cjs/plugins/type-ahead/commands/insert-type-ahead-item.js +0 -205
  72. package/dist/cjs/plugins/type-ahead/commands/update-list-items.js +0 -23
  73. package/dist/cjs/plugins/type-ahead/commands/update-query.js +0 -27
  74. package/dist/cjs/plugins/type-ahead/commands/update-selected-index.js +0 -27
  75. package/dist/cjs/plugins/type-ahead/constants.js +0 -15
  76. package/dist/cjs/plugins/type-ahead/index.js +0 -14
  77. package/dist/cjs/plugins/type-ahead/insert-utils.js +0 -107
  78. package/dist/cjs/plugins/type-ahead/messages.js +0 -79
  79. package/dist/cjs/plugins/type-ahead/plugin.js +0 -382
  80. package/dist/cjs/plugins/type-ahead/pm-plugins/actions.js +0 -16
  81. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -148
  82. package/dist/cjs/plugins/type-ahead/pm-plugins/input-rules.js +0 -36
  83. package/dist/cjs/plugins/type-ahead/pm-plugins/insert-item-plugin.js +0 -22
  84. package/dist/cjs/plugins/type-ahead/pm-plugins/key.js +0 -8
  85. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +0 -110
  86. package/dist/cjs/plugins/type-ahead/pm-plugins/reducer.js +0 -158
  87. package/dist/cjs/plugins/type-ahead/pm-plugins/utils.js +0 -18
  88. package/dist/cjs/plugins/type-ahead/stats-modifier.js +0 -42
  89. package/dist/cjs/plugins/type-ahead/transforms/close-type-ahead.js +0 -13
  90. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +0 -75
  91. package/dist/cjs/plugins/type-ahead/transforms/set-selection-before-query.js +0 -18
  92. package/dist/cjs/plugins/type-ahead/types.js +0 -5
  93. package/dist/cjs/plugins/type-ahead/ui/AssistiveText.js +0 -120
  94. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +0 -400
  95. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +0 -285
  96. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +0 -179
  97. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +0 -230
  98. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +0 -127
  99. package/dist/cjs/plugins/type-ahead/ui/hooks/use-item-insert.js +0 -109
  100. package/dist/cjs/plugins/type-ahead/ui/hooks/use-load-items.js +0 -50
  101. package/dist/cjs/plugins/type-ahead/ui/hooks/use-on-force-select.js +0 -41
  102. package/dist/cjs/plugins/type-ahead/utils.js +0 -130
  103. package/dist/es2019/create-editor/ReactEditorViewInternal.js +0 -753
  104. package/dist/es2019/create-editor/ReactEditorViewNext.js +0 -7
  105. package/dist/es2019/plugins/save-on-enter/index.js +0 -63
  106. package/dist/es2019/plugins/scroll-into-view/index.js +0 -44
  107. package/dist/es2019/plugins/status/actions.js +0 -144
  108. package/dist/es2019/plugins/status/analytics.js +0 -18
  109. package/dist/es2019/plugins/status/index.js +0 -135
  110. package/dist/es2019/plugins/status/keymap.js +0 -13
  111. package/dist/es2019/plugins/status/nodeviews/status.js +0 -60
  112. package/dist/es2019/plugins/status/plugin-key.js +0 -3
  113. package/dist/es2019/plugins/status/plugin.js +0 -113
  114. package/dist/es2019/plugins/status/types.js +0 -1
  115. package/dist/es2019/plugins/status/ui/statusPicker.js +0 -293
  116. package/dist/es2019/plugins/status/utils.js +0 -12
  117. package/dist/es2019/plugins/type-ahead/api.js +0 -205
  118. package/dist/es2019/plugins/type-ahead/commands/insert-type-ahead-item.js +0 -204
  119. package/dist/es2019/plugins/type-ahead/commands/update-list-items.js +0 -17
  120. package/dist/es2019/plugins/type-ahead/commands/update-query.js +0 -21
  121. package/dist/es2019/plugins/type-ahead/commands/update-selected-index.js +0 -21
  122. package/dist/es2019/plugins/type-ahead/constants.js +0 -9
  123. package/dist/es2019/plugins/type-ahead/index.js +0 -3
  124. package/dist/es2019/plugins/type-ahead/insert-utils.js +0 -106
  125. package/dist/es2019/plugins/type-ahead/messages.js +0 -73
  126. package/dist/es2019/plugins/type-ahead/plugin.js +0 -381
  127. package/dist/es2019/plugins/type-ahead/pm-plugins/actions.js +0 -10
  128. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -148
  129. package/dist/es2019/plugins/type-ahead/pm-plugins/input-rules.js +0 -29
  130. package/dist/es2019/plugins/type-ahead/pm-plugins/insert-item-plugin.js +0 -16
  131. package/dist/es2019/plugins/type-ahead/pm-plugins/key.js +0 -2
  132. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +0 -106
  133. package/dist/es2019/plugins/type-ahead/pm-plugins/reducer.js +0 -160
  134. package/dist/es2019/plugins/type-ahead/pm-plugins/utils.js +0 -12
  135. package/dist/es2019/plugins/type-ahead/stats-modifier.js +0 -33
  136. package/dist/es2019/plugins/type-ahead/transforms/close-type-ahead.js +0 -7
  137. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +0 -71
  138. package/dist/es2019/plugins/type-ahead/transforms/set-selection-before-query.js +0 -10
  139. package/dist/es2019/plugins/type-ahead/types.js +0 -1
  140. package/dist/es2019/plugins/type-ahead/ui/AssistiveText.js +0 -88
  141. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +0 -393
  142. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +0 -273
  143. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +0 -214
  144. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +0 -233
  145. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +0 -109
  146. package/dist/es2019/plugins/type-ahead/ui/hooks/use-item-insert.js +0 -112
  147. package/dist/es2019/plugins/type-ahead/ui/hooks/use-load-items.js +0 -41
  148. package/dist/es2019/plugins/type-ahead/ui/hooks/use-on-force-select.js +0 -38
  149. package/dist/es2019/plugins/type-ahead/utils.js +0 -126
  150. package/dist/esm/create-editor/ReactEditorViewInternal.js +0 -806
  151. package/dist/esm/create-editor/ReactEditorViewNext.js +0 -7
  152. package/dist/esm/plugins/save-on-enter/index.js +0 -63
  153. package/dist/esm/plugins/scroll-into-view/index.js +0 -50
  154. package/dist/esm/plugins/status/actions.js +0 -151
  155. package/dist/esm/plugins/status/analytics.js +0 -24
  156. package/dist/esm/plugins/status/index.js +0 -136
  157. package/dist/esm/plugins/status/keymap.js +0 -15
  158. package/dist/esm/plugins/status/nodeviews/status.js +0 -51
  159. package/dist/esm/plugins/status/plugin-key.js +0 -3
  160. package/dist/esm/plugins/status/plugin.js +0 -115
  161. package/dist/esm/plugins/status/types.js +0 -1
  162. package/dist/esm/plugins/status/ui/statusPicker.js +0 -308
  163. package/dist/esm/plugins/status/utils.js +0 -16
  164. package/dist/esm/plugins/type-ahead/api.js +0 -209
  165. package/dist/esm/plugins/type-ahead/commands/insert-type-ahead-item.js +0 -198
  166. package/dist/esm/plugins/type-ahead/commands/update-list-items.js +0 -17
  167. package/dist/esm/plugins/type-ahead/commands/update-query.js +0 -21
  168. package/dist/esm/plugins/type-ahead/commands/update-selected-index.js +0 -21
  169. package/dist/esm/plugins/type-ahead/constants.js +0 -9
  170. package/dist/esm/plugins/type-ahead/index.js +0 -3
  171. package/dist/esm/plugins/type-ahead/insert-utils.js +0 -101
  172. package/dist/esm/plugins/type-ahead/messages.js +0 -73
  173. package/dist/esm/plugins/type-ahead/plugin.js +0 -374
  174. package/dist/esm/plugins/type-ahead/pm-plugins/actions.js +0 -10
  175. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -141
  176. package/dist/esm/plugins/type-ahead/pm-plugins/input-rules.js +0 -29
  177. package/dist/esm/plugins/type-ahead/pm-plugins/insert-item-plugin.js +0 -16
  178. package/dist/esm/plugins/type-ahead/pm-plugins/key.js +0 -2
  179. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +0 -104
  180. package/dist/esm/plugins/type-ahead/pm-plugins/reducer.js +0 -151
  181. package/dist/esm/plugins/type-ahead/pm-plugins/utils.js +0 -12
  182. package/dist/esm/plugins/type-ahead/stats-modifier.js +0 -35
  183. package/dist/esm/plugins/type-ahead/transforms/close-type-ahead.js +0 -7
  184. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +0 -69
  185. package/dist/esm/plugins/type-ahead/transforms/set-selection-before-query.js +0 -12
  186. package/dist/esm/plugins/type-ahead/types.js +0 -1
  187. package/dist/esm/plugins/type-ahead/ui/AssistiveText.js +0 -115
  188. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +0 -390
  189. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +0 -276
  190. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +0 -169
  191. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +0 -220
  192. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +0 -117
  193. package/dist/esm/plugins/type-ahead/ui/hooks/use-item-insert.js +0 -103
  194. package/dist/esm/plugins/type-ahead/ui/hooks/use-load-items.js +0 -43
  195. package/dist/esm/plugins/type-ahead/ui/hooks/use-on-force-select.js +0 -35
  196. package/dist/esm/plugins/type-ahead/utils.js +0 -124
  197. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -119
  198. package/dist/types/create-editor/ReactEditorViewNext.d.ts +0 -8
  199. package/dist/types/plugins/save-on-enter/index.d.ts +0 -10
  200. package/dist/types/plugins/scroll-into-view/index.d.ts +0 -14
  201. package/dist/types/plugins/status/actions.d.ts +0 -16
  202. package/dist/types/plugins/status/analytics.d.ts +0 -4
  203. package/dist/types/plugins/status/index.d.ts +0 -15
  204. package/dist/types/plugins/status/keymap.d.ts +0 -3
  205. package/dist/types/plugins/status/nodeviews/status.d.ts +0 -25
  206. package/dist/types/plugins/status/plugin-key.d.ts +0 -4
  207. package/dist/types/plugins/status/plugin.d.ts +0 -7
  208. package/dist/types/plugins/status/types.d.ts +0 -18
  209. package/dist/types/plugins/status/ui/statusPicker.d.ts +0 -63
  210. package/dist/types/plugins/status/utils.d.ts +0 -5
  211. package/dist/types/plugins/type-ahead/api.d.ts +0 -61
  212. package/dist/types/plugins/type-ahead/commands/insert-type-ahead-item.d.ts +0 -12
  213. package/dist/types/plugins/type-ahead/commands/update-list-items.d.ts +0 -3
  214. package/dist/types/plugins/type-ahead/commands/update-query.d.ts +0 -2
  215. package/dist/types/plugins/type-ahead/commands/update-selected-index.d.ts +0 -2
  216. package/dist/types/plugins/type-ahead/constants.d.ts +0 -8
  217. package/dist/types/plugins/type-ahead/index.d.ts +0 -4
  218. package/dist/types/plugins/type-ahead/insert-utils.d.ts +0 -18
  219. package/dist/types/plugins/type-ahead/messages.d.ts +0 -72
  220. package/dist/types/plugins/type-ahead/plugin.d.ts +0 -10
  221. package/dist/types/plugins/type-ahead/pm-plugins/actions.d.ts +0 -9
  222. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +0 -14
  223. package/dist/types/plugins/type-ahead/pm-plugins/input-rules.d.ts +0 -6
  224. package/dist/types/plugins/type-ahead/pm-plugins/insert-item-plugin.d.ts +0 -2
  225. package/dist/types/plugins/type-ahead/pm-plugins/key.d.ts +0 -3
  226. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +0 -14
  227. package/dist/types/plugins/type-ahead/pm-plugins/reducer.d.ts +0 -10
  228. package/dist/types/plugins/type-ahead/pm-plugins/utils.d.ts +0 -4
  229. package/dist/types/plugins/type-ahead/stats-modifier.d.ts +0 -20
  230. package/dist/types/plugins/type-ahead/transforms/close-type-ahead.d.ts +0 -2
  231. package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +0 -11
  232. package/dist/types/plugins/type-ahead/transforms/set-selection-before-query.d.ts +0 -2
  233. package/dist/types/plugins/type-ahead/types.d.ts +0 -109
  234. package/dist/types/plugins/type-ahead/ui/AssistiveText.d.ts +0 -33
  235. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +0 -26
  236. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +0 -25
  237. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +0 -18
  238. package/dist/types/plugins/type-ahead/ui/TypeAheadPopup.d.ts +0 -29
  239. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -20
  240. package/dist/types/plugins/type-ahead/ui/hooks/use-item-insert.d.ts +0 -3
  241. package/dist/types/plugins/type-ahead/ui/hooks/use-load-items.d.ts +0 -3
  242. package/dist/types/plugins/type-ahead/ui/hooks/use-on-force-select.d.ts +0 -11
  243. package/dist/types/plugins/type-ahead/utils.d.ts +0 -27
  244. package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -119
  245. package/dist/types-ts4.5/create-editor/ReactEditorViewNext.d.ts +0 -8
  246. package/dist/types-ts4.5/plugins/save-on-enter/index.d.ts +0 -10
  247. package/dist/types-ts4.5/plugins/scroll-into-view/index.d.ts +0 -14
  248. package/dist/types-ts4.5/plugins/status/actions.d.ts +0 -16
  249. package/dist/types-ts4.5/plugins/status/analytics.d.ts +0 -4
  250. package/dist/types-ts4.5/plugins/status/index.d.ts +0 -17
  251. package/dist/types-ts4.5/plugins/status/keymap.d.ts +0 -3
  252. package/dist/types-ts4.5/plugins/status/nodeviews/status.d.ts +0 -25
  253. package/dist/types-ts4.5/plugins/status/plugin-key.d.ts +0 -4
  254. package/dist/types-ts4.5/plugins/status/plugin.d.ts +0 -7
  255. package/dist/types-ts4.5/plugins/status/types.d.ts +0 -18
  256. package/dist/types-ts4.5/plugins/status/ui/statusPicker.d.ts +0 -63
  257. package/dist/types-ts4.5/plugins/status/utils.d.ts +0 -5
  258. package/dist/types-ts4.5/plugins/type-ahead/api.d.ts +0 -61
  259. package/dist/types-ts4.5/plugins/type-ahead/commands/insert-type-ahead-item.d.ts +0 -12
  260. package/dist/types-ts4.5/plugins/type-ahead/commands/update-list-items.d.ts +0 -3
  261. package/dist/types-ts4.5/plugins/type-ahead/commands/update-query.d.ts +0 -2
  262. package/dist/types-ts4.5/plugins/type-ahead/commands/update-selected-index.d.ts +0 -2
  263. package/dist/types-ts4.5/plugins/type-ahead/constants.d.ts +0 -8
  264. package/dist/types-ts4.5/plugins/type-ahead/index.d.ts +0 -4
  265. package/dist/types-ts4.5/plugins/type-ahead/insert-utils.d.ts +0 -18
  266. package/dist/types-ts4.5/plugins/type-ahead/messages.d.ts +0 -72
  267. package/dist/types-ts4.5/plugins/type-ahead/plugin.d.ts +0 -10
  268. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/actions.d.ts +0 -9
  269. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/decorations.d.ts +0 -14
  270. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/input-rules.d.ts +0 -6
  271. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/insert-item-plugin.d.ts +0 -2
  272. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/key.d.ts +0 -3
  273. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/main.d.ts +0 -14
  274. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/reducer.d.ts +0 -10
  275. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/utils.d.ts +0 -4
  276. package/dist/types-ts4.5/plugins/type-ahead/stats-modifier.d.ts +0 -20
  277. package/dist/types-ts4.5/plugins/type-ahead/transforms/close-type-ahead.d.ts +0 -2
  278. package/dist/types-ts4.5/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +0 -11
  279. package/dist/types-ts4.5/plugins/type-ahead/transforms/set-selection-before-query.d.ts +0 -2
  280. package/dist/types-ts4.5/plugins/type-ahead/types.d.ts +0 -111
  281. package/dist/types-ts4.5/plugins/type-ahead/ui/AssistiveText.d.ts +0 -33
  282. package/dist/types-ts4.5/plugins/type-ahead/ui/InputQuery.d.ts +0 -26
  283. package/dist/types-ts4.5/plugins/type-ahead/ui/TypeAheadList.d.ts +0 -25
  284. package/dist/types-ts4.5/plugins/type-ahead/ui/TypeAheadListItem.d.ts +0 -18
  285. package/dist/types-ts4.5/plugins/type-ahead/ui/TypeAheadPopup.d.ts +0 -29
  286. package/dist/types-ts4.5/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -20
  287. package/dist/types-ts4.5/plugins/type-ahead/ui/hooks/use-item-insert.d.ts +0 -7
  288. package/dist/types-ts4.5/plugins/type-ahead/ui/hooks/use-load-items.d.ts +0 -3
  289. package/dist/types-ts4.5/plugins/type-ahead/ui/hooks/use-on-force-select.d.ts +0 -11
  290. package/dist/types-ts4.5/plugins/type-ahead/utils.d.ts +0 -27
@@ -1,88 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /** @jsx jsx */
3
-
4
- import debounce from 'lodash/debounce';
5
- import React from 'react';
6
- import { css, jsx } from '@emotion/react';
7
- const statusDebounceMillis = 1400;
8
- const assitiveTextStyles = css({
9
- border: 0,
10
- clip: 'rect(0 0 0 0)',
11
- height: '1px',
12
- marginbottom: '-1px',
13
- marginright: '-1px',
14
- overflow: 'hidden',
15
- padding: 0,
16
- position: 'absolute',
17
- whitespace: 'nowrap',
18
- width: '1px'
19
- });
20
- class AssistveTextComponent extends React.Component {
21
- constructor(...args) {
22
- super(...args);
23
- _defineProperty(this, "state", {
24
- bump: false,
25
- //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
26
- debounced: false,
27
- silenced: false
28
- });
29
- }
30
- componentWillMount() {
31
- this.debounceStatusUpdate = debounce(() => {
32
- if (!this.state.debounced) {
33
- const shouldSilence = !this.props.isInFocus;
34
- this.setState(({
35
- bump
36
- }) => ({
37
- bump: !bump,
38
- debounced: true,
39
- silenced: shouldSilence
40
- }));
41
- }
42
- }, statusDebounceMillis);
43
- }
44
- componentWillUnmount() {
45
- this.debounceStatusUpdate.cancel();
46
- }
47
- componentWillReceiveProps() {
48
- this.setState(({
49
- bump
50
- }) => ({
51
- bump: !bump,
52
- debounced: false
53
- }));
54
- }
55
- render() {
56
- const {
57
- assistiveText,
58
- id
59
- } = this.props;
60
- const {
61
- bump,
62
- debounced,
63
- silenced
64
- } = this.state;
65
- this.debounceStatusUpdate();
66
- return jsx("div", {
67
- css: assitiveTextStyles
68
- }, jsx("div", {
69
- id: id + '__status--A',
70
- role: "status",
71
- "aria-atomic": "true",
72
- "aria-live": "polite"
73
- }, `${!silenced && debounced && bump ? assistiveText : ''}`), jsx("div", {
74
- id: id + '__status--B',
75
- role: "status",
76
- "aria-atomic": "true",
77
- "aria-live": "polite"
78
- }, `${!silenced && debounced && !bump ? assistiveText : ''}`));
79
- }
80
- }
81
- _defineProperty(AssistveTextComponent, "defaultProps", {
82
- statusDebounceMillis: 1400,
83
- debounce: true,
84
- assistiveText: '',
85
- isInFocus: false,
86
- id: ''
87
- });
88
- export const AssistiveText = AssistveTextComponent;
@@ -1,393 +0,0 @@
1
- /** @jsx jsx */
2
- import React, { useRef, useCallback, Fragment, useLayoutEffect, useState } from 'react';
3
- import { css, jsx } from '@emotion/react';
4
- import { keyName as keyNameNormalized } from 'w3c-keyname';
5
- import { browser } from '@atlaskit/editor-common/utils';
6
- import { getPluginState } from '../utils';
7
- import { CloseSelectionOptions, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../constants';
8
- import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
9
- import { TYPE_AHEAD_DECORATION_ELEMENT_ID } from '../constants';
10
- import { AssistiveText } from './AssistiveText';
11
- import { typeAheadListMessages } from '../messages';
12
- import { useIntl } from 'react-intl-next';
13
- import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
14
- const querySpan = css({
15
- outline: 'none',
16
- '& input': {
17
- width: '5px',
18
- border: 'none',
19
- background: 'transparent',
20
- padding: 0,
21
- margin: 0,
22
- // ED-17022 Fixes firefox caret position
23
- fontSize: '1em',
24
- height: blockNodesVerticalMargin,
25
- caretColor: "var(--ds-text-accent-blue, #0052CC)"
26
- }
27
- });
28
- const isNavigationKey = event => {
29
- return ['Enter', 'Tab', 'ArrowDown', 'ArrowUp'].includes(event.key);
30
- };
31
- const isUndoRedoShortcut = event => {
32
- const key = keyNameNormalized(event);
33
- if (event.ctrlKey && key === 'y') {
34
- return 'historyRedo';
35
- }
36
- if ((event.ctrlKey || event.metaKey) && event.shiftKey && key === 'Z') {
37
- return 'historyRedo';
38
- }
39
- if ((event.ctrlKey || event.metaKey) && key === 'z') {
40
- return 'historyUndo';
41
- }
42
- return false;
43
- };
44
- const getAriaLabel = (triggerPrefix, intl) => {
45
- switch (triggerPrefix) {
46
- case '@':
47
- return typeAheadListMessages.mentionInputLabel;
48
- case '/':
49
- return typeAheadListMessages.quickInsertInputLabel;
50
- case ':':
51
- return typeAheadListMessages.emojiInputLabel;
52
- default:
53
- return typeAheadListMessages.quickInsertInputLabel;
54
- }
55
- };
56
- export const InputQuery = /*#__PURE__*/React.memo(({
57
- triggerQueryPrefix,
58
- cancel,
59
- onQueryChange,
60
- onItemSelect,
61
- selectNextItem,
62
- selectPreviousItem,
63
- forceFocus,
64
- reopenQuery,
65
- onQueryFocus,
66
- onUndoRedo,
67
- editorView,
68
- items
69
- }) => {
70
- const ref = useRef(document.createElement('span'));
71
- const inputRef = useRef(null);
72
- const [query, setQuery] = useState(null);
73
- const cleanedInputContent = useCallback(() => {
74
- var _ref$current;
75
- const raw = ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.textContent) || '';
76
- return raw;
77
- }, []);
78
- const onKeyUp = useCallback(event => {
79
- const text = cleanedInputContent();
80
- onQueryChange(text);
81
- }, [onQueryChange, cleanedInputContent]);
82
- const [isInFocus, setInFocus] = useState(false);
83
- const checkKeyEvent = useCallback(event => {
84
- var _ref$current2;
85
- const key = keyNameNormalized(event);
86
- const sel = document.getSelection();
87
- const raw = ((_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.textContent) || '';
88
- const text = cleanedInputContent();
89
- let stopDefault = false;
90
- const {
91
- selectedIndex
92
- } = getPluginState(editorView.state) || {};
93
- setInFocus(true);
94
- switch (key) {
95
- case ' ':
96
- // space key
97
- if (text.length === 0) {
98
- cancel({
99
- forceFocusOnEditor: true,
100
- text: ' ',
101
- addPrefixTrigger: true,
102
- setSelectionAt: CloseSelectionOptions.AFTER_TEXT_INSERTED
103
- });
104
- stopDefault = true;
105
- }
106
- break;
107
- case 'Escape':
108
- case 'PageUp':
109
- case 'PageDown':
110
- case 'Home':
111
- cancel({
112
- text,
113
- forceFocusOnEditor: true,
114
- addPrefixTrigger: true,
115
- setSelectionAt: CloseSelectionOptions.AFTER_TEXT_INSERTED
116
- });
117
- stopDefault = true;
118
- break;
119
- case 'Backspace':
120
- if (raw.length === 0 || (sel === null || sel === void 0 ? void 0 : sel.anchorOffset) === 0) {
121
- event.stopPropagation();
122
- event.preventDefault();
123
- cancel({
124
- forceFocusOnEditor: true,
125
- text,
126
- addPrefixTrigger: false,
127
- setSelectionAt: CloseSelectionOptions.BEFORE_TEXT_INSERTED
128
- });
129
- }
130
- break;
131
- case 'Enter':
132
- // ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
133
- // event.isComposing can't be used alone as this also included a virtual keyboard under a keyboardless device, therefore, it seems the best practice would be intercepting the event as below.
134
- // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
135
- if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
136
- if (selectedIndex === -1) {
137
- /**
138
- * TODO DTR-1401: (also see ED-17200) There are two options
139
- * here, either
140
- * - set the index directly to 1 in WrapperTypeAhead.tsx's
141
- * `insertSelectedItem` at the cost of breaking some of the a11y
142
- * focus changes,
143
- * - or do this jank at the cost of some small analytics noise.
144
- *
145
- * The focus behaviour still needs cleanup
146
- */
147
- selectPreviousItem();
148
- selectNextItem();
149
- }
150
- onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
151
- }
152
- break;
153
- case 'Tab':
154
- if (selectedIndex === -1) {
155
- /**
156
- * TODO DTR-1401: (also see ED-17200) There are two options
157
- * here, either
158
- * - set the index directly to 1 in WrapperTypeAhead.tsx's
159
- * `insertSelectedItem` at the cost of breaking some of the a11y
160
- * focus changes,
161
- * - or do this jank at the cost of some small analytics noise.
162
- *
163
- */
164
- selectPreviousItem();
165
- selectNextItem();
166
- }
167
- // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
168
- onItemSelect(SelectItemMode.TAB);
169
- break;
170
- case 'ArrowDown':
171
- selectNextItem();
172
- break;
173
- case 'ArrowUp':
174
- selectPreviousItem();
175
- break;
176
- }
177
- const undoRedoType = isUndoRedoShortcut(event);
178
- if (onUndoRedo && undoRedoType && onUndoRedo(undoRedoType)) {
179
- stopDefault = true;
180
- }
181
- if (isNavigationKey(event) || stopDefault) {
182
- event.stopPropagation();
183
- event.preventDefault();
184
- return false;
185
- }
186
- }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
187
- const onClick = useCallback(event => {
188
- var _inputRef$current;
189
- event.stopPropagation();
190
- event.preventDefault();
191
- onQueryFocus();
192
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
193
- return false;
194
- }, [onQueryFocus]);
195
- useLayoutEffect(() => {
196
- if (!ref.current) {
197
- return;
198
- }
199
- const {
200
- current: element
201
- } = ref;
202
- const onFocusIn = event => {
203
- onQueryFocus();
204
- };
205
- const keyDown = event => {
206
- const key = keyNameNormalized(event);
207
- if (['ArrowLeft', 'ArrowRight'].includes(key) && document.getSelection && document.getSelection()) {
208
- var _ref$current3;
209
- const q = ((_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.textContent) || '';
210
- const sel = document.getSelection();
211
- const isMovingRight = sel && 'ArrowRight' === key && sel.anchorOffset === q.length;
212
- const isMovingLeft = sel && 'ArrowLeft' === key && (sel.anchorOffset === 0 || event.metaKey);
213
- if (!isMovingRight && !isMovingLeft) {
214
- return;
215
- }
216
- cancel({
217
- forceFocusOnEditor: true,
218
- addPrefixTrigger: true,
219
- text: cleanedInputContent(),
220
- setSelectionAt: isMovingRight ? CloseSelectionOptions.AFTER_TEXT_INSERTED : CloseSelectionOptions.BEFORE_TEXT_INSERTED
221
- });
222
- event.preventDefault();
223
- event.stopPropagation();
224
- return;
225
- }
226
- checkKeyEvent(event);
227
- };
228
- const onFocusOut = event => {
229
- var _window$getSelection;
230
- const {
231
- relatedTarget
232
- } = event;
233
-
234
- // Given the user is changing the focus
235
- // When the target is inside the TypeAhead Popup
236
- // Then the popup should stay open
237
- if (relatedTarget instanceof HTMLElement && relatedTarget.closest && relatedTarget.closest(`.${TYPE_AHEAD_POPUP_CONTENT_CLASS}`)) {
238
- return;
239
- }
240
-
241
- // See ED-14909: Chrome may emit focusout events where an input
242
- // device was not directly responsible. (This rears in react v17+ consumers
243
- // where react-managed node removal now appears to propagate focusout events to
244
- // our event listener). As this path is strictly for click or other typeahead
245
- // dismissals that don't involve typeahead item selection, we carve out an
246
- // exception for Chrome-specific events where an input device was not the initiator.
247
- if (browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') && !('sourceCapabilities' in event && event.sourceCapabilities)) {
248
- return;
249
- }
250
- cancel({
251
- addPrefixTrigger: true,
252
- text: cleanedInputContent(),
253
- setSelectionAt: CloseSelectionOptions.BEFORE_TEXT_INSERTED,
254
- forceFocusOnEditor: false
255
- });
256
- };
257
- const close = () => {
258
- cancel({
259
- addPrefixTrigger: false,
260
- text: '',
261
- forceFocusOnEditor: true,
262
- setSelectionAt: CloseSelectionOptions.BEFORE_TEXT_INSERTED
263
- });
264
- };
265
- const beforeinput = e => {
266
- var _target$textContent;
267
- setInFocus(false);
268
- const {
269
- target
270
- } = e;
271
- if (e.isComposing || !(target instanceof HTMLElement)) {
272
- return;
273
- }
274
- if (e.inputType === 'historyUndo' && ((_target$textContent = target.textContent) === null || _target$textContent === void 0 ? void 0 : _target$textContent.length) === 0) {
275
- e.preventDefault();
276
- e.stopPropagation();
277
- close();
278
- return;
279
- }
280
- if (e.data != null && inputRef.current === null) {
281
- setQuery('');
282
-
283
- // We need to change the content on Safari
284
- // and set the cursor at the right place
285
- if (browser.safari) {
286
- e.preventDefault();
287
- const dataElement = document.createTextNode(e.data);
288
- element.appendChild(dataElement);
289
- const sel = window.getSelection();
290
- const range = document.createRange();
291
- range.setStart(dataElement, dataElement.length);
292
- range.collapse(true);
293
- sel === null || sel === void 0 ? void 0 : sel.removeAllRanges();
294
- sel === null || sel === void 0 ? void 0 : sel.addRange(range);
295
- }
296
- }
297
- };
298
- let onInput = null;
299
- if (browser.safari) {
300
- // On Safari, for reasons beyond my understanding,
301
- // The undo behavior is totally different from other browsers
302
- // That why we need to have an specific branch only for Safari.
303
- const onInput = e => {
304
- var _target$textContent2;
305
- const {
306
- target
307
- } = e;
308
- if (e.isComposing || !(target instanceof HTMLElement)) {
309
- return;
310
- }
311
- if (e.inputType === 'historyUndo' && ((_target$textContent2 = target.textContent) === null || _target$textContent2 === void 0 ? void 0 : _target$textContent2.length) === 1) {
312
- e.preventDefault();
313
- e.stopPropagation();
314
- close();
315
- return;
316
- }
317
- };
318
- element.addEventListener('input', onInput);
319
- }
320
- element.addEventListener('focusout', onFocusOut);
321
- element.addEventListener('focusin', onFocusIn);
322
- element.addEventListener('keydown', keyDown);
323
- element.addEventListener('beforeinput', beforeinput);
324
- return () => {
325
- element.removeEventListener('focusout', onFocusOut);
326
- element.removeEventListener('focusin', onFocusIn);
327
- element.removeEventListener('keydown', keyDown);
328
- element.removeEventListener('beforeinput', beforeinput);
329
- if (browser.safari) {
330
- element.removeEventListener('input', onInput);
331
- }
332
- };
333
- }, [triggerQueryPrefix, cleanedInputContent, onQueryFocus, cancel, checkKeyEvent, editorView.state]);
334
- useLayoutEffect(() => {
335
- const hasReopenQuery = typeof reopenQuery === 'string' && reopenQuery.trim().length > 0;
336
- if (ref.current && forceFocus) {
337
- setQuery(hasReopenQuery ? reopenQuery : null);
338
- requestAnimationFrame(() => {
339
- if (!(ref !== null && ref !== void 0 && ref.current)) {
340
- return;
341
- }
342
- const sel = window.getSelection();
343
- if (sel && hasReopenQuery && ref.current.lastChild instanceof Text) {
344
- const lastChild = ref.current.lastChild;
345
- const range = document.createRange();
346
- range.setStart(ref.current.lastChild, lastChild.length);
347
- range.collapse(true);
348
- sel.removeAllRanges();
349
- sel.addRange(range);
350
- }
351
- ref.current.focus();
352
- setInFocus(true);
353
- });
354
- }
355
- }, [forceFocus, reopenQuery]);
356
- const assistiveHintID = TYPE_AHEAD_DECORATION_ELEMENT_ID + '__assistiveHint';
357
- const intl = useIntl();
358
-
359
- /**
360
- When we migrated to emotion from styled component, we started getting this error.
361
- jsx-a11y/interactive-supports-focus
362
- Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
363
- */
364
- return jsx(Fragment, null, triggerQueryPrefix, jsx("span", {
365
- css: querySpan,
366
- contentEditable: true,
367
- ref: ref,
368
- onKeyUp: onKeyUp,
369
- onClick: onClick,
370
- role: "combobox",
371
- "aria-controls": TYPE_AHEAD_DECORATION_ELEMENT_ID,
372
- "aria-autocomplete": "list",
373
- "aria-expanded": items.length !== 0,
374
- "aria-labelledby": assistiveHintID,
375
- suppressContentEditableWarning: true,
376
- "data-query-prefix": triggerQueryPrefix
377
- }, query === null ? jsx("input", {
378
- ref: inputRef,
379
- type: "text"
380
- }) : query), jsx("span", {
381
- id: assistiveHintID,
382
- style: {
383
- display: 'none'
384
- }
385
- }, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(typeAheadListMessages.inputQueryAssistiveLabel)), jsx(AssistiveText, {
386
- assistiveText: items.length === 0 ? intl.formatMessage(typeAheadListMessages.noSearchResultsLabel, {
387
- itemsLength: items.length
388
- }) : '',
389
- isInFocus: items.length === 0 || isInFocus,
390
- id: TYPE_AHEAD_DECORATION_ELEMENT_ID
391
- }));
392
- });
393
- InputQuery.displayName = 'InputQuery';