@atlaskit/editor-core 181.0.1 → 182.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +0 -2
  3. package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +0 -17
  4. package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +0 -4
  5. package/dist/cjs/create-editor/sort-by-order.js +12 -0
  6. package/dist/cjs/editor-next/editor-migration-component.js +4 -1
  7. package/dist/cjs/editor-next/utils/deprecationWarnings.js +0 -5
  8. package/dist/cjs/labs/next/full-page.js +2 -1
  9. package/dist/cjs/labs/next/presets/default.js +2 -1
  10. package/dist/cjs/labs/next/presets/universal.js +7 -1
  11. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +2 -1
  12. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +4 -7
  13. package/dist/cjs/plugins/analytics/plugin.js +6 -6
  14. package/dist/cjs/plugins/avatar-group/index.js +5 -2
  15. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
  16. package/dist/cjs/plugins/base/index.js +4 -2
  17. package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
  18. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
  19. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
  20. package/dist/cjs/plugins/border/index.js +20 -0
  21. package/dist/cjs/plugins/card/index.js +4 -2
  22. package/dist/cjs/plugins/card/toolbar.js +12 -15
  23. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +7 -3
  24. package/dist/cjs/plugins/code-block/toolbar.js +1 -1
  25. package/dist/cjs/plugins/collab-edit/analytics.js +2 -3
  26. package/dist/cjs/plugins/collab-edit/events/handlers.js +2 -2
  27. package/dist/cjs/plugins/collab-edit/events/initialize.js +3 -2
  28. package/dist/cjs/plugins/collab-edit/index.js +5 -3
  29. package/dist/cjs/plugins/collab-edit/plugin.js +4 -3
  30. package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
  31. package/dist/cjs/plugins/collab-edit/ui/avatars.js +2 -3
  32. package/dist/cjs/plugins/date/index.js +90 -64
  33. package/dist/cjs/plugins/editor-disabled/index.js +8 -0
  34. package/dist/cjs/plugins/expand/index.js +4 -1
  35. package/dist/cjs/plugins/expand/nodeviews/index.js +6 -7
  36. package/dist/cjs/plugins/expand/pm-plugins/main.js +5 -2
  37. package/dist/cjs/plugins/extension/extension-api.js +27 -14
  38. package/dist/cjs/plugins/extension/pm-plugins/main.js +117 -177
  39. package/dist/cjs/plugins/extension/pm-plugins/utils.js +80 -0
  40. package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +7 -11
  41. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
  42. package/dist/cjs/plugins/find-replace/index.js +5 -2
  43. package/dist/cjs/plugins/floating-toolbar/index.js +15 -7
  44. package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
  45. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
  46. package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
  47. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -5
  48. package/dist/cjs/plugins/hyperlink/Toolbar.js +9 -12
  49. package/dist/cjs/plugins/hyperlink/index.js +6 -2
  50. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
  51. package/dist/cjs/plugins/index.js +7 -0
  52. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
  53. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +5 -5
  54. package/dist/cjs/plugins/list/commands/index.js +31 -27
  55. package/dist/cjs/plugins/list/commands/outdent-list.js +2 -3
  56. package/dist/cjs/plugins/list/index.js +4 -3
  57. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
  58. package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +2 -1
  59. package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +58 -0
  60. package/dist/cjs/plugins/list/pm-plugins/keymap.js +4 -4
  61. package/dist/cjs/plugins/list/pm-plugins/main.js +23 -21
  62. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
  63. package/dist/cjs/plugins/media/nodeviews/styles.js +13 -1
  64. package/dist/cjs/plugins/media/toolbar/commands.js +105 -2
  65. package/dist/cjs/plugins/media/toolbar/imageBorder.js +20 -0
  66. package/dist/cjs/plugins/media/toolbar/index.js +33 -4
  67. package/dist/cjs/plugins/media/ui/ImageBorder/index.js +219 -0
  68. package/dist/cjs/plugins/media/ui/ImageBorder/messages.js +50 -0
  69. package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +54 -0
  70. package/dist/cjs/plugins/media/utils/current-media-node.js +28 -5
  71. package/dist/cjs/plugins/paste/util/index.js +2 -0
  72. package/dist/cjs/plugins/rank.js +1 -1
  73. package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +5 -0
  74. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
  75. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +3 -1
  76. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
  77. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
  78. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +6 -3
  79. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
  80. package/dist/cjs/test-utils.js +3 -1
  81. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
  82. package/dist/cjs/ui/styles.js +1 -1
  83. package/dist/cjs/utils/input-rules.js +0 -17
  84. package/dist/cjs/utils/insert.js +53 -7
  85. package/dist/cjs/version-wrapper.js +1 -1
  86. package/dist/cjs/version.json +1 -1
  87. package/dist/es2019/create-editor/sort-by-order.js +11 -0
  88. package/dist/es2019/editor-next/editor-migration-component.js +4 -1
  89. package/dist/es2019/editor-next/utils/deprecationWarnings.js +0 -5
  90. package/dist/es2019/labs/next/full-page.js +2 -1
  91. package/dist/es2019/labs/next/presets/default.js +2 -1
  92. package/dist/es2019/labs/next/presets/universal.js +8 -2
  93. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
  94. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -8
  95. package/dist/es2019/plugins/analytics/plugin.js +45 -43
  96. package/dist/es2019/plugins/avatar-group/index.js +26 -21
  97. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
  98. package/dist/es2019/plugins/base/index.js +101 -97
  99. package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
  100. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
  101. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +2 -7
  102. package/dist/es2019/plugins/border/index.js +11 -0
  103. package/dist/es2019/plugins/card/index.js +4 -2
  104. package/dist/es2019/plugins/card/toolbar.js +10 -11
  105. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +7 -3
  106. package/dist/es2019/plugins/code-block/toolbar.js +2 -2
  107. package/dist/es2019/plugins/collab-edit/analytics.js +2 -3
  108. package/dist/es2019/plugins/collab-edit/events/handlers.js +2 -2
  109. package/dist/es2019/plugins/collab-edit/events/initialize.js +3 -2
  110. package/dist/es2019/plugins/collab-edit/index.js +5 -3
  111. package/dist/es2019/plugins/collab-edit/plugin.js +4 -3
  112. package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
  113. package/dist/es2019/plugins/collab-edit/ui/avatars.js +2 -3
  114. package/dist/es2019/plugins/date/index.js +92 -64
  115. package/dist/es2019/plugins/editor-disabled/index.js +8 -0
  116. package/dist/es2019/plugins/expand/index.js +57 -53
  117. package/dist/es2019/plugins/expand/nodeviews/index.js +6 -9
  118. package/dist/es2019/plugins/expand/pm-plugins/main.js +5 -3
  119. package/dist/es2019/plugins/extension/extension-api.js +31 -13
  120. package/dist/es2019/plugins/extension/pm-plugins/main.js +77 -96
  121. package/dist/es2019/plugins/extension/pm-plugins/utils.js +30 -0
  122. package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -8
  123. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -3
  124. package/dist/es2019/plugins/find-replace/index.js +5 -2
  125. package/dist/es2019/plugins/floating-toolbar/index.js +159 -149
  126. package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +4 -1
  127. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
  128. package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +4 -1
  129. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +6 -5
  130. package/dist/es2019/plugins/hyperlink/Toolbar.js +7 -9
  131. package/dist/es2019/plugins/hyperlink/index.js +66 -62
  132. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -3
  133. package/dist/es2019/plugins/index.js +2 -1
  134. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
  135. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +5 -5
  136. package/dist/es2019/plugins/list/commands/index.js +4 -4
  137. package/dist/es2019/plugins/list/commands/outdent-list.js +2 -4
  138. package/dist/es2019/plugins/list/index.js +80 -77
  139. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
  140. package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +2 -1
  141. package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +52 -0
  142. package/dist/es2019/plugins/list/pm-plugins/keymap.js +4 -4
  143. package/dist/es2019/plugins/list/pm-plugins/main.js +46 -46
  144. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +4 -1
  145. package/dist/es2019/plugins/media/nodeviews/styles.js +12 -1
  146. package/dist/es2019/plugins/media/toolbar/commands.js +93 -0
  147. package/dist/es2019/plugins/media/toolbar/imageBorder.js +15 -0
  148. package/dist/es2019/plugins/media/toolbar/index.js +36 -5
  149. package/dist/es2019/plugins/media/ui/ImageBorder/index.js +206 -0
  150. package/dist/es2019/plugins/media/ui/ImageBorder/messages.js +43 -0
  151. package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +124 -0
  152. package/dist/es2019/plugins/media/utils/current-media-node.js +22 -3
  153. package/dist/es2019/plugins/paste/util/index.js +2 -0
  154. package/dist/es2019/plugins/rank.js +1 -1
  155. package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +7 -0
  156. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
  157. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +59 -55
  158. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
  159. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
  160. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +6 -3
  161. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
  162. package/dist/es2019/test-utils.js +3 -1
  163. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
  164. package/dist/es2019/ui/styles.js +1 -0
  165. package/dist/es2019/utils/input-rules.js +0 -17
  166. package/dist/es2019/utils/insert.js +61 -10
  167. package/dist/es2019/version-wrapper.js +1 -1
  168. package/dist/es2019/version.json +1 -1
  169. package/dist/esm/create-editor/sort-by-order.js +11 -0
  170. package/dist/esm/editor-next/editor-migration-component.js +3 -0
  171. package/dist/esm/editor-next/utils/deprecationWarnings.js +0 -5
  172. package/dist/esm/labs/next/full-page.js +2 -1
  173. package/dist/esm/labs/next/presets/default.js +2 -1
  174. package/dist/esm/labs/next/presets/universal.js +8 -2
  175. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
  176. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -5
  177. package/dist/esm/plugins/analytics/plugin.js +6 -6
  178. package/dist/esm/plugins/avatar-group/index.js +5 -2
  179. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
  180. package/dist/esm/plugins/base/index.js +4 -2
  181. package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
  182. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
  183. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
  184. package/dist/esm/plugins/border/index.js +13 -0
  185. package/dist/esm/plugins/card/index.js +4 -2
  186. package/dist/esm/plugins/card/toolbar.js +12 -15
  187. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +7 -3
  188. package/dist/esm/plugins/code-block/toolbar.js +2 -2
  189. package/dist/esm/plugins/collab-edit/analytics.js +2 -3
  190. package/dist/esm/plugins/collab-edit/events/handlers.js +2 -2
  191. package/dist/esm/plugins/collab-edit/events/initialize.js +3 -2
  192. package/dist/esm/plugins/collab-edit/index.js +5 -3
  193. package/dist/esm/plugins/collab-edit/plugin.js +4 -3
  194. package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
  195. package/dist/esm/plugins/collab-edit/ui/avatars.js +2 -3
  196. package/dist/esm/plugins/date/index.js +90 -64
  197. package/dist/esm/plugins/editor-disabled/index.js +8 -0
  198. package/dist/esm/plugins/expand/index.js +4 -1
  199. package/dist/esm/plugins/expand/nodeviews/index.js +6 -7
  200. package/dist/esm/plugins/expand/pm-plugins/main.js +5 -2
  201. package/dist/esm/plugins/extension/extension-api.js +24 -12
  202. package/dist/esm/plugins/extension/pm-plugins/main.js +113 -173
  203. package/dist/esm/plugins/extension/pm-plugins/utils.js +72 -0
  204. package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -10
  205. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
  206. package/dist/esm/plugins/find-replace/index.js +5 -2
  207. package/dist/esm/plugins/floating-toolbar/index.js +15 -7
  208. package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
  209. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
  210. package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
  211. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +6 -5
  212. package/dist/esm/plugins/hyperlink/Toolbar.js +9 -13
  213. package/dist/esm/plugins/hyperlink/index.js +6 -2
  214. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
  215. package/dist/esm/plugins/index.js +2 -1
  216. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
  217. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +5 -5
  218. package/dist/esm/plugins/list/commands/index.js +31 -27
  219. package/dist/esm/plugins/list/commands/outdent-list.js +2 -3
  220. package/dist/esm/plugins/list/index.js +4 -3
  221. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
  222. package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +2 -1
  223. package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +51 -0
  224. package/dist/esm/plugins/list/pm-plugins/keymap.js +4 -4
  225. package/dist/esm/plugins/list/pm-plugins/main.js +23 -21
  226. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
  227. package/dist/esm/plugins/media/nodeviews/styles.js +13 -1
  228. package/dist/esm/plugins/media/toolbar/commands.js +99 -0
  229. package/dist/esm/plugins/media/toolbar/imageBorder.js +14 -0
  230. package/dist/esm/plugins/media/toolbar/index.js +34 -5
  231. package/dist/esm/plugins/media/ui/ImageBorder/index.js +211 -0
  232. package/dist/esm/plugins/media/ui/ImageBorder/messages.js +43 -0
  233. package/dist/esm/plugins/media/ui/ImageBorder/styles.js +37 -0
  234. package/dist/esm/plugins/media/utils/current-media-node.js +24 -3
  235. package/dist/esm/plugins/paste/util/index.js +2 -0
  236. package/dist/esm/plugins/rank.js +1 -1
  237. package/dist/esm/plugins/rule/pm-plugins/input-rule.js +5 -0
  238. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
  239. package/dist/esm/plugins/toolbar-lists-indentation/index.js +3 -1
  240. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
  241. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
  242. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +6 -3
  243. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
  244. package/dist/esm/test-utils.js +3 -1
  245. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
  246. package/dist/esm/ui/styles.js +1 -1
  247. package/dist/esm/utils/input-rules.js +0 -17
  248. package/dist/esm/utils/insert.js +56 -10
  249. package/dist/esm/version-wrapper.js +1 -1
  250. package/dist/esm/version.json +1 -1
  251. package/dist/types/create-editor/sort-by-order.d.ts +9 -0
  252. package/dist/types/editor-next/editor-migration-component.d.ts +1 -0
  253. package/dist/types/labs/next/presets/cxhtml.d.ts +36 -2
  254. package/dist/types/labs/next/presets/default.d.ts +72 -4
  255. package/dist/types/labs/next/presets/mobile.d.ts +36 -2
  256. package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -1
  257. package/dist/types/plugins/analytics/plugin.d.ts +2 -0
  258. package/dist/types/plugins/avatar-group/index.d.ts +2 -0
  259. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -0
  260. package/dist/types/plugins/base/index.d.ts +2 -0
  261. package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +2 -1
  262. package/dist/types/plugins/border/index.d.ts +3 -0
  263. package/dist/types/plugins/card/index.d.ts +2 -0
  264. package/dist/types/plugins/card/toolbar.d.ts +2 -1
  265. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +5 -2
  266. package/dist/types/plugins/collab-edit/analytics.d.ts +2 -1
  267. package/dist/types/plugins/collab-edit/events/handlers.d.ts +2 -1
  268. package/dist/types/plugins/collab-edit/events/initialize.d.ts +3 -1
  269. package/dist/types/plugins/collab-edit/index.d.ts +2 -0
  270. package/dist/types/plugins/collab-edit/plugin.d.ts +2 -1
  271. package/dist/types/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
  272. package/dist/types/plugins/collab-edit/ui/avatars.d.ts +2 -0
  273. package/dist/types/plugins/date/index.d.ts +9 -1
  274. package/dist/types/plugins/editor-disabled/index.d.ts +3 -1
  275. package/dist/types/plugins/expand/index.d.ts +2 -0
  276. package/dist/types/plugins/expand/nodeviews/index.d.ts +5 -2
  277. package/dist/types/plugins/expand/pm-plugins/main.d.ts +2 -1
  278. package/dist/types/plugins/extension/pm-plugins/main.d.ts +8 -2
  279. package/dist/types/plugins/extension/pm-plugins/utils.d.ts +3 -0
  280. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -7
  281. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +2 -0
  282. package/dist/types/plugins/find-replace/index.d.ts +2 -0
  283. package/dist/types/plugins/floating-toolbar/index.d.ts +4 -1
  284. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +2 -0
  285. package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
  286. package/dist/types/plugins/hyperlink/index.d.ts +2 -0
  287. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -0
  288. package/dist/types/plugins/index.d.ts +1 -0
  289. package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -1
  290. package/dist/types/plugins/list/commands/index.d.ts +3 -2
  291. package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
  292. package/dist/types/plugins/list/index.d.ts +2 -0
  293. package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +1 -1
  294. package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
  295. package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
  296. package/dist/types/plugins/list/pm-plugins/main.d.ts +3 -2
  297. package/dist/types/plugins/media/nodeviews/styles.d.ts +3 -1
  298. package/dist/types/plugins/media/toolbar/commands.d.ts +5 -0
  299. package/dist/types/plugins/media/toolbar/imageBorder.d.ts +2 -0
  300. package/dist/types/plugins/media/types.d.ts +3 -0
  301. package/dist/types/plugins/media/ui/ImageBorder/index.d.ts +13 -0
  302. package/dist/types/plugins/media/ui/ImageBorder/messages.d.ts +42 -0
  303. package/dist/types/plugins/media/ui/ImageBorder/styles.d.ts +15 -0
  304. package/dist/types/plugins/media/utils/current-media-node.d.ts +6 -0
  305. package/dist/types/plugins/text-color/pm-plugins/main.d.ts +0 -2
  306. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -0
  307. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
  308. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
  309. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -1
  310. package/dist/types/test-utils.d.ts +4 -2
  311. package/dist/types/types/editor-props.d.ts +5 -0
  312. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
  313. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  314. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  315. package/package.json +12 -11
  316. package/report.api.md +12 -4
  317. package/codemods/__tests__/rename-experimental-text-color-prop.ts +0 -204
  318. package/codemods/migrates/rename-experimental-text-color-prop.ts +0 -6
