@atlaskit/editor-core 180.1.0 → 181.0.1

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 (426) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/cjs/actions/index.js +25 -10
  3. package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
  4. package/dist/cjs/create-editor/ReactEditorView.js +0 -5
  5. package/dist/cjs/create-editor/ReactEditorViewInternal.js +73 -103
  6. package/dist/cjs/create-editor/create-plugins-list.js +37 -5
  7. package/dist/cjs/create-editor/feature-flags-from-props.js +31 -26
  8. package/dist/cjs/create-editor/preset-utils.js +27 -0
  9. package/dist/cjs/editor-next/editor-internal.js +2 -2
  10. package/dist/cjs/editor-next/editor-migration-component.js +18 -2
  11. package/dist/cjs/editor-next/hooks/useProviderFactory.js +4 -3
  12. package/dist/cjs/editor-next/index.js +13 -9
  13. package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
  14. package/dist/cjs/editor-next/utils/handleProviders.js +17 -22
  15. package/dist/cjs/editor.js +20 -13
  16. package/dist/cjs/keymaps/consts.js +1 -16
  17. package/dist/cjs/labs/next/presets/cxhtml.js +56 -55
  18. package/dist/cjs/labs/next/presets/default.js +15 -42
  19. package/dist/cjs/labs/next/presets/mobile.js +76 -89
  20. package/dist/cjs/labs/next/presets/universal.js +330 -257
  21. package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
  22. package/dist/cjs/plugins/analytics/plugin.js +6 -0
  23. package/dist/cjs/plugins/annotation/utils.js +2 -36
  24. package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
  25. package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
  26. package/dist/cjs/plugins/caption/index.js +0 -7
  27. package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -4
  28. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
  29. package/dist/cjs/plugins/card/pm-plugins/main.js +6 -3
  30. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
  31. package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
  32. package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
  33. package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
  34. package/dist/cjs/plugins/context-panel/index.js +1 -6
  35. package/dist/cjs/plugins/data-consumer/index.js +0 -8
  36. package/dist/cjs/plugins/date/utils/internal.js +0 -4
  37. package/dist/cjs/plugins/extension/commands.js +1 -8
  38. package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
  39. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
  40. package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
  41. package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
  42. package/dist/cjs/plugins/floating-toolbar/ui/Button.js +7 -3
  43. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  44. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
  45. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  46. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +24 -8
  47. package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
  48. package/dist/cjs/plugins/fragment/index.js +0 -8
  49. package/dist/cjs/plugins/help-dialog/commands.js +2 -6
  50. package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
  51. package/dist/cjs/plugins/layout/styles.js +10 -1
  52. package/dist/cjs/plugins/list/utils/find.js +0 -28
  53. package/dist/cjs/plugins/list/utils/indentation.js +1 -25
  54. package/dist/cjs/plugins/list/utils/node.js +0 -5
  55. package/dist/cjs/plugins/list/utils/selection.js +2 -15
  56. package/dist/cjs/plugins/media/utils/media-common.js +1 -20
  57. package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
  58. package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
  59. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
  60. package/dist/cjs/plugins/mobile-dimensions/index.js +1 -4
  61. package/dist/cjs/plugins/paste/index.js +1 -2
  62. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +123 -87
  63. package/dist/cjs/plugins/paste/util/index.js +0 -46
  64. package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
  65. package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
  66. package/dist/cjs/plugins/status/utils.js +1 -15
  67. package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
  68. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  69. package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  70. package/dist/cjs/plugins/text-formatting/utils.js +1 -26
  71. package/dist/cjs/plugins/type-ahead/constants.js +1 -7
  72. package/dist/cjs/plugins/type-ahead/index.js +4 -1
  73. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +6 -37
  74. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +4 -2
  75. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +41 -4
  76. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  77. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  78. package/dist/cjs/plugins/type-ahead/utils.js +25 -24
  79. package/dist/cjs/test-utils.js +4 -12
  80. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
  81. package/dist/cjs/ui/ColorPalette/index.js +18 -0
  82. package/dist/cjs/ui/ColorPickerButton/index.js +6 -2
  83. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
  84. package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
  85. package/dist/cjs/ui/ContentStyles/index.js +1 -1
  86. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  87. package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
  88. package/dist/cjs/ui/Resizer/utils.js +1 -3
  89. package/dist/cjs/ui/styles.js +3 -7
  90. package/dist/cjs/utils/get-editor-plugins.js +1 -3
  91. package/dist/cjs/utils/index.js +9 -269
  92. package/dist/cjs/utils/input-rules.js +1 -15
  93. package/dist/cjs/version-wrapper.js +1 -1
  94. package/dist/cjs/version.json +1 -1
  95. package/dist/es2019/actions/index.js +23 -9
  96. package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
  97. package/dist/es2019/create-editor/ReactEditorView.js +0 -5
  98. package/dist/es2019/create-editor/ReactEditorViewInternal.js +67 -82
  99. package/dist/es2019/create-editor/create-plugins-list.js +32 -5
  100. package/dist/es2019/create-editor/feature-flags-from-props.js +31 -26
  101. package/dist/es2019/create-editor/preset-utils.js +15 -0
  102. package/dist/es2019/editor-next/editor-internal.js +2 -2
  103. package/dist/es2019/editor-next/editor-migration-component.js +19 -2
  104. package/dist/es2019/editor-next/hooks/useProviderFactory.js +4 -3
  105. package/dist/es2019/editor-next/index.js +13 -7
  106. package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
  107. package/dist/es2019/editor-next/utils/handleProviders.js +18 -24
  108. package/dist/es2019/editor.js +20 -11
  109. package/dist/es2019/keymaps/consts.js +7 -11
  110. package/dist/es2019/labs/next/presets/cxhtml.js +56 -53
  111. package/dist/es2019/labs/next/presets/default.js +18 -38
  112. package/dist/es2019/labs/next/presets/mobile.js +88 -88
  113. package/dist/es2019/labs/next/presets/universal.js +338 -265
  114. package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
  115. package/dist/es2019/plugins/analytics/plugin.js +7 -0
  116. package/dist/es2019/plugins/annotation/utils.js +2 -30
  117. package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
  118. package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
  119. package/dist/es2019/plugins/caption/index.js +0 -2
  120. package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -4
  121. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
  122. package/dist/es2019/plugins/card/pm-plugins/main.js +6 -3
  123. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
  124. package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
  125. package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
  126. package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
  127. package/dist/es2019/plugins/context-panel/index.js +0 -3
  128. package/dist/es2019/plugins/data-consumer/index.js +0 -7
  129. package/dist/es2019/plugins/date/utils/internal.js +0 -3
  130. package/dist/es2019/plugins/extension/commands.js +0 -6
  131. package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
  132. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
  133. package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
  134. package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
  135. package/dist/es2019/plugins/floating-toolbar/ui/Button.js +7 -3
  136. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  137. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
  138. package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  139. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +21 -4
  140. package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
  141. package/dist/es2019/plugins/fragment/index.js +0 -7
  142. package/dist/es2019/plugins/help-dialog/commands.js +1 -2
  143. package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
  144. package/dist/es2019/plugins/layout/styles.js +12 -4
  145. package/dist/es2019/plugins/list/utils/find.js +0 -27
  146. package/dist/es2019/plugins/list/utils/indentation.js +0 -23
  147. package/dist/es2019/plugins/list/utils/node.js +1 -4
  148. package/dist/es2019/plugins/list/utils/selection.js +2 -15
  149. package/dist/es2019/plugins/media/utils/media-common.js +1 -19
  150. package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
  151. package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
  152. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
  153. package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
  154. package/dist/es2019/plugins/paste/index.js +1 -2
  155. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +126 -94
  156. package/dist/es2019/plugins/paste/util/index.js +5 -45
  157. package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
  158. package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
  159. package/dist/es2019/plugins/status/utils.js +1 -11
  160. package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
  161. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  162. package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  163. package/dist/es2019/plugins/text-formatting/utils.js +0 -19
  164. package/dist/es2019/plugins/type-ahead/constants.js +0 -5
  165. package/dist/es2019/plugins/type-ahead/index.js +4 -1
  166. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +4 -37
  167. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +4 -2
  168. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +41 -4
  169. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  170. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  171. package/dist/es2019/plugins/type-ahead/utils.js +22 -25
  172. package/dist/es2019/test-utils.js +4 -7
  173. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
  174. package/dist/es2019/ui/ColorPalette/index.js +2 -1
  175. package/dist/es2019/ui/ColorPickerButton/index.js +6 -2
  176. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
  177. package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
  178. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  179. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  180. package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
  181. package/dist/es2019/ui/Resizer/utils.js +0 -1
  182. package/dist/es2019/ui/styles.js +0 -6
  183. package/dist/es2019/utils/get-editor-plugins.js +1 -3
  184. package/dist/es2019/utils/index.js +13 -199
  185. package/dist/es2019/utils/input-rules.js +0 -14
  186. package/dist/es2019/version-wrapper.js +1 -1
  187. package/dist/es2019/version.json +1 -1
  188. package/dist/esm/actions/index.js +23 -9
  189. package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
  190. package/dist/esm/create-editor/ReactEditorView.js +0 -5
  191. package/dist/esm/create-editor/ReactEditorViewInternal.js +73 -102
  192. package/dist/esm/create-editor/create-plugins-list.js +36 -5
  193. package/dist/esm/create-editor/feature-flags-from-props.js +31 -26
  194. package/dist/esm/create-editor/preset-utils.js +21 -0
  195. package/dist/esm/editor-next/editor-internal.js +2 -2
  196. package/dist/esm/editor-next/editor-migration-component.js +18 -2
  197. package/dist/esm/editor-next/hooks/useProviderFactory.js +4 -3
  198. package/dist/esm/editor-next/index.js +13 -9
  199. package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
  200. package/dist/esm/editor-next/utils/handleProviders.js +17 -22
  201. package/dist/esm/editor.js +20 -13
  202. package/dist/esm/keymaps/consts.js +7 -11
  203. package/dist/esm/labs/next/presets/cxhtml.js +56 -55
  204. package/dist/esm/labs/next/presets/default.js +18 -41
  205. package/dist/esm/labs/next/presets/mobile.js +88 -90
  206. package/dist/esm/labs/next/presets/universal.js +330 -257
  207. package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
  208. package/dist/esm/plugins/analytics/plugin.js +6 -0
  209. package/dist/esm/plugins/annotation/utils.js +2 -32
  210. package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
  211. package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
  212. package/dist/esm/plugins/caption/index.js +0 -2
  213. package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -4
  214. package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
  215. package/dist/esm/plugins/card/pm-plugins/main.js +6 -3
  216. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
  217. package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
  218. package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
  219. package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
  220. package/dist/esm/plugins/context-panel/index.js +0 -3
  221. package/dist/esm/plugins/data-consumer/index.js +0 -7
  222. package/dist/esm/plugins/date/utils/internal.js +0 -3
  223. package/dist/esm/plugins/extension/commands.js +0 -6
  224. package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
  225. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
  226. package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
  227. package/dist/esm/plugins/feedback-dialog/index.js +0 -2
  228. package/dist/esm/plugins/floating-toolbar/ui/Button.js +7 -3
  229. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  230. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
  231. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  232. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +24 -8
  233. package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
  234. package/dist/esm/plugins/fragment/index.js +0 -7
  235. package/dist/esm/plugins/help-dialog/commands.js +0 -3
  236. package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
  237. package/dist/esm/plugins/layout/styles.js +11 -2
  238. package/dist/esm/plugins/list/utils/find.js +0 -27
  239. package/dist/esm/plugins/list/utils/indentation.js +0 -23
  240. package/dist/esm/plugins/list/utils/node.js +1 -4
  241. package/dist/esm/plugins/list/utils/selection.js +2 -12
  242. package/dist/esm/plugins/media/utils/media-common.js +1 -17
  243. package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
  244. package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
  245. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
  246. package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
  247. package/dist/esm/plugins/paste/index.js +1 -2
  248. package/dist/esm/plugins/paste/pm-plugins/analytics.js +122 -86
  249. package/dist/esm/plugins/paste/util/index.js +5 -45
  250. package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
  251. package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
  252. package/dist/esm/plugins/status/utils.js +1 -13
  253. package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
  254. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  255. package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  256. package/dist/esm/plugins/text-formatting/utils.js +0 -21
  257. package/dist/esm/plugins/type-ahead/constants.js +0 -5
  258. package/dist/esm/plugins/type-ahead/index.js +4 -1
  259. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +4 -33
  260. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +4 -2
  261. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +41 -4
  262. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  263. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  264. package/dist/esm/plugins/type-ahead/utils.js +24 -22
  265. package/dist/esm/test-utils.js +4 -7
  266. package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
  267. package/dist/esm/ui/ColorPalette/index.js +2 -1
  268. package/dist/esm/ui/ColorPickerButton/index.js +6 -2
  269. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
  270. package/dist/esm/ui/ConfigPanel/utils.js +3 -14
  271. package/dist/esm/ui/ContentStyles/index.js +1 -1
  272. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  273. package/dist/esm/ui/ElementBrowser/constants.js +0 -1
  274. package/dist/esm/ui/Resizer/utils.js +0 -1
  275. package/dist/esm/ui/styles.js +2 -5
  276. package/dist/esm/utils/get-editor-plugins.js +1 -3
  277. package/dist/esm/utils/index.js +13 -196
  278. package/dist/esm/utils/input-rules.js +0 -13
  279. package/dist/esm/version-wrapper.js +1 -1
  280. package/dist/esm/version.json +1 -1
  281. package/dist/types/actions/index.d.ts +4 -4
  282. package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
  283. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +9 -7
  284. package/dist/types/create-editor/ReactEditorViewNext.d.ts +3 -4
  285. package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
  286. package/dist/types/create-editor/preset-utils.d.ts +2 -0
  287. package/dist/types/editor-next/editor-internal.d.ts +9 -9
  288. package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +2 -2
  289. package/dist/types/editor-next/hooks/useProviderFactory.d.ts +2 -2
  290. package/dist/types/editor-next/index.d.ts +6 -6
  291. package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -2
  292. package/dist/types/editor-next/utils/editorPropTypes.d.ts +1 -1
  293. package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
  294. package/dist/types/editor-next/utils/handleProviders.d.ts +2 -2
  295. package/dist/types/editor-next/utils/onEditorCreated.d.ts +2 -2
  296. package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
  297. package/dist/types/editor.d.ts +7 -4
  298. package/dist/types/keymaps/consts.d.ts +0 -11
  299. package/dist/types/labs/next/presets/cxhtml.d.ts +33 -1
  300. package/dist/types/labs/next/presets/default.d.ts +67 -10
  301. package/dist/types/labs/next/presets/mobile.d.ts +33 -1
  302. package/dist/types/labs/next/presets/universal.d.ts +5 -13
  303. package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
  304. package/dist/types/nodeviews/context-adapter.d.ts +0 -1
  305. package/dist/types/nodeviews/index.d.ts +0 -1
  306. package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
  307. package/dist/types/plugins/annotation/utils.d.ts +0 -17
  308. package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
  309. package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
  310. package/dist/types/plugins/caption/index.d.ts +0 -2
  311. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
  312. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -0
  313. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  314. package/dist/types/plugins/code-block/actions.d.ts +0 -4
  315. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
  316. package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
  317. package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
  318. package/dist/types/plugins/context-panel/index.d.ts +2 -3
  319. package/dist/types/plugins/data-consumer/index.d.ts +0 -2
  320. package/dist/types/plugins/date/utils/internal.d.ts +0 -1
  321. package/dist/types/plugins/extension/commands.d.ts +0 -1
  322. package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
  323. package/dist/types/plugins/feedback-dialog/index.d.ts +0 -2
  324. package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +3 -1
  325. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
  326. package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
  327. package/dist/types/plugins/fragment/index.d.ts +0 -2
  328. package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
  329. package/dist/types/plugins/history/actions.d.ts +1 -2
  330. package/dist/types/plugins/layout/styles.d.ts +2 -1
  331. package/dist/types/plugins/list/utils/find.d.ts +0 -1
  332. package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
  333. package/dist/types/plugins/list/utils/node.d.ts +0 -2
  334. package/dist/types/plugins/list/utils/selection.d.ts +0 -3
  335. package/dist/types/plugins/media/utils/media-common.d.ts +0 -5
  336. package/dist/types/plugins/mentions/types.d.ts +1 -2
  337. package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
  338. package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
  339. package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
  340. package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -1
  341. package/dist/types/plugins/paste/index.d.ts +0 -1
  342. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -3
  343. package/dist/types/plugins/paste/util/index.d.ts +0 -6
  344. package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
  345. package/dist/types/plugins/status/utils.d.ts +0 -3
  346. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
  347. package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
  348. package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
  349. package/dist/types/plugins/text-formatting/utils.d.ts +0 -4
  350. package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
  351. package/dist/types/plugins/type-ahead/index.d.ts +1 -0
  352. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +2 -11
  353. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +2 -1
  354. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +1 -0
  355. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +1 -0
  356. package/dist/types/plugins/type-ahead/utils.d.ts +3 -3
  357. package/dist/types/test-utils.d.ts +4 -5
  358. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  359. package/dist/types/types/editor-props.d.ts +55 -42
  360. package/dist/types/ui/Appearance/Chromeless.d.ts +0 -5
  361. package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
  362. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
  363. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
  364. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
  365. package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
  366. package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
  367. package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
  368. package/dist/types/ui/ColorPalette/index.d.ts +2 -1
  369. package/dist/types/ui/ColorPickerButton/index.d.ts +4 -2
  370. package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
  371. package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
  372. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  373. package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
  374. package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
  375. package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
  376. package/dist/types/ui/Resizer/utils.d.ts +0 -1
  377. package/dist/types/ui/styles.d.ts +0 -1
  378. package/dist/types/utils/index.d.ts +6 -65
  379. package/dist/types/utils/input-rules.d.ts +1 -2
  380. package/dist/types/utils/table.d.ts +0 -1
  381. package/package.json +23 -24
  382. package/report.api.md +155 -146
  383. package/dist/cjs/labs/next/presets/preset.js +0 -101
  384. package/dist/cjs/plugins/analytics/types/type-ahead.js +0 -5
  385. package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
  386. package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
  387. package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
  388. package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
  389. package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
  390. package/dist/cjs/profiler/render-count.js +0 -60
  391. package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
  392. package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
  393. package/dist/cjs/ui/WithPluginState/types.js +0 -5
  394. package/dist/es2019/labs/next/presets/preset.js +0 -68
  395. package/dist/es2019/plugins/analytics/types/type-ahead.js +0 -1
  396. package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
  397. package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
  398. package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
  399. package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
  400. package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
  401. package/dist/es2019/profiler/render-count.js +0 -53
  402. package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
  403. package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
  404. package/dist/es2019/ui/WithPluginState/types.js +0 -1
  405. package/dist/esm/labs/next/presets/preset.js +0 -93
  406. package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
  407. package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
  408. package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
  409. package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
  410. package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
  411. package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
  412. package/dist/esm/profiler/render-count.js +0 -49
  413. package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
  414. package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
  415. package/dist/esm/ui/WithPluginState/types.js +0 -1
  416. package/dist/types/labs/next/presets/preset.d.ts +0 -46
  417. package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
  418. package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
  419. package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
  420. package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
  421. package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
  422. package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
  423. package/dist/types/profiler/render-count.d.ts +0 -14
  424. package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
  425. package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
  426. package/dist/types/ui/WithPluginState/types.d.ts +0 -10
