@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,151 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
- import { InsertTypeAheadStep, InsertTypeAheadStages } from '@atlaskit/adf-schema/steps';
6
- import { ACTIONS } from './actions';
7
- import { pluginKey } from './key';
8
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
9
- import { isTypeAheadHandler } from '../utils';
10
- var shouldForceOpen = function shouldForceOpen(step) {
11
- if (!(step instanceof InsertTypeAheadStep)) {
12
- return false;
13
- }
14
- var isDeletionRawQueryOperation = step.isInsertionStep() && step.stage === InsertTypeAheadStages.DELETING_RAW_QUERY;
15
- var isUndoingInsertionItem = step.isUndoingStep() && step.stage === InsertTypeAheadStages.INSERTING_ITEM;
16
- return isDeletionRawQueryOperation || isUndoingInsertionItem;
17
- };
18
- var shouldForceClose = function shouldForceClose(step) {
19
- if (!(step instanceof InsertTypeAheadStep)) {
20
- return false;
21
- }
22
- var isInsertingItem = step.isInsertionStep() && step.stage === InsertTypeAheadStages.INSERTING_ITEM;
23
- var isUndoingDeletionRawQuery = step.isUndoingStep() && step.stage === InsertTypeAheadStages.DELETING_RAW_QUERY;
24
- return isInsertingItem || isUndoingDeletionRawQuery;
25
- };
26
- var createFindHandler = function createFindHandler(typeAheadHandlers) {
27
- return function (step) {
28
- if (!(step instanceof InsertTypeAheadStep)) {
29
- return null;
30
- }
31
- var handler = typeAheadHandlers.find(function (h) {
32
- return h.trigger === step.trigger;
33
- });
34
- return handler || null;
35
- };
36
- };
37
- export var createReducer = function createReducer(_ref) {
38
- var typeAheadHandlers = _ref.typeAheadHandlers,
39
- removeDecorations = _ref.removeDecorations,
40
- createDecorations = _ref.createDecorations;
41
- var findHandler = createFindHandler(typeAheadHandlers);
42
- var openMenu = function openMenu(currentPluginState, _ref2) {
43
- var tr = _ref2.tr,
44
- triggerHandler = _ref2.triggerHandler,
45
- inputMethod = _ref2.inputMethod,
46
- reopenQuery = _ref2.reopenQuery,
47
- selectedIndex = _ref2.selectedIndex;
48
- removeDecorations(currentPluginState.decorationSet);
49
- var _createDecorations = createDecorations(tr, {
50
- triggerHandler: triggerHandler,
51
- inputMethod: inputMethod,
52
- reopenQuery: reopenQuery
53
- }),
54
- decorationSet = _createDecorations.decorationSet,
55
- decorationElement = _createDecorations.decorationElement,
56
- stats = _createDecorations.stats;
57
- return _objectSpread(_objectSpread({}, currentPluginState), {}, {
58
- stats: stats,
59
- decorationSet: decorationSet,
60
- triggerHandler: triggerHandler,
61
- decorationElement: decorationElement,
62
- inputMethod: inputMethod,
63
- selectedIndex: typeof selectedIndex === 'number' ? selectedIndex : -1,
64
- items: [],
65
- query: reopenQuery || ''
66
- });
67
- };
68
- var closeMenu = function closeMenu(currentPluginState) {
69
- removeDecorations(currentPluginState.decorationSet);
70
- return _objectSpread(_objectSpread({}, currentPluginState), {}, {
71
- inputMethod: null,
72
- query: '',
73
- decorationElement: null,
74
- decorationSet: DecorationSet.empty,
75
- stats: null,
76
- triggerHandler: undefined,
77
- items: []
78
- });
79
- };
80
- return function (tr, currentPluginState, typeAheadStepOverride) {
81
- var meta = tr.getMeta(pluginKey) || {};
82
-
83
- // This code below controls when we should force
84
- // the menu to open or close during undo/redo operations
85
- var overrideHandler = findHandler(typeAheadStepOverride);
86
- if (typeAheadStepOverride && overrideHandler && shouldForceOpen(typeAheadStepOverride)) {
87
- return openMenu(currentPluginState, {
88
- tr: tr,
89
- triggerHandler: overrideHandler,
90
- inputMethod: INPUT_METHOD.KEYBOARD,
91
- reopenQuery: typeAheadStepOverride.query,
92
- selectedIndex: typeAheadStepOverride.selectedIndex
93
- });
94
- } else if (shouldForceClose(typeAheadStepOverride)) {
95
- return closeMenu(currentPluginState);
96
- }
97
- var _ref3 = meta || {},
98
- action = _ref3.action,
99
- params = _ref3.params;
100
- var shouldOpenMenu = action === ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR && isTypeAheadHandler(params === null || params === void 0 ? void 0 : params.triggerHandler);
101
- var selectionChanged = tr.selectionSet && (tr.isGeneric || Boolean(tr.getMeta('pointer')));
102
- var shouldCloseMenu = [ACTIONS.CLOSE_TYPE_AHEAD, ACTIONS.INSERT_ITEM].includes(action) || selectionChanged;
103
- var shouldUpdateQuery = action === ACTIONS.CHANGE_QUERY;
104
- var shouldUpdateListItems = action === ACTIONS.UPDATE_LIST_ITEMS;
105
- var shouldUpdateSelectedIndex = action === ACTIONS.UPDATE_SELECTED_INDEX;
106
- if (shouldOpenMenu) {
107
- return openMenu(currentPluginState, {
108
- tr: tr,
109
- triggerHandler: params.triggerHandler,
110
- inputMethod: params.inputMethod
111
- });
112
- } else if (shouldCloseMenu) {
113
- return closeMenu(currentPluginState);
114
- } else if (shouldUpdateQuery) {
115
- return _objectSpread(_objectSpread({}, currentPluginState), {}, {
116
- query: params.query
117
- });
118
- } else if (shouldUpdateListItems) {
119
- var items = params.items;
120
- var selectedIndex = currentPluginState.selectedIndex;
121
- return _objectSpread(_objectSpread({}, currentPluginState), {}, {
122
- items: items,
123
- selectedIndex: Math.max(selectedIndex >= items.length ? items.length - 1 : selectedIndex, -1)
124
- });
125
- } else if (shouldUpdateSelectedIndex) {
126
- return _objectSpread(_objectSpread({}, currentPluginState), {}, {
127
- selectedIndex: params.selectedIndex
128
- });
129
- }
130
- if (tr.docChanged) {
131
- var decorationSet = currentPluginState.decorationSet;
132
- var onRemove = function onRemove() {
133
- // Make sure we are unmounting the component
134
- // from the react tree when this decoration is removed
135
- removeDecorations(currentPluginState.decorationSet);
136
- };
137
- var mappedDecorationSet = decorationSet.map(tr.mapping, tr.doc, {
138
- onRemove: onRemove
139
- });
140
-
141
- // return same pluginState if decorationSet did not change
142
- if (mappedDecorationSet === currentPluginState.decorationSet) {
143
- return currentPluginState;
144
- }
145
- return _objectSpread(_objectSpread({}, currentPluginState), {}, {
146
- decorationSet: mappedDecorationSet
147
- });
148
- }
149
- return currentPluginState;
150
- };
151
- };
@@ -1,12 +0,0 @@
1
- import { pluginKey } from './key';
2
- export var isInsertionTransaction = function isInsertionTransaction(transactions, action) {
3
- var _tr$getMeta2;
4
- var tr = transactions.find(function (tr) {
5
- var _tr$getMeta;
6
- return ((_tr$getMeta = tr.getMeta(pluginKey)) === null || _tr$getMeta === void 0 ? void 0 : _tr$getMeta.action) === action;
7
- });
8
- if (!tr) {
9
- return null;
10
- }
11
- return (_tr$getMeta2 = tr.getMeta(pluginKey)) === null || _tr$getMeta2 === void 0 ? void 0 : _tr$getMeta2.params;
12
- };
@@ -1,35 +0,0 @@
1
- import _createClass from "@babel/runtime/helpers/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- export var StatsModifier = /*#__PURE__*/_createClass(function StatsModifier() {
5
- var _this = this;
6
- _classCallCheck(this, StatsModifier);
7
- _defineProperty(this, "startedAt", 0);
8
- _defineProperty(this, "endedAt", 0);
9
- _defineProperty(this, "keyCount", {
10
- arrowUp: 0,
11
- arrowDown: 0
12
- });
13
- _defineProperty(this, "increaseArrowUp", function () {
14
- _this.keyCount.arrowUp += 1;
15
- });
16
- _defineProperty(this, "increaseArrowDown", function () {
17
- _this.keyCount.arrowDown += 1;
18
- });
19
- _defineProperty(this, "serialize", function () {
20
- var _this$keyCount, _this$keyCount2;
21
- return {
22
- startedAt: _this.startedAt,
23
- endedAt: performance.now(),
24
- keyCount: {
25
- arrowUp: ((_this$keyCount = _this.keyCount) === null || _this$keyCount === void 0 ? void 0 : _this$keyCount.arrowUp) || 0,
26
- arrowDown: ((_this$keyCount2 = _this.keyCount) === null || _this$keyCount2 === void 0 ? void 0 : _this$keyCount2.arrowDown) || 0
27
- }
28
- };
29
- });
30
- this.startedAt = performance.now();
31
- this.keyCount = {
32
- arrowUp: 0,
33
- arrowDown: 0
34
- };
35
- });
@@ -1,7 +0,0 @@
1
- import { pluginKey } from '../pm-plugins/key';
2
- import { ACTIONS } from '../pm-plugins/actions';
3
- export var closeTypeAhead = function closeTypeAhead(tr) {
4
- return tr.setMeta(pluginKey, {
5
- action: ACTIONS.CLOSE_TYPE_AHEAD
6
- });
7
- };
@@ -1,69 +0,0 @@
1
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { GapCursorSelection } from '@atlaskit/editor-common/selection';
3
- import { pluginKey } from '../pm-plugins/key';
4
- import { ACTIONS } from '../pm-plugins/actions';
5
- export var openTypeAhead = function openTypeAhead(props) {
6
- return function (tr) {
7
- var triggerHandler = props.triggerHandler,
8
- inputMethod = props.inputMethod,
9
- query = props.query;
10
- tr.setMeta(pluginKey, {
11
- action: ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR,
12
- params: {
13
- triggerHandler: triggerHandler,
14
- inputMethod: inputMethod,
15
- query: query
16
- }
17
- });
18
- };
19
- };
20
- export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
21
- var triggerHandler = _ref.triggerHandler,
22
- inputMethod = _ref.inputMethod,
23
- query = _ref.query;
24
- return function (_ref2) {
25
- var tr = _ref2.tr;
26
- openTypeAhead({
27
- triggerHandler: triggerHandler,
28
- inputMethod: inputMethod,
29
- query: query
30
- })(tr);
31
- var selection = tr.selection;
32
- if (!(selection instanceof TextSelection || selection instanceof GapCursorSelection)) {
33
- return tr;
34
- }
35
- if (selection instanceof GapCursorSelection) {
36
- // Create space for the typeahead menu in gap cursor
37
- tr.insertText(' ');
38
- // delete 1 pos before wherever selection is now - that will delete the empty space
39
- tr.delete(tr.selection.from - 1, tr.selection.from);
40
- } else {
41
- var _selection$$head, _selection$$head$pare, _selection$$head$pare2;
42
- if (!selection.$cursor) {
43
- tr.deleteSelection();
44
- return tr;
45
- }
46
-
47
- // Search & Destroy placeholder
48
- var cursorPos = selection.$cursor.pos;
49
- var nodeAtCursor = tr.doc.nodeAt(cursorPos);
50
- var isPlaceholderAtCursorPosition = nodeAtCursor && nodeAtCursor.type.name === 'placeholder';
51
- if (nodeAtCursor && isPlaceholderAtCursorPosition) {
52
- tr.delete(cursorPos, cursorPos + nodeAtCursor.nodeSize);
53
- }
54
-
55
- // ME-2375 remove the superfluous '@' inserted before decoration
56
- // by composition (https://github.com/ProseMirror/prosemirror/issues/903)
57
- //
58
- // Update:
59
- // Now also handles any use case with superfluous typeahead triggers (ie. '@', ':', '/')
60
- // being inserted due to composition by checking if we have the trigger
61
- // directly before the typeahead. This should not happen unless it has
62
- // been eroneously added because we require whitespace/newline for typeahead.
63
- if (cursorPos >= 2 && !!(selection !== null && selection !== void 0 && (_selection$$head = selection.$head) !== null && _selection$$head !== void 0 && (_selection$$head = _selection$$head.parent) !== null && _selection$$head !== void 0 && _selection$$head.textContent) && (_selection$$head$pare = (_selection$$head$pare2 = selection.$head.parent.textContent).endsWith) !== null && _selection$$head$pare !== void 0 && _selection$$head$pare.call(_selection$$head$pare2, triggerHandler.trigger)) {
64
- tr.delete(cursorPos - 1, cursorPos);
65
- }
66
- }
67
- return tr;
68
- };
69
- };
@@ -1,12 +0,0 @@
1
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
- export var setSelectionBeforeQuery = function setSelectionBeforeQuery(rawText) {
3
- return function (tr) {
4
- var currentPosition = tr.selection.$from.pos;
5
- var positionBeforeRawText = Math.max(currentPosition - rawText.length, 0);
6
- var resolvedPositionBeforeText = tr.doc.resolve(positionBeforeRawText);
7
- var nextSelection = TextSelection.findFrom(resolvedPositionBeforeText, -1, true);
8
- if (nextSelection) {
9
- tr.setSelection(nextSelection);
10
- }
11
- };
12
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,115 +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
- 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); }; }
9
- 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; } }
10
- /** @jsx jsx */
11
-
12
- import debounce from 'lodash/debounce';
13
- import React from 'react';
14
- import { css, jsx } from '@emotion/react';
15
- var statusDebounceMillis = 1400;
16
- var assitiveTextStyles = css({
17
- border: 0,
18
- clip: 'rect(0 0 0 0)',
19
- height: '1px',
20
- marginbottom: '-1px',
21
- marginright: '-1px',
22
- overflow: 'hidden',
23
- padding: 0,
24
- position: 'absolute',
25
- whitespace: 'nowrap',
26
- width: '1px'
27
- });
28
- var AssistveTextComponent = /*#__PURE__*/function (_React$Component) {
29
- _inherits(AssistveTextComponent, _React$Component);
30
- var _super = _createSuper(AssistveTextComponent);
31
- function AssistveTextComponent() {
32
- var _this;
33
- _classCallCheck(this, AssistveTextComponent);
34
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35
- args[_key] = arguments[_key];
36
- }
37
- _this = _super.call.apply(_super, [this].concat(args));
38
- _defineProperty(_assertThisInitialized(_this), "state", {
39
- bump: false,
40
- //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
41
- debounced: false,
42
- silenced: false
43
- });
44
- return _this;
45
- }
46
- _createClass(AssistveTextComponent, [{
47
- key: "componentWillMount",
48
- value: function componentWillMount() {
49
- var _this2 = this;
50
- this.debounceStatusUpdate = debounce(function () {
51
- if (!_this2.state.debounced) {
52
- var shouldSilence = !_this2.props.isInFocus;
53
- _this2.setState(function (_ref) {
54
- var bump = _ref.bump;
55
- return {
56
- bump: !bump,
57
- debounced: true,
58
- silenced: shouldSilence
59
- };
60
- });
61
- }
62
- }, statusDebounceMillis);
63
- }
64
- }, {
65
- key: "componentWillUnmount",
66
- value: function componentWillUnmount() {
67
- this.debounceStatusUpdate.cancel();
68
- }
69
- }, {
70
- key: "componentWillReceiveProps",
71
- value: function componentWillReceiveProps() {
72
- this.setState(function (_ref2) {
73
- var bump = _ref2.bump;
74
- return {
75
- bump: !bump,
76
- debounced: false
77
- };
78
- });
79
- }
80
- }, {
81
- key: "render",
82
- value: function render() {
83
- var _this$props = this.props,
84
- assistiveText = _this$props.assistiveText,
85
- id = _this$props.id;
86
- var _this$state = this.state,
87
- bump = _this$state.bump,
88
- debounced = _this$state.debounced,
89
- silenced = _this$state.silenced;
90
- this.debounceStatusUpdate();
91
- return jsx("div", {
92
- css: assitiveTextStyles
93
- }, jsx("div", {
94
- id: id + '__status--A',
95
- role: "status",
96
- "aria-atomic": "true",
97
- "aria-live": "polite"
98
- }, "".concat(!silenced && debounced && bump ? assistiveText : '')), jsx("div", {
99
- id: id + '__status--B',
100
- role: "status",
101
- "aria-atomic": "true",
102
- "aria-live": "polite"
103
- }, "".concat(!silenced && debounced && !bump ? assistiveText : '')));
104
- }
105
- }]);
106
- return AssistveTextComponent;
107
- }(React.Component);
108
- _defineProperty(AssistveTextComponent, "defaultProps", {
109
- statusDebounceMillis: 1400,
110
- debounce: true,
111
- assistiveText: '',
112
- isInFocus: false,
113
- id: ''
114
- });
115
- export var AssistiveText = AssistveTextComponent;