@@ -3,10 +3,9 @@ import { isPerformanceAPIAvailable, measureRender } from '@atlaskit/editor-commo
3
3
  import { ACTION, EVENT_TYPE } from './types';
4
4
  import { analyticsPluginKey } from './plugin-key';
5
5
  import { fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
6
- import { getFeatureFlags } from '../feature-flags-context';
7
6
  import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
8
7
  import { generateUndoRedoInputSoucePayload } from '../undo-redo/undo-redo-input-source';
9
- function createPlugin(options) {
8
+ function createPlugin(options, featureFlags) {
10
9
  if (!options || !options.createAnalyticsEvent) {
11
10
  return;
12
11
  }
@@ -21,7 +20,6 @@ function createPlugin(options) {
21
20
  };
22
21
  },
23
22
  apply: (tr, pluginState, _, state) => {
24
- var _getFeatureFlags;
25
23
  if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
26
24
  // When the plugin state is reconfigured, the init function isn't called again
27
25
  return {
@@ -29,7 +27,7 @@ function createPlugin(options) {
29
27
  createAnalyticsEvent: options.createAnalyticsEvent
30
28
  };
31
29
  }
32
- if ((_getFeatureFlags = getFeatureFlags(state)) !== null && _getFeatureFlags !== void 0 && _getFeatureFlags.catchAllTracking) {
30
+ if (featureFlags.catchAllTracking) {
33
31
  const analyticsEventWithChannel = getAnalyticsEventsFromTransaction(tr);
34
32
  if (analyticsEventWithChannel.length > 0) {
35
33
  for (const {
@@ -66,47 +64,51 @@ function createPlugin(options) {
66
64
  }
67
65
  });
68
66
  }
69
- const analyticsPlugin = options => ({
70
- name: 'analytics',
71
- pmPlugins() {
72
- return [{
73
- name: 'analyticsPlugin',
74
- plugin: () => createPlugin(options)
75
- }];
76
- },
77
- onEditorViewStateUpdated({
78
- originalTransaction,
79
- transactions,
80
- newEditorState
81
- }) {
82
- const pluginState = analyticsPluginKey.getState(newEditorState);
83
- if (!pluginState || !pluginState.createAnalyticsEvent) {
84
- return;
85
- }
86
- const steps = transactions.reduce((acc, tr) => {
87
- const payloads = tr.steps.filter(step => step instanceof AnalyticsStep).map(x => x.analyticsEvents).reduce((acc, val) => acc.concat(val), []);
88
- acc.push(...payloads);
89
- return acc;
90
- }, []);
91
- if (steps.length === 0) {
92
- return;
93
- }
94
- const {
95
- createAnalyticsEvent
96
- } = pluginState;
97
- const undoAnaltyicsEventTransformer = generateUndoRedoInputSoucePayload(originalTransaction);
98
- steps.forEach(({
99
- payload,
100
- channel
101
- }) => {
102
- const nextPayload = undoAnaltyicsEventTransformer(payload);
103
- fireAnalyticsEvent(createAnalyticsEvent)({
104
- payload: nextPayload,
67
+ const analyticsPlugin = (options, api) => {
68
+ var _api$dependencies$fea;
69
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies$fea = api.dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
70
+ return {
71
+ name: 'analytics',
72
+ pmPlugins() {
73
+ return [{
74
+ name: 'analyticsPlugin',
75
+ plugin: () => createPlugin(options, featureFlags)
76
+ }];
77
+ },
78
+ onEditorViewStateUpdated({
79
+ originalTransaction,
80
+ transactions,
81
+ newEditorState
82
+ }) {
83
+ const pluginState = analyticsPluginKey.getState(newEditorState);
84
+ if (!pluginState || !pluginState.createAnalyticsEvent) {
85
+ return;
86
+ }
87
+ const steps = transactions.reduce((acc, tr) => {
88
+ const payloads = tr.steps.filter(step => step instanceof AnalyticsStep).map(x => x.analyticsEvents).reduce((acc, val) => acc.concat(val), []);
89
+ acc.push(...payloads);
90
+ return acc;
91
+ }, []);
92
+ if (steps.length === 0) {
93
+ return;
94
+ }
95
+ const {
96
+ createAnalyticsEvent
97
+ } = pluginState;
98
+ const undoAnaltyicsEventTransformer = generateUndoRedoInputSoucePayload(originalTransaction);
99
+ steps.forEach(({
100
+ payload,
105
101
  channel
102
+ }) => {
103
+ const nextPayload = undoAnaltyicsEventTransformer(payload);
104
+ fireAnalyticsEvent(createAnalyticsEvent)({
105
+ payload: nextPayload,
106
+ channel
107
+ });
106
108
  });
107
- });
108
- }
109
- });
109
+ }
110
+ };
111
+ };
110
112
  export function extendPayload({
111
113
  payload,
112
114
  duration,
@@ -1,24 +1,29 @@
1
1
  import React from 'react';
2
2
  import AvatarGroupPluginWrapper from './ui/AvatarGroupPluginWrapper';
3
- const avatarGroup = props => ({
4
- name: 'avatarGroup',
5
- primaryToolbarComponent({
6
- editorView,
7
- popupsMountPoint,
8
- popupsBoundariesElement,
9
- popupsScrollableElement,
10
- disabled,
11
- isToolbarReducedSpacing,
12
- eventDispatcher,
13
- dispatchAnalyticsEvent
14
- }) {
15
- return /*#__PURE__*/React.createElement(AvatarGroupPluginWrapper, {
16
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
17
- editorView: editorView,
18
- eventDispatcher: eventDispatcher,
19
- collabEdit: props.collabEdit,
20
- takeFullWidth: props.takeFullWidth
21
- });
22
- }
23
- });
3
+ const avatarGroup = (props, api) => {
4
+ var _api$dependencies, _api$dependencies$fea;
5
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
6
+ return {
7
+ name: 'avatarGroup',
8
+ primaryToolbarComponent({
9
+ editorView,
10
+ popupsMountPoint,
11
+ popupsBoundariesElement,
12
+ popupsScrollableElement,
13
+ disabled,
14
+ isToolbarReducedSpacing,
15
+ eventDispatcher,
16
+ dispatchAnalyticsEvent
17
+ }) {
18
+ return /*#__PURE__*/React.createElement(AvatarGroupPluginWrapper, {
19
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
20
+ editorView: editorView,
21
+ eventDispatcher: eventDispatcher,
22
+ collabEdit: props.collabEdit,
23
+ takeFullWidth: props.takeFullWidth,
24
+ featureFlags: featureFlags
25
+ });
26
+ }
27
+ };
28
+ };
24
29
  export default avatarGroup;
@@ -20,7 +20,8 @@ const toolbarButtonWrapperFullWidth = css`
20
20
  `;
21
21
  const AvatarGroupPluginWrapper = props => {
22
22
  const {
23
- dispatchAnalyticsEvent
23
+ dispatchAnalyticsEvent,
24
+ featureFlags
24
25
  } = props;
25
26
  const intl = useIntl();
26
27
  useEffect(() => {
@@ -43,7 +44,8 @@ const AvatarGroupPluginWrapper = props => {
43
44
  eventDispatcher: props.eventDispatcher,
44
45
  inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
45
46
  inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
46
- isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected
47
+ isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected,
48
+ featureFlags: featureFlags
47
49
  }));
48
50
  };
49
51
  export default AvatarGroupPluginWrapper;
@@ -18,108 +18,112 @@ import frozenEditor from './pm-plugins/frozen-editor';
18
18
  import compositionPlugin from './pm-plugins/composition';
19
19
  // Chrome >= 88
20
20
  export const isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
21
- const basePlugin = options => ({
22
- name: 'base',
23
- pmPlugins() {
24
- const plugins = [{
25
- name: 'filterStepsPlugin',
26
- plugin: ({
27
- dispatchAnalyticsEvent
28
- }) => filterStepsPlugin(dispatchAnalyticsEvent)
29
- }];
21
+ const basePlugin = (options, api) => {
22
+ var _api$dependencies, _api$dependencies$fea;
23
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
24
+ return {
25
+ name: 'base',
26
+ pmPlugins() {
27
+ const plugins = [{
28
+ name: 'filterStepsPlugin',
29
+ plugin: ({
30
+ dispatchAnalyticsEvent
31
+ }) => filterStepsPlugin(dispatchAnalyticsEvent)
32
+ }];
30
33
 
31
- // In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
32
- // the cursor appears at the right most point of the parent container.
33
- // In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
34
- // no cursor is presented to users.
35
- // In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
36
- // it is not possible to navigate with arrow keys.
37
- // This plugin works around the issues by inserting decorations between
38
- // inline nodes which are set as contenteditable, and have a zero width space.
39
- plugins.push({
40
- name: 'inlineCursorTargetPlugin',
41
- plugin: () => options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined
42
- });
43
- plugins.push({
44
- name: 'focusHandlerPlugin',
45
- plugin: ({
46
- dispatch
47
- }) => focusHandlerPlugin(dispatch)
48
- }, {
49
- name: 'newlinePreserveMarksPlugin',
50
- plugin: newlinePreserveMarksPlugin
51
- }, {
52
- name: 'reactNodeView',
53
- plugin: () => reactNodeView
54
- }, {
55
- name: 'frozenEditor',
56
- plugin: ({
57
- dispatchAnalyticsEvent
58
- }) => {
59
- var _options$inputTrackin;
60
- return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
34
+ // In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
35
+ // the cursor appears at the right most point of the parent container.
36
+ // In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
37
+ // no cursor is presented to users.
38
+ // In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
39
+ // it is not possible to navigate with arrow keys.
40
+ // This plugin works around the issues by inserting decorations between
41
+ // inline nodes which are set as contenteditable, and have a zero width space.
42
+ plugins.push({
43
+ name: 'inlineCursorTargetPlugin',
44
+ plugin: () => options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined
45
+ });
46
+ plugins.push({
47
+ name: 'focusHandlerPlugin',
48
+ plugin: ({
49
+ dispatch
50
+ }) => focusHandlerPlugin(dispatch)
51
+ }, {
52
+ name: 'newlinePreserveMarksPlugin',
53
+ plugin: newlinePreserveMarksPlugin
54
+ }, {
55
+ name: 'reactNodeView',
56
+ plugin: () => reactNodeView
57
+ }, {
58
+ name: 'frozenEditor',
59
+ plugin: ({
60
+ dispatchAnalyticsEvent
61
+ }) => {
62
+ var _options$inputTrackin;
63
+ return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
64
+ }
65
+ }, {
66
+ name: 'decorationPlugin',
67
+ plugin: () => decorationPlugin()
68
+ }, {
69
+ name: 'history',
70
+ plugin: () => history()
71
+ },
72
+ // should be last :(
73
+ {
74
+ name: 'codeBlockIndent',
75
+ plugin: () => keymap({
76
+ ...baseKeymap,
77
+ 'Mod-[': () => true,
78
+ 'Mod-]': () => true
79
+ })
80
+ }, {
81
+ name: 'contextIdentifier',
82
+ plugin: ({
83
+ dispatch,
84
+ providerFactory
85
+ }) => contextIdentifierPlugin(dispatch, providerFactory)
86
+ }, {
87
+ name: 'betterTypeHistory',
88
+ plugin: ({
89
+ dispatch,
90
+ providerFactory
91
+ }) => betterTypeHistoryPlugin()
92
+ });
93
+ if (options && options.allowScrollGutter) {
94
+ plugins.push({
95
+ name: 'scrollGutterPlugin',
96
+ plugin: () => scrollGutter(options.allowScrollGutter)
97
+ });
98
+ }
99
+ if (isChromeWithSelectionBug) {
100
+ plugins.push({
101
+ name: 'fixChrome88SelectionPlugin',
102
+ plugin: () => fixChrome88SelectionPlugin()
103
+ });
61
104
  }
62
- }, {
63
- name: 'decorationPlugin',
64
- plugin: () => decorationPlugin()
65
- }, {
66
- name: 'history',
67
- plugin: () => history()
68
- },
69
- // should be last :(
70
- {
71
- name: 'codeBlockIndent',
72
- plugin: () => keymap({
73
- ...baseKeymap,
74
- 'Mod-[': () => true,
75
- 'Mod-]': () => true
76
- })
77
- }, {
78
- name: 'contextIdentifier',
79
- plugin: ({
80
- dispatch,
81
- providerFactory
82
- }) => contextIdentifierPlugin(dispatch, providerFactory)
83
- }, {
84
- name: 'betterTypeHistory',
85
- plugin: ({
86
- dispatch,
87
- providerFactory
88
- }) => betterTypeHistoryPlugin()
89
- });
90
- if (options && options.allowScrollGutter) {
91
105
  plugins.push({
92
- name: 'scrollGutterPlugin',
93
- plugin: () => scrollGutter(options.allowScrollGutter)
106
+ name: 'disableSpellcheckingPlugin',
107
+ plugin: () => disableSpellcheckingPlugin(featureFlags)
94
108
  });
95
- }
96
- if (isChromeWithSelectionBug) {
97
109
  plugins.push({
98
- name: 'fixChrome88SelectionPlugin',
99
- plugin: () => fixChrome88SelectionPlugin()
110
+ name: 'compositionPlugin',
111
+ plugin: () => compositionPlugin()
100
112
  });
113
+ return plugins;
114
+ },
115
+ nodes() {
116
+ return [{
117
+ name: 'doc',
118
+ node: doc
119
+ }, {
120
+ name: 'paragraph',
121
+ node: paragraph
122
+ }, {
123
+ name: 'text',
124
+ node: text
125
+ }];
101
126
  }
102
- plugins.push({
103
- name: 'disableSpellcheckingPlugin',
104
- plugin: () => disableSpellcheckingPlugin()
105
- });
106
- plugins.push({
107
- name: 'compositionPlugin',
108
- plugin: () => compositionPlugin()
109
- });
110
- return plugins;
111
- },
112
- nodes() {
113
- return [{
114
- name: 'doc',
115
- node: doc
116
- }, {
117
- name: 'paragraph',
118
- node: paragraph
119
- }, {
120
- name: 'text',
121
- node: text
122
- }];
123
- }
124
- });
127
+ };
128
+ };
125
129
  export default basePlugin;
@@ -1,6 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from 'prosemirror-state';
3
- import { getFeatureFlags } from '../../feature-flags-context';
4
3
  import { browser as browserEnv } from '@atlaskit/editor-common/utils';
5
4
  function getCurrentBrowserAndVersion() {
6
5
  switch (true) {
@@ -27,11 +26,10 @@ function getCurrentBrowserAndVersion() {
27
26
  }
28
27
  return undefined;
29
28
  }
30
- export default (() => new SafePlugin({
29
+ export default (featureFlags => new SafePlugin({
31
30
  key: new PluginKey('disableSpellchecking'),
32
31
  props: {
33
32
  attributes: editorState => {
34
- const featureFlags = getFeatureFlags(editorState) || undefined;
35
33
  if (!featureFlags) {
36
34
  return;
37
35
  }
@@ -38,10 +38,5 @@ export const BlockTypeButton = props => {
38
38
  })))
39
39
  }, !props.isSmall && jsx("span", {
40
40
  css: [buttonContentStyle, props.isReducedSpacing && buttonContentReducedSpacingStyle]
41
- }, jsx(FormattedMessage, props.title || NORMAL_TEXT.title), jsx("div", {
42
- style: {
43
- overflow: 'hidden',
44
- height: 0
45
- }
46
- }, props.children)));
41
+ }, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)));
47
42
  };
@@ -6,7 +6,6 @@ import { injectIntl } from 'react-intl-next';
6
6
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
7
7
  import DropdownMenu from '../../../../ui/DropdownMenu';
8
8
  import { separatorStyles, wrapperStyle } from '../../../../ui/styles';
9
- import { NORMAL_TEXT } from '../../types';
10
9
  import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
11
10
  import { tooltip, findKeymapByDescription } from '../../../../keymaps';
12
11
  import { BlockTypeButton } from './blocktype-button';
@@ -113,10 +112,6 @@ class ToolbarBlockType extends React.PureComponent {
113
112
  return null;
114
113
  }
115
114
  const blockTypeTitles = availableBlockTypes.filter(blockType => blockType.name === currentBlockType.name).map(blockType => blockType.title);
116
- const longestDropdownMenuItem = [NORMAL_TEXT, ...availableBlockTypes].reduce((longest, item) => {
117
- const itemTitle = formatMessage(item.title);
118
- return itemTitle.length >= longest.length ? itemTitle : longest;
119
- }, '');
120
115
  if (!this.props.isDisabled && !blockTypesDisabled) {
121
116
  const items = this.createItems();
122
117
  return jsx("span", {
@@ -152,7 +147,7 @@ class ToolbarBlockType extends React.PureComponent {
152
147
  onKeyDown: this.handleTriggerByKeyboard,
153
148
  formatMessage: formatMessage,
154
149
  "aria-expanded": active
155
- }, longestDropdownMenuItem)), jsx("span", {
150
+ })), jsx("span", {
156
151
  css: separatorStyles
157
152
  }));
158
153
  }
@@ -168,7 +163,7 @@ class ToolbarBlockType extends React.PureComponent {
168
163
  onKeyDown: this.handleTriggerByKeyboard,
169
164
  formatMessage: formatMessage,
170
165
  "aria-expanded": active
171
- }, longestDropdownMenuItem), jsx("span", {
166
+ }), jsx("span", {
172
167
  css: separatorStyles
173
168
  }));
174
169
  }
@@ -0,0 +1,11 @@
1
+ import { border } from '@atlaskit/adf-schema';
2
+ const borderPlugin = () => ({
3
+ name: 'border',
4
+ marks() {
5
+ return [{
6
+ name: 'border',
7
+ mark: border
8
+ }];
9
+ }
10
+ });
11
+ export default borderPlugin;
@@ -4,7 +4,9 @@ import { createPlugin } from './pm-plugins/main';
4
4
  import { floatingToolbar } from './toolbar';
5
5
  import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
6
6
  import { cardKeymap } from './pm-plugins/keymap';
7
- const cardPlugin = options => {
7
+ const cardPlugin = (options, api) => {
8
+ var _api$dependencies, _api$dependencies$fea;
9
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
8
10
  return {
9
11
  name: 'card',
10
12
  nodes() {
@@ -55,7 +57,7 @@ const cardPlugin = options => {
55
57
  });
56
58
  },
57
59
  pluginsOptions: {
58
- floatingToolbar: floatingToolbar(options, options.platform, options.linkPicker)
60
+ floatingToolbar: floatingToolbar(options, featureFlags, options.platform, options.linkPicker)
59
61
  }
60
62
  };
61
63
  };
@@ -20,7 +20,6 @@ import { messages } from './messages';
20
20
  import buildLayoutButtons from '../../ui/MediaAndEmbedsToolbar';
21
21
  import { buildOpenedSettingsPayload, buildVisitedLinkPayload } from '../../utils/linking-utils';
22
22
  import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME } from './styles';
23
- import { getFeatureFlags } from '../feature-flags-context';
24
23
  export const removeCard = (state, dispatch) => {
25
24
  if (!(state.selection instanceof NodeSelection)) {
26
25
  return false;
@@ -73,9 +72,8 @@ export const openLinkSettings = (state, dispatch) => {
73
72
  }
74
73
  return true;
75
74
  };
76
- export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
75
+ export const floatingToolbar = (cardOptions, featureFlags, platform, linkPickerOptions) => {
77
76
  return (state, intl, providerFactory) => {
78
- var _linkPickerOptions$pl;
79
77
  const {
80
78
  inlineCard,
81
79
  blockCard,
@@ -107,9 +105,9 @@ export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
107
105
  lpLinkPicker,
108
106
  lpLinkPickerFocusTrap,
109
107
  preventPopupOverflow
110
- } = getFeatureFlags(state);
108
+ } = featureFlags;
111
109
  const shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
112
- const isLinkPickerEnabled = !!lpLinkPicker && !!(linkPickerOptions !== null && linkPickerOptions !== void 0 && (_linkPickerOptions$pl = linkPickerOptions.plugins) !== null && _linkPickerOptions$pl !== void 0 && _linkPickerOptions$pl.length);
110
+ const isLinkPickerEnabled = !!lpLinkPicker;
113
111
  return {
114
112
  title: intl.formatMessage(messages.card),
115
113
  className,
@@ -126,7 +124,7 @@ export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
126
124
  }
127
125
  return element;
128
126
  },
129
- items: generateToolbarItems(state, intl, providerFactory, cardOptions, platform, linkPickerOptions),
127
+ items: generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPickerOptions),
130
128
  scrollable: pluginState.showLinkingToolbar ? false : true,
131
129
  focusTrap: shouldEnableFocusTrap && pluginState.showLinkingToolbar,
132
130
  ...editLinkToolbarConfig(pluginState.showLinkingToolbar, isLinkPickerEnabled)
@@ -144,7 +142,7 @@ const unlinkCard = (node, state) => {
144
142
  const buildAlignmentOptions = (state, intl) => {
145
143
  return buildLayoutButtons(state, intl, state.schema.nodes.embedCard, true, true);
146
144
  };
147
- const generateToolbarItems = (state, intl, providerFactory, cardOptions, platform, linkPicker) => node => {
145
+ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker) => node => {
148
146
  const {
149
147
  url
150
148
  } = titleUrlPairFromNode(node);
@@ -168,7 +166,8 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, platfor
168
166
  return [buildEditLinkToolbar({
169
167
  providerFactory,
170
168
  linkPicker,
171
- node
169
+ node,
170
+ featureFlags
172
171
  })];
173
172
  } else {
174
173
  const {
@@ -204,7 +203,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, platfor
204
203
  }, {
205
204
  type: 'separator'
206
205
  }]
207
- }, ...getSettingsButtonGroup(state, intl), {
206
+ }, ...getSettingsButtonGroup(state, featureFlags, intl), {
208
207
  id: 'editor.link.delete',
209
208
  focusEditoronEnter: true,
210
209
  type: 'button',
@@ -267,10 +266,10 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard) => {
267
266
  type: 'separator'
268
267
  }] : [];
269
268
  };
270
- const getSettingsButtonGroup = (state, intl) => {
269
+ const getSettingsButtonGroup = (state, featureFlags, intl) => {
271
270
  const {
272
271
  floatingToolbarLinkSettingsButton
273
- } = getFeatureFlags(state);
272
+ } = featureFlags;
274
273
  return floatingToolbarLinkSettingsButton === 'true' ? [{
275
274
  id: 'editor.link.settings',
276
275
  type: 'button',
@@ -45,6 +45,7 @@ export class EditLinkToolbar extends React.Component {
45
45
  url,
46
46
  text,
47
47
  view,
48
+ featureFlags,
48
49
  onSubmit
49
50
  } = this.props;
50
51
  return /*#__PURE__*/React.createElement(HyperLinkToolbarWithListeners, {
@@ -58,6 +59,7 @@ export class EditLinkToolbar extends React.Component {
58
59
  // via the floating toolbar
59
60
  ,
60
61
  invokeMethod: INPUT_METHOD.FLOATING_TB,
62
+ featureFlags: featureFlags,
61
63
  onSubmit: (href, title, displayText) => {
62
64
  this.hideLinkToolbar();
63
65
  if (onSubmit) {
@@ -81,7 +83,8 @@ export const editLink = (state, dispatch) => {
81
83
  export const buildEditLinkToolbar = ({
82
84
  providerFactory,
83
85
  node,
84
- linkPicker
86
+ linkPicker,
87
+ featureFlags
85
88
  }) => {
86
89
  return {
87
90
  type: 'custom',
@@ -100,6 +103,7 @@ export const buildEditLinkToolbar = ({
100
103
  url: displayInfo.url,
101
104
  text: displayInfo.title || '',
102
105
  node: node,
106
+ featureFlags: featureFlags,
103
107
  onSubmit: (newHref, newText) => {
104
108
  const urlChanged = newHref !== displayInfo.url;
105
109
  const titleChanged = newText !== displayInfo.title;
@@ -118,9 +122,9 @@ export const buildEditLinkToolbar = ({
118
122
  }
119
123
  };
120
124
  };
121
- export const editLinkToolbarConfig = (showLinkingToolbar, linkPickerOptions) => {
125
+ export const editLinkToolbarConfig = (showLinkingToolbar, lpLinkPicker) => {
122
126
  return showLinkingToolbar ? {
123
- height: linkPickerOptions ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX,
127
+ height: lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX,
124
128
  width: RECENT_SEARCH_WIDTH_IN_PX,
125
129
  forcePlacement: true
126
130
  } : {};
@@ -4,7 +4,7 @@ import CopyIcon from '@atlaskit/icon/glyph/copy';
4
4
  import { findDomRefAtPos } from 'prosemirror-utils';
5
5
  import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedState } from './actions';
6
6
  import commonMessages from '../../messages';
7
- import { codeBlockCopyButtonMessages } from '@atlaskit/editor-common/messages';
7
+ import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
8
8
  import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
9
9
  import { hoverDecoration } from '../base/pm-plugins/decoration';
10
10
  import { pluginKey } from './plugin-key';
@@ -61,7 +61,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false) => (state, {
61
61
  // note: copyContentToClipboard contains logic that also removes the
62
62
  // visual feedback for the copy button
63
63
  onClick: copyContentToClipboard,
64
- title: formatMessage(codeBlockState.contentCopied ? codeBlockCopyButtonMessages.copiedCodeToClipboard : codeBlockCopyButtonMessages.copyCodeToClipboard),
64
+ title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
65
65
  onMouseEnter: provideVisualFeedbackForCopyButton,
66
66
  // note: resetCopiedState contains logic that also removes the
67
67
  // visual feedback for the copy button