@@ -0,0 +1,25 @@
1
+ import { useLayoutEffect, useState } from 'react';
2
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
+ import { usePreviousState } from '@atlaskit/editor-common/hooks';
4
+ import { createPreset } from '../../../create-editor/create-plugins-list';
5
+ import { shouldRecreatePreset } from '../../../create-editor/preset-utils';
6
+ export default function useUniversalPreset({
7
+ props
8
+ }) {
9
+ const {
10
+ createAnalyticsEvent
11
+ } = useAnalyticsEvents();
12
+ const previousEditorProps = usePreviousState(props);
13
+ const [preset, setPreset] = useState(() => createPreset(props, previousEditorProps));
14
+ useLayoutEffect(() => {
15
+ if (!previousEditorProps) {
16
+ return;
17
+ }
18
+ const recreate = shouldRecreatePreset(previousEditorProps, props);
19
+ if (!recreate) {
20
+ return;
21
+ }
22
+ setPreset(createPreset(props, previousEditorProps, createAnalyticsEvent));
23
+ }, [props, previousEditorProps, createAnalyticsEvent]);
24
+ return preset;
25
+ }
@@ -22,6 +22,13 @@ function createPlugin(options) {
22
22
  },
23
23
  apply: (tr, pluginState, _, state) => {
24
24
  var _getFeatureFlags;
25
+ if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
26
+ // When the plugin state is reconfigured, the init function isn't called again
27
+ return {
28
+ ...pluginState,
29
+ createAnalyticsEvent: options.createAnalyticsEvent
30
+ };
31
+ }
25
32
  if ((_getFeatureFlags = getFeatureFlags(state)) !== null && _getFeatureFlags !== void 0 && _getFeatureFlags.catchAllTracking) {
26
33
  const analyticsEventWithChannel = getAnalyticsEventsFromTransaction(tr);
27
34
  if (analyticsEventWithChannel.length > 0) {
@@ -24,7 +24,7 @@ export const surroundingMarks = $pos => {
24
24
  * Finds annotation marks, and returns their IDs.
25
25
  * @param marks Array of marks to search in
26
26
  */
27
- export const filterAnnotationIds = marks => {
27
+ const filterAnnotationIds = marks => {
28
28
  if (!marks.length) {
29
29
  return [];
30
30
  }
@@ -44,7 +44,7 @@ export const filterAnnotationIds = marks => {
44
44
  * @param annotations annotation metadata
45
45
  * @param $from location to look around (usually the selection)
46
46
  */
47
- export const reorderAnnotations = (annotations, $from) => {
47
+ const reorderAnnotations = (annotations, $from) => {
48
48
  const idSet = surroundingMarks($from).map(filterAnnotationIds);
49
49
  annotations.sort((a, b) => sum(idSet, ids => ids.indexOf(a.id)) - sum(idSet, ids => ids.indexOf(b.id)));
50
50
  };
@@ -84,34 +84,6 @@ const validateAnnotationMark = annotationMark => {
84
84
  }
85
85
  };
86
86
 
87
- // helper function: return the first selection range for the window
88
- const getSelectionRange = function () {
89
- const selection = window.getSelection();
90
-
91
- // no selection made in browser
92
- if (!selection || selection.isCollapsed) {
93
- return null;
94
- }
95
- const selectionRange = selection.getRangeAt(0);
96
- return selectionRange;
97
- };
98
-
99
- // helper function: find the bounds of first part within selected content
100
- export const getSelectionStartRect = () => {
101
- const range = getSelectionRange();
102
- if (!range) {
103
- return null;
104
- }
105
- const rects = range.getClientRects();
106
- if (!rects.length) {
107
- return null;
108
- }
109
- // Find first selection area that width is not 0
110
- // Sometimes there is a chance that user is selecting an empty DOM node.
111
- const firstRect = Array.from(rects).find(rect => rect.width !== 0 && rect.height !== 0);
112
- return firstRect || null;
113
- };
114
-
115
87
  /*
116
88
  * add decoration for the comment selection in draft state
117
89
  * (when creating new comment)
@@ -45,6 +45,4 @@ export const plugin = new SafePlugin({
45
45
  }
46
46
  };
47
47
  }
48
- });
49
- const plugins = () => [plugin];
50
- export default plugins;
48
+ });
@@ -10,22 +10,16 @@ function getHeadingLevel(match) {
10
10
  level: match[1].length
11
11
  };
12
12
  }
13
- export function headingRule(nodeType, maxLevel) {
13
+ function headingRule(nodeType, maxLevel) {
14
14
  return createWrappingTextBlockRule({
15
15
  match: new RegExp('^(#{1,' + maxLevel + '})\\s$'),
16
16
  nodeType,
17
17
  getAttrs: getHeadingLevel
18
18
  });
19
19
  }
20
- export function blockQuoteRule(nodeType) {
20
+ function blockQuoteRule(nodeType) {
21
21
  return createJoinNodesRule(/^\s*>\s$/, nodeType);
22
22
  }
23
- export function codeBlockRule(nodeType) {
24
- return createWrappingTextBlockRule({
25
- match: /^```$/,
26
- nodeType
27
- });
28
- }
29
23
 
30
24
  /**
31
25
  * Get heading rules
@@ -130,7 +124,7 @@ function getCodeBlockRules(schema) {
130
124
  });
131
125
  return [ruleAnalytics(threeTildeRule), ruleAnalytics(leftNodeReplacementThreeTildeRule)];
132
126
  }
133
- export function inputRulePlugin(schema, featureFlags) {
127
+ function inputRulePlugin(schema, featureFlags) {
134
128
  const rules = [];
135
129
  if (schema.nodes.heading) {
136
130
  rules.push(...getHeadingRules(schema));
@@ -1,8 +1,6 @@
1
1
  import { caption } from '@atlaskit/adf-schema';
2
2
  import { default as createCaptionPlugin } from './pm-plugins/main';
3
- import { pluginKey } from './pm-plugins/plugin-key';
4
3
  import { captionKeymap } from './pm-plugins/keymap';
5
- export { pluginKey };
6
4
  const captionPlugin = () => {
7
5
  return {
8
6
  name: 'caption',
@@ -59,7 +59,8 @@ export class BlockCardComponent extends React.PureComponent {
59
59
  const {
60
60
  node,
61
61
  cardContext,
62
- platform
62
+ platform,
63
+ showServerActions
63
64
  } = this.props;
64
65
  const {
65
66
  url,
@@ -74,7 +75,8 @@ export class BlockCardComponent extends React.PureComponent {
74
75
  onClick: this.onClick,
75
76
  onResolve: this.onResolve,
76
77
  showActions: platform === 'web',
77
- platform: platform
78
+ platform: platform,
79
+ showServerActions: showServerActions
78
80
  }), this.gapCursorSpan());
79
81
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
80
82
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -100,13 +102,15 @@ export class BlockCard extends ReactNodeView {
100
102
  }
101
103
  render() {
102
104
  const {
103
- platform
105
+ platform,
106
+ showServerActions
104
107
  } = this.reactComponentProps;
105
108
  return /*#__PURE__*/React.createElement(WrappedBlockCard, {
106
109
  node: this.node,
107
110
  view: this.view,
108
111
  getPos: this.getPos,
109
- platform: platform
112
+ platform: platform,
113
+ showServerActions: showServerActions
110
114
  });
111
115
  }
112
116
  }
@@ -51,6 +51,7 @@ export class InlineCardComponent extends React.PureComponent {
51
51
  const {
52
52
  node,
53
53
  cardContext,
54
+ showServerActions,
54
55
  useAlternativePreloader
55
56
  } = this.props;
56
57
  const {
@@ -68,7 +69,8 @@ export class InlineCardComponent extends React.PureComponent {
68
69
  container: this.scrollContainer,
69
70
  onResolve: this.onResolve,
70
71
  onError: this.onError,
71
- inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined
72
+ inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
73
+ showServerActions: showServerActions
72
74
  }));
73
75
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
74
76
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -86,12 +88,14 @@ export function InlineCardNodeView(props) {
86
88
  useAlternativePreloader,
87
89
  node,
88
90
  view,
89
- getPos
91
+ getPos,
92
+ showServerActions
90
93
  } = props;
91
94
  return /*#__PURE__*/React.createElement(WrappedInlineCard, {
92
95
  node: node,
93
96
  view: view,
94
97
  getPos: getPos,
98
+ showServerActions: showServerActions,
95
99
  useAlternativePreloader: useAlternativePreloader
96
100
  });
97
101
  }
@@ -16,7 +16,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
16
16
  allowResizing,
17
17
  useAlternativePreloader,
18
18
  fullWidthMode,
19
- createAnalyticsEvent
19
+ createAnalyticsEvent,
20
+ showServerActions
20
21
  } = options;
21
22
  return new SafePlugin({
22
23
  state: {
@@ -92,7 +93,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
92
93
  pmPluginFactoryParams,
93
94
  Component: InlineCardNodeView,
94
95
  extraComponentProps: {
95
- useAlternativePreloader
96
+ useAlternativePreloader,
97
+ showServerActions
96
98
  }
97
99
  }),
98
100
  blockCard: (node, view, getPos) => {
@@ -101,7 +103,8 @@ export const createPlugin = options => pmPluginFactoryParams => {
101
103
  eventDispatcher
102
104
  } = pmPluginFactoryParams;
103
105
  const reactComponentProps = {
104
- platform
106
+ platform,
107
+ showServerActions
105
108
  };
106
109
  const hasIntlContext = true;
107
110
  return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
@@ -21,6 +21,10 @@ export const resolveWithProvider = (view, outstandingRequests, provider, request
21
21
  };
22
22
  const updateCardType = (resolvedCard, options) => {
23
23
  if ((resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'blockCard' && !options.allowBlockCards || (resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'embedCard' && !options.allowEmbeds) {
24
+ // clean out the 'layout' attr from an embedCard type that should be transformed into the inlineCard type.
25
+ if (resolvedCard.type === 'embedCard') {
26
+ delete resolvedCard.attrs.layout;
27
+ }
24
28
  resolvedCard.type = 'inlineCard';
25
29
  }
26
30
  };
@@ -1,10 +1,2 @@
1
1
  import { pluginKey } from '../plugin-key';
2
- export const getPluginState = state => pluginKey.getState(state);
3
- export const setPluginState = stateProps => (state, dispatch) => {
4
- const pluginState = getPluginState(state);
5
- dispatch(state.tr.setMeta(pluginKey, {
6
- ...pluginState,
7
- ...stateProps
8
- }));
9
- return true;
10
- };
2
+ export const getPluginState = state => pluginKey.getState(state);
@@ -1 +1 @@
1
- export { PubSubSpecialEventType } from './types';
1
+ export {};
@@ -1,10 +1 @@
1
- /**
2
- * Same as PubSub client types (don't want a direct dep though)
3
- */
4
-
5
- export let PubSubSpecialEventType;
6
- (function (PubSubSpecialEventType) {
7
- PubSubSpecialEventType["ERROR"] = "ERROR";
8
- PubSubSpecialEventType["CONNECTED"] = "CONNECTED";
9
- PubSubSpecialEventType["RECONNECT"] = "RECONNECT";
10
- })(PubSubSpecialEventType || (PubSubSpecialEventType = {}));
1
+ export {};
@@ -1,9 +1,6 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from 'prosemirror-state';
3
3
  export const pluginKey = new PluginKey('contextPanelPluginKey');
4
- export function getPluginState(state) {
5
- return pluginKey.getState(state);
6
- }
7
4
  function contextPanelPluginFactory(contextPanels, dispatch) {
8
5
  return new SafePlugin({
9
6
  key: pluginKey,
@@ -1,11 +1,4 @@
1
1
  import { dataConsumer } from '@atlaskit/adf-schema';
2
- import { Plugin } from 'prosemirror-state';
3
- import { pluginKey } from './plugin-key';
4
- export function createPlugin() {
5
- return new Plugin({
6
- key: pluginKey
7
- });
8
- }
9
2
  const dataConsumerMarkPlugin = () => ({
10
3
  name: 'dataConsumerPlugin',
11
4
  marks() {
@@ -2,9 +2,6 @@ import { formatDateType, dateTypeToDate, dateToDateType } from './formatParse';
2
2
  import addDays from 'date-fns/addDays';
3
3
  import addMonths from 'date-fns/addMonths';
4
4
  import addYears from 'date-fns/addYears';
5
- export function padToTwo(number) {
6
- return number <= 99 ? `0${number}`.slice(-2) : `${number}`;
7
- }
8
5
  function isDigit(c) {
9
6
  if (c === undefined) {
10
7
  return false;
@@ -37,12 +37,6 @@ export const forceAutoSave = (resolve, reject) => createCommand({
37
37
  autoSaveReject: reject
38
38
  }
39
39
  }, applyChange);
40
- export const showContextPanel = createCommand({
41
- type: 'UPDATE_STATE',
42
- data: {
43
- showContextPanel: true
44
- }
45
- }, applyChange);
46
40
  export const updateExtensionLayout = layout => createCommand({
47
41
  type: 'UPDATE_STATE',
48
42
  data: {
@@ -44,7 +44,10 @@ function ExtensionWithPluginState(props) {
44
44
  'with-children': hasChildren,
45
45
  'without-frame': removeBorder
46
46
  });
47
- let customContainerStyles = {};
47
+ let customContainerStyles = {
48
+ width: '100%'
49
+ };
50
+ let newContentStyles = {};
48
51
  if (shouldBreakout) {
49
52
  const {
50
53
  type,
@@ -54,8 +57,15 @@ function ExtensionWithPluginState(props) {
54
57
  widthStateWidth: widthState.width,
55
58
  widthStateLineLength: widthState.lineLength
56
59
  });
60
+ newContentStyles = {
61
+ ...breakoutStyles
62
+ };
57
63
  customContainerStyles = breakoutStyles;
58
64
  }
65
+ newContentStyles = {
66
+ ...newContentStyles,
67
+ ...contentWrapper
68
+ };
59
69
  return jsx("div", {
60
70
  ref: handleRef,
61
71
  "data-layout": node.attrs.layout,
@@ -74,7 +84,7 @@ function ExtensionWithPluginState(props) {
74
84
  }, !removeBorder && jsx(ExtensionLozenge, {
75
85
  node: node
76
86
  }), children), hasBody && jsx("div", {
77
- css: contentWrapper
87
+ css: newContentStyles
78
88
  }, jsx("div", {
79
89
  css: content,
80
90
  ref: handleContentDOMRef,
@@ -40,7 +40,10 @@ export const content = theme => css`
40
40
  border: 1px solid ${`var(--ds-border, ${N30})`};
41
41
  border-radius: ${borderRadius()}px;
42
42
  cursor: initial;
43
+ width: 100%;
43
44
  `;
44
45
  export const contentWrapper = css`
45
46
  padding: 0 ${padding}px ${padding}px;
47
+ display: flex;
48
+ justify-content: center;
46
49
  `;
@@ -54,6 +54,7 @@ export default class ExtensionLozenge extends Component {
54
54
  const title = parameters && parameters.extensionTitle || parameters && parameters.macroMetadata && parameters.macroMetadata.title || extensionKey;
55
55
  const isBlockExtension = name === 'extension';
56
56
  return jsx("div", {
57
+ "data-testid": "lozenge-fallback",
57
58
  css: placeholderFallback
58
59
  }, lozengeData && !isBlockExtension ? this.renderImage({
59
60
  height: ICON_SIZE,
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
- import { PluginKey } from 'prosemirror-state';
3
2
  import { IconFeedback } from '../quick-insert/assets';
4
3
  import { version as coreVersion } from '../../version-wrapper';
5
4
  import { addAnalytics, ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '../analytics';
6
5
  import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
7
6
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
8
- export const pluginKey = new PluginKey('feedbackDialogPlugin');
9
7
  let showJiraCollectorDialog;
10
8
  let feedbackInfoHash;
11
9
  let defaultFeedbackInfo;
@@ -23,7 +23,9 @@ export default (({
23
23
  testId,
24
24
  hideTooltipOnClick = true,
25
25
  ariaHasPopup,
26
- tabIndex
26
+ tabIndex,
27
+ areaControls,
28
+ ariaLabel
27
29
  }) => {
28
30
  // Check if there's only an icon and add additional styles
29
31
  const iconOnly = (icon || iconAfter) && !children;
@@ -55,8 +57,10 @@ export default (({
55
57
  ...rest
56
58
  };
57
59
  },
58
- "aria-label": title,
59
- "aria-pressed": selected,
60
+ "aria-label": ariaLabel || title,
61
+ "aria-pressed": !ariaHasPopup ? selected : undefined,
62
+ "aria-expanded": ariaHasPopup ? selected : undefined,
63
+ "aria-controls": ariaHasPopup ? areaControls : undefined,
60
64
  spacing: 'compact',
61
65
  href: href,
62
66
  target: target,
@@ -66,9 +66,10 @@ export default class Dropdown extends Component {
66
66
  });
67
67
  _defineProperty(this, "hideOnEsc", () => {
68
68
  var _document$querySelect;
69
- this.hide();
70
- //Focus the trigger button only on Escape
69
+ // Focus the trigger button only on Escape
70
+ // Focus is done before hiding to ensure onBlur is called
71
71
  (_document$querySelect = document.querySelector(`[data-testid=${this.props.buttonTestId}]`)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
72
+ this.hide();
72
73
  });
73
74
  _defineProperty(this, "onOpenChanged", openChangedEvent => {
74
75
  if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
@@ -94,7 +95,8 @@ export default class Dropdown extends Component {
94
95
  tooltip,
95
96
  buttonTestId,
96
97
  dropdownWidth,
97
- editorView
98
+ editorView,
99
+ dropdownListId
98
100
  } = this.props;
99
101
  let trigger;
100
102
  if (icon) {
@@ -123,7 +125,9 @@ export default class Dropdown extends Component {
123
125
  onKeyDown: this.toggleOpenByKeyboard,
124
126
  selected: isOpen,
125
127
  disabled: disabled,
126
- tooltipContent: tooltip
128
+ tooltipContent: tooltip,
129
+ ariaHasPopup: true,
130
+ areaControls: dropdownListId
127
131
  }, title);
128
132
  }
129
133
 
@@ -146,7 +150,8 @@ export default class Dropdown extends Component {
146
150
  fitWidth: fitWidth + fitTolerance,
147
151
  fitHeight: fitHeight + fitTolerance,
148
152
  trigger: trigger,
149
- editorView: editorView
153
+ editorView: editorView,
154
+ dropdownListId: dropdownListId
150
155
  }, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
151
156
  hide: this.hide,
152
157
  dispatchCommand
@@ -13,14 +13,6 @@ import withOuterListeners from '../../../ui/with-outer-listeners';
13
13
  const emojiPickerButtonWrapper = css`
14
14
  position: relative;
15
15
  `;
16
-
17
- // helps to vertically align emoji picker
18
- // both top and bottom margin should be 2px
19
- // https://product-fabric.atlassian.net/browse/CETI-148
20
- const emojiPickerWrapper = css`
21
- margin-bottom: -12px;
22
- margin-top: -4px;
23
- `;
24
16
  const EmojiPickerWithListener = withOuterListeners(EmojiPicker);
25
17
  export const EmojiPickerButton = props => {
26
18
  const buttonRef = React.useRef(null);
@@ -75,13 +67,11 @@ export const EmojiPickerButton = props => {
75
67
  // we need an index of > 500 to display over it
76
68
  ,
77
69
  zIndex: props.setDisableParentScroll ? 600 : undefined
78
- }, jsx("div", {
79
- css: emojiPickerWrapper
80
70
  }, jsx(WithProviders, {
81
71
  providers: ['emojiProvider'],
82
72
  providerFactory: props.providerFactory,
83
73
  renderNode: renderPicker
84
- })));
74
+ }));
85
75
  };
86
76
  const title = props.title || '';
87
77
  return jsx("div", {
@@ -39,6 +39,7 @@ const ExtensionButton = props => {
39
39
  };
40
40
  return /*#__PURE__*/React.createElement(Button, {
41
41
  title: item.label,
42
+ ariaLabel: item.tooltip,
42
43
  icon: ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
43
44
  label: item.label || ''
44
45
  }) : undefined,
@@ -19,6 +19,7 @@ import Separator from './Separator';
19
19
  import Input from './Input';
20
20
  import { ExtensionsPlaceholder } from './ExtensionsPlaceholder';
21
21
  import ColorPickerButton from '../../../ui/ColorPickerButton';
22
+ import { backgroundPaletteTooltipMessages } from '../../../ui/ColorPalette';
22
23
  import { EmojiPickerButton } from './EmojiPickerButton';
23
24
  import Announcer from '../../../utils/announcer/announcer';
24
25
  import { injectIntl } from 'react-intl-next';
@@ -45,6 +46,11 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
45
46
  mountRef
46
47
  }) => {
47
48
  const emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
49
+ const {
50
+ useSomewhatSemanticTextColorNames
51
+ } = editorView ? getFeatureFlags(editorView.state) : {
52
+ useSomewhatSemanticTextColorNames: false
53
+ };
48
54
  return jsx(ButtonGroup, null, items.filter(item => !item.hidden).map((item, idx) => {
49
55
  switch (item.type) {
50
56
  case 'button':
@@ -116,7 +122,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
116
122
  showSelected: item.showSelected,
117
123
  buttonTestId: item.testId,
118
124
  editorView: editorView,
119
- setDisableParentScroll: scrollable ? setDisableScroll : undefined
125
+ setDisableParentScroll: scrollable ? setDisableScroll : undefined,
126
+ dropdownListId: (item === null || item === void 0 ? void 0 : item.id) && `${item.id}-dropdownList`
120
127
  });
121
128
  case 'select':
122
129
  if (item.selectType === 'list') {
@@ -153,12 +160,22 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
153
160
  // Currently in floating toolbar, color picker is only
154
161
  // used in panel and table cell background color.
155
162
  // Both uses same color palette.
156
- // That's why hard-coding hexToEditorBackgroundPaletteColor.
163
+ // That's why hard-coding hexToEditorBackgroundPaletteColor
164
+ // and paletteColorTooltipMessages.
157
165
  // When we need to support different color palette
158
166
  // in floating toolbar, we need to set hexToPaletteColor
159
- // in item options.
167
+ // and paletteColorTooltipMessages in item options.
160
168
  ,
161
- hexToPaletteColor: hexToEditorBackgroundPaletteColor
169
+ hexToPaletteColor: hexToEditorBackgroundPaletteColor,
170
+ paletteColorTooltipMessages: backgroundPaletteTooltipMessages
171
+ // We did not want to create new FF or update
172
+ // useSomewhatSemanticTextColorNames name
173
+ // because it is temporary and require extra work.
174
+ // So even though it says text color names,
175
+ // we are going to use for all color pickers
176
+ // such as text, background and table charts.
177
+ ,
178
+ showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
162
179
  });
163
180
  }
164
181
  if (item.selectType === 'emoji') {
@@ -49,14 +49,4 @@ export function findNode(parent, predicate) {
49
49
  return true;
50
50
  });
51
51
  return matchedNode;
52
- }
53
- export function getFocusableElements(rootNode) {
54
- if (!rootNode) {
55
- return [];
56
- }
57
- const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
58
- return Array.from(focusableModalElements) || [];
59
- }
60
- export function getFirstFocusableElement(rootNode) {
61
- return getFocusableElements(rootNode)[0];
62
52
  }
@@ -1,12 +1,5 @@
1
1
  import { fragment } from '@atlaskit/adf-schema';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { pluginKey } from './plugin-key';
4
2
  import { createPlugin as createFragmentMarkConsistencyPlugin } from './pm-plugins/fragment-consistency';
5
- export function createPlugin() {
6
- return new SafePlugin({
7
- key: pluginKey
8
- });
9
- }
10
3
  const fragmentMarkPlugin = () => ({
11
4
  name: 'fragmentPlugin',
12
5
  marks() {
@@ -10,5 +10,4 @@ export const openHelpCommand = (tr, dispatch) => {
10
10
  export const closeHelpCommand = (tr, dispatch) => {
11
11
  tr = tr.setMeta(pluginKey, false);
12
12
  dispatch(tr);
13
- };
14
- export const stopPropagationCommand = e => e.stopPropagation();
13
+ };