@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,308 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
9
- var _templateObject;
10
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
- /** @jsx jsx */
13
-
14
- import React from 'react';
15
- import { css, jsx } from '@emotion/react';
16
- import { withAnalyticsEvents } from '@atlaskit/analytics-next';
17
- import { Popup } from '@atlaskit/editor-common/ui';
18
- import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
19
- import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
20
- import { borderRadius } from '@atlaskit/theme/constants';
21
- import { N0 } from '@atlaskit/theme/colors';
22
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
23
- import { DEFAULT_STATUS } from '../actions';
24
- import { analyticsState, createStatusAnalyticsAndFire } from '../analytics';
25
- var PopupWithListeners = withOuterListeners(Popup);
26
- export var InputMethod = /*#__PURE__*/function (InputMethod) {
27
- InputMethod["blur"] = "blur";
28
- InputMethod["escKey"] = "escKey";
29
- InputMethod["enterKey"] = "enterKey";
30
- return InputMethod;
31
- }({});
32
- export var closingMethods = /*#__PURE__*/function (closingMethods) {
33
- closingMethods["ArrowLeft"] = "arrowLeft";
34
- closingMethods["ArrowRight"] = "arrowRight";
35
- return closingMethods;
36
- }({});
37
- var pickerContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n padding: ", " 0;\n border-radius: ", "px;\n box-shadow: ", ";\n :focus {\n outline: none;\n }\n input {\n text-transform: uppercase;\n }\n"])), "var(--ds-surface-overlay, ".concat(N0, ")"), "var(--ds-space-100, 8px)", borderRadius(), "var(--ds-shadow-overlay, 0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25))");
38
- export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
39
- _inherits(StatusPickerWithoutAnalytcs, _React$Component);
40
- var _super = _createSuper(StatusPickerWithoutAnalytcs);
41
- function StatusPickerWithoutAnalytcs(props) {
42
- var _this;
43
- _classCallCheck(this, StatusPickerWithoutAnalytcs);
44
- _this = _super.call(this, props);
45
- _defineProperty(_assertThisInitialized(_this), "handleClickOutside", function (event) {
46
- event.preventDefault();
47
- _this.inputMethod = InputMethod.blur;
48
- var selectedText = window.getSelection();
49
- if (!selectedText) {
50
- _this.props.closeStatusPicker();
51
- }
52
- });
53
- _defineProperty(_assertThisInitialized(_this), "handleEscapeKeydown", function (event) {
54
- event.preventDefault();
55
- _this.inputMethod = InputMethod.escKey;
56
- _this.props.onEnter(_this.state);
57
- });
58
- _defineProperty(_assertThisInitialized(_this), "handleTabPress", function (event) {
59
- var colorButtons = event.currentTarget.querySelectorAll('button');
60
- var inputField = event.currentTarget.querySelector('input');
61
- var isInputFocussed = document.activeElement === inputField;
62
- var isButtonFocussed = Array.from(colorButtons).some(function (buttonElement) {
63
- var _document;
64
- return ((_document = document) === null || _document === void 0 ? void 0 : _document.activeElement) === buttonElement;
65
- });
66
- if (event !== null && event !== void 0 && event.shiftKey) {
67
- /* shift + tab */
68
- if (isInputFocussed) {
69
- colorButtons[0].focus();
70
- event.preventDefault();
71
- }
72
- /* After the user presses shift + tab the color-palette component updates tab index for the first color to be 0.
73
- To correctly set focus to the input field instead of the first color button we need to set focus manually
74
- */
75
- if (isButtonFocussed) {
76
- inputField === null || inputField === void 0 || inputField.focus();
77
- event.preventDefault();
78
- }
79
- } else {
80
- /* tab */
81
- if (isButtonFocussed) {
82
- inputField === null || inputField === void 0 || inputField.focus();
83
- event.preventDefault();
84
- }
85
- }
86
- });
87
- _defineProperty(_assertThisInitialized(_this), "handleArrow", function (event, closingMethod) {
88
- var _document2;
89
- if (((_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.activeElement) === _this.popupBodyWrapper.current) {
90
- var _this$popupBodyWrappe;
91
- event.preventDefault();
92
- (_this$popupBodyWrappe = _this.popupBodyWrapper) === null || _this$popupBodyWrappe === void 0 || (_this$popupBodyWrappe = _this$popupBodyWrappe.current) === null || _this$popupBodyWrappe === void 0 || _this$popupBodyWrappe.blur();
93
- _this.props.closeStatusPicker({
94
- closingMethod: closingMethod
95
- });
96
- }
97
- });
98
- _defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
99
- var isTabPressed = event.key === 'Tab';
100
- if (isTabPressed) {
101
- return _this.handleTabPress(event);
102
- }
103
- if (event.key in closingMethods) {
104
- return _this.handleArrow(event, closingMethods[event.key]);
105
- }
106
- });
107
- _defineProperty(_assertThisInitialized(_this), "onColorHover", function (color) {
108
- _this.createStatusAnalyticsAndFireFunc({
109
- action: 'hovered',
110
- actionSubject: 'statusColorPicker',
111
- attributes: {
112
- color: color,
113
- localId: _this.state.localId,
114
- state: analyticsState(_this.props.isNew)
115
- }
116
- });
117
- });
118
- _defineProperty(_assertThisInitialized(_this), "onColorClick", function (color) {
119
- var _this$state = _this.state,
120
- text = _this$state.text,
121
- localId = _this$state.localId;
122
- if (color === _this.state.color) {
123
- _this.createStatusAnalyticsAndFireFunc({
124
- action: 'clicked',
125
- actionSubject: 'statusColorPicker',
126
- attributes: {
127
- color: color,
128
- localId: localId,
129
- state: analyticsState(_this.props.isNew)
130
- }
131
- });
132
- // closes status box and commits colour
133
- _this.onEnter();
134
- } else {
135
- _this.setState({
136
- color: color
137
- });
138
- _this.props.onSelect({
139
- text: text,
140
- color: color,
141
- localId: localId
142
- });
143
- }
144
- });
145
- _defineProperty(_assertThisInitialized(_this), "onTextChanged", function (text) {
146
- var _this$state2 = _this.state,
147
- color = _this$state2.color,
148
- localId = _this$state2.localId;
149
- _this.setState({
150
- text: text
151
- });
152
- _this.props.onTextChanged({
153
- text: text,
154
- color: color,
155
- localId: localId
156
- }, !!_this.props.isNew);
157
- });
158
- _defineProperty(_assertThisInitialized(_this), "onEnter", function () {
159
- _this.inputMethod = InputMethod.enterKey;
160
- _this.props.onEnter(_this.state);
161
- });
162
- // cancel bubbling to fix clickOutside logic:
163
- // popup re-renders its content before the click event bubbles up to the document
164
- // therefore click target element would be different from the popup content
165
- _defineProperty(_assertThisInitialized(_this), "handlePopupClick", function (event) {
166
- return event.nativeEvent.stopImmediatePropagation();
167
- });
168
- _this.state = _this.extractStateFromProps(props);
169
- _this.createStatusAnalyticsAndFireFunc = createStatusAnalyticsAndFire(props.createAnalyticsEvent);
170
- _this.popupBodyWrapper = /*#__PURE__*/React.createRef();
171
- return _this;
172
- }
173
- _createClass(StatusPickerWithoutAnalytcs, [{
174
- key: "fireStatusPopupOpenedAnalytics",
175
- value: function fireStatusPopupOpenedAnalytics(state) {
176
- var color = state.color,
177
- text = state.text,
178
- localId = state.localId,
179
- isNew = state.isNew;
180
- this.startTime = Date.now();
181
- this.createStatusAnalyticsAndFireFunc({
182
- action: 'opened',
183
- actionSubject: 'statusPopup',
184
- attributes: {
185
- textLength: text ? text.length : 0,
186
- selectedColor: color,
187
- localId: localId,
188
- state: analyticsState(isNew)
189
- }
190
- });
191
- }
192
- }, {
193
- key: "fireStatusPopupClosedAnalytics",
194
- value: function fireStatusPopupClosedAnalytics(state) {
195
- var color = state.color,
196
- text = state.text,
197
- localId = state.localId,
198
- isNew = state.isNew;
199
- this.createStatusAnalyticsAndFireFunc({
200
- action: 'closed',
201
- actionSubject: 'statusPopup',
202
- attributes: {
203
- inputMethod: this.inputMethod,
204
- duration: Date.now() - this.startTime,
205
- textLength: text ? text.length : 0,
206
- selectedColor: color,
207
- localId: localId,
208
- state: analyticsState(isNew)
209
- }
210
- });
211
- }
212
- }, {
213
- key: "reset",
214
- value: function reset() {
215
- this.startTime = Date.now();
216
- this.inputMethod = InputMethod.blur;
217
- }
218
- }, {
219
- key: "componentDidMount",
220
- value: function componentDidMount() {
221
- var _this2 = this;
222
- this.reset();
223
- this.fireStatusPopupOpenedAnalytics(this.state);
224
- if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
225
- // Wrapper should be focused only if status already exists otherwise input field will receive focus
226
- this.focusTimeout = requestAnimationFrame(function () {
227
- var _this2$popupBodyWrapp;
228
- // Defer to prevent editor scrolling to top. See https://product-fabric.atlassian.net/browse/DTR-1952
229
- (_this2$popupBodyWrapp = _this2.popupBodyWrapper) === null || _this2$popupBodyWrapp === void 0 || (_this2$popupBodyWrapp = _this2$popupBodyWrapp.current) === null || _this2$popupBodyWrapp === void 0 || _this2$popupBodyWrapp.focus();
230
- });
231
- }
232
- }
233
- }, {
234
- key: "componentWillUnmount",
235
- value: function componentWillUnmount() {
236
- this.focusTimeout && cancelAnimationFrame(this.focusTimeout);
237
- this.fireStatusPopupClosedAnalytics(this.state);
238
- this.startTime = 0;
239
- }
240
- }, {
241
- key: "componentDidUpdate",
242
- value: function componentDidUpdate(prevProps, prevState, _snapshot) {
243
- var element = this.props.target;
244
- if (prevProps.target !== element) {
245
- var newState = this.extractStateFromProps(this.props);
246
- this.setState(newState);
247
- this.fireStatusPopupClosedAnalytics(prevState);
248
- this.reset();
249
- this.fireStatusPopupOpenedAnalytics(newState);
250
- }
251
- }
252
- }, {
253
- key: "extractStateFromProps",
254
- value: function extractStateFromProps(props) {
255
- var defaultColor = props.defaultColor,
256
- defaultText = props.defaultText,
257
- defaultLocalId = props.defaultLocalId,
258
- isNew = props.isNew;
259
- return {
260
- color: defaultColor || DEFAULT_STATUS.color,
261
- text: defaultText || DEFAULT_STATUS.text,
262
- localId: defaultLocalId,
263
- isNew: isNew
264
- };
265
- }
266
- }, {
267
- key: "render",
268
- value: function render() {
269
- var _this$props = this.props,
270
- isNew = _this$props.isNew,
271
- target = _this$props.target,
272
- mountTo = _this$props.mountTo,
273
- boundariesElement = _this$props.boundariesElement,
274
- scrollableElement = _this$props.scrollableElement;
275
- var _this$state3 = this.state,
276
- color = _this$state3.color,
277
- text = _this$state3.text;
278
- return target && jsx(PopupWithListeners, {
279
- target: target,
280
- offset: [0, 8],
281
- handleClickOutside: this.handleClickOutside,
282
- handleEscapeKeydown: this.handleEscapeKeydown,
283
- zIndex: akEditorFloatingDialogZIndex,
284
- fitHeight: 40,
285
- mountTo: mountTo,
286
- boundariesElement: boundariesElement,
287
- scrollableElement: scrollableElement,
288
- closeOnTab: false
289
- }, jsx("div", {
290
- css: pickerContainer,
291
- tabIndex: -1,
292
- ref: this.popupBodyWrapper,
293
- onClick: this.handlePopupClick,
294
- onKeyDown: this.onKeyDown
295
- }, jsx(AkStatusPicker, {
296
- autoFocus: isNew,
297
- selectedColor: color,
298
- text: text,
299
- onColorClick: this.onColorClick,
300
- onColorHover: this.onColorHover,
301
- onTextChanged: this.onTextChanged,
302
- onEnter: this.onEnter
303
- })));
304
- }
305
- }]);
306
- return StatusPickerWithoutAnalytcs;
307
- }(React.Component);
308
- export default withAnalyticsEvents()(StatusPickerWithoutAnalytcs);
@@ -1,16 +0,0 @@
1
- import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
- export var mayGetStatusAtSelection = function mayGetStatusAtSelection(selection) {
3
- if (selection && selection instanceof NodeSelection) {
4
- var nodeSelection = selection;
5
- if (nodeSelection.node.type.name === 'status') {
6
- return selection.node.attrs || null;
7
- }
8
- }
9
- return null;
10
- };
11
- export var isEmptyStatus = function isEmptyStatus(node) {
12
- return node && (node.text && node.text.trim().length === 0 || node.text === '');
13
- };
14
- export var setNodeSelectionNearPos = function setNodeSelectionNearPos(tr, pos) {
15
- return tr.setSelection(NodeSelection.create(tr.doc, tr.mapping.map(pos)));
16
- };
@@ -1,209 +0,0 @@
1
- import { TypeAheadAvailableNodes, SelectItemMode } from '@atlaskit/editor-common/type-ahead';
2
- import { findHandler, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
3
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
- import { openTypeAheadAtCursor } from './transforms/open-typeahead-at-cursor';
5
- import { closeTypeAhead } from './transforms/close-type-ahead';
6
- import { updateQuery } from './commands/update-query';
7
- import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
8
- var open = function open(_ref) {
9
- var editorView = _ref.editorView;
10
- return function (itemType) {
11
- return function (inputMethod) {
12
- var state = editorView.state;
13
- var handler = findHandler(itemType, state);
14
- if (!handler) {
15
- return false;
16
- }
17
- var tr = state.tr;
18
- openTypeAheadAtCursor({
19
- triggerHandler: handler,
20
- inputMethod: inputMethod
21
- })({
22
- tr: tr
23
- });
24
- editorView.dispatch(tr);
25
- return true;
26
- };
27
- };
28
- };
29
- var defaultCloseOptions = {
30
- insertCurrentQueryAsRawText: false
31
- };
32
- var close = function close(_ref2) {
33
- var editorView = _ref2.editorView;
34
- return function () {
35
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultCloseOptions;
36
- var state = editorView.state;
37
- var currentQuery = getTypeAheadQuery(editorView.state);
38
- var tr = state.tr;
39
- if (options.attachCommand) {
40
- var fakeDispatch = function fakeDispatch(customTr) {
41
- tr = customTr;
42
- };
43
- options.attachCommand(state, fakeDispatch);
44
- }
45
- closeTypeAhead(tr);
46
- if (options.insertCurrentQueryAsRawText && currentQuery && currentQuery.length > 0) {
47
- var handler = getTypeAheadHandler(state);
48
- var text = handler.trigger.concat(currentQuery);
49
- tr.replaceSelectionWith(state.schema.text(text));
50
- }
51
- editorView.dispatch(tr);
52
- if (!editorView.hasFocus()) {
53
- editorView.focus();
54
- }
55
- return true;
56
- };
57
- };
58
- var search = function search(_ref3) {
59
- var editorView = _ref3.editorView;
60
- return function (itemType) {
61
- return function () {
62
- var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
63
- var state = editorView.state;
64
- var handler = findHandler(itemType, state);
65
- if (!handler) {
66
- throw new Error("Handler not found, did you load the ".concat(itemType, " plugin properly"));
67
- }
68
- open({
69
- editorView: editorView
70
- })(itemType)(INPUT_METHOD.KEYBOARD);
71
- updateQuery(query)(editorView.state, editorView.dispatch);
72
- var lastQuery = {
73
- current: query
74
- };
75
- var last = handler.getItems({
76
- query: query,
77
- editorState: state
78
- }).then(function (items) {
79
- if (!handler.forceSelect) {
80
- return items;
81
- }
82
- var forceSelectedItem = handler.forceSelect({
83
- items: items,
84
- query: query,
85
- editorState: state
86
- });
87
- if (!forceSelectedItem) {
88
- return items;
89
- }
90
- insertTypeAheadItem(editorView)({
91
- handler: handler,
92
- item: forceSelectedItem,
93
- query: query,
94
- mode: SelectItemMode.SELECTED,
95
- sourceListItem: items
96
- });
97
- });
98
- var results = {
99
- last: last
100
- };
101
- return {
102
- type: function type(appendValue) {
103
- if (!appendValue) {
104
- return;
105
- }
106
- lastQuery.current += appendValue;
107
- updateQuery(lastQuery.current)(editorView.state, editorView.dispatch);
108
- var promise = handler.getItems({
109
- query: lastQuery.current,
110
- editorState: state
111
- });
112
- results.last = promise;
113
- return promise;
114
- },
115
- result: function result() {
116
- return results.last;
117
- },
118
- close: close({
119
- editorView: editorView
120
- }),
121
- insert: function insert(_ref4) {
122
- var index = _ref4.index,
123
- mode = _ref4.mode;
124
- return results.last.then(function (result) {
125
- var item = result ? result[index] : null;
126
- if (result && item) {
127
- insertTypeAheadItem(editorView)({
128
- handler: handler,
129
- item: item,
130
- query: query,
131
- mode: mode || SelectItemMode.SELECTED,
132
- sourceListItem: result
133
- });
134
- }
135
- });
136
- }
137
- };
138
- };
139
- };
140
- };
141
- var insertItem = function insertItem(_ref5) {
142
- var editorView = _ref5.editorView;
143
- return function (itemType) {
144
- return function (_ref6) {
145
- var contentItem = _ref6.contentItem,
146
- query = _ref6.query,
147
- sourceListItem = _ref6.sourceListItem;
148
- var state = editorView.state;
149
- var handler = findHandler(itemType, state);
150
- if (!handler) {
151
- return false;
152
- }
153
- insertTypeAheadItem(editorView)({
154
- handler: handler,
155
- item: contentItem,
156
- mode: SelectItemMode.SELECTED,
157
- query: query,
158
- sourceListItem: sourceListItem
159
- });
160
- return true;
161
- };
162
- };
163
- };
164
- var isOpen = function isOpen(_ref7) {
165
- var editorView = _ref7.editorView;
166
- return function () {
167
- if (!isTypeAheadOpen(editorView.state)) {
168
- return false;
169
- }
170
- var handler = getTypeAheadHandler(editorView.state);
171
- if (!handler) {
172
- return false;
173
- }
174
- return handler;
175
- };
176
- };
177
- var currentQuery = function currentQuery(_ref8) {
178
- var editorView = _ref8.editorView;
179
- return function () {
180
- return getTypeAheadQuery(editorView.state);
181
- };
182
- };
183
-
184
- /**
185
- * Please do not use it. Ping #help-editor and talk to the Lego team before use it.
186
- *
187
- * @private
188
- * @deprecated
189
- *
190
- */
191
- export var createTypeAheadTools = function createTypeAheadTools(editorView) {
192
- var props = {
193
- editorView: editorView
194
- };
195
- return {
196
- isOpen: isOpen(props),
197
- currentQuery: currentQuery(props),
198
- close: close(props),
199
- openMention: open(props)(TypeAheadAvailableNodes.MENTION),
200
- searchMention: search(props)(TypeAheadAvailableNodes.MENTION),
201
- openQuickInsert: open(props)(TypeAheadAvailableNodes.QUICK_INSERT),
202
- searchQuickInsert: search(props)(TypeAheadAvailableNodes.QUICK_INSERT),
203
- openEmoji: open(props)(TypeAheadAvailableNodes.EMOJI),
204
- searchEmoji: search(props)(TypeAheadAvailableNodes.EMOJI),
205
- insertItemMention: insertItem(props)(TypeAheadAvailableNodes.MENTION),
206
- insertItemEmoji: insertItem(props)(TypeAheadAvailableNodes.EMOJI),
207
- insertItemQuickInsert: insertItem(props)(TypeAheadAvailableNodes.QUICK_INSERT)
208
- };
209
- };