@atlaskit/editor-core 176.0.3 → 177.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 (449) hide show
  1. package/.eslintrc.js +2 -2
  2. package/CHANGELOG.md +108 -0
  3. package/dist/cjs/create-editor/ReactEditorView.js +3 -1
  4. package/dist/cjs/create-editor/create-plugins-list.js +9 -6
  5. package/dist/cjs/create-editor/messages.js +17 -0
  6. package/dist/cjs/i18n/en.js +2 -2
  7. package/dist/cjs/i18n/en_GB.js +2 -2
  8. package/dist/cjs/i18n/en_ZZ.js +2 -2
  9. package/dist/cjs/i18n/index.js +4 -4
  10. package/dist/cjs/i18n/languages.js +9 -4
  11. package/dist/cjs/labs/next/presets/mobile.js +2 -2
  12. package/dist/cjs/labs/next/presets/preset.js +38 -6
  13. package/dist/cjs/plugins/annotation/nodeviews/index.js +1 -0
  14. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +6 -1
  15. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -1
  16. package/dist/cjs/plugins/card/pm-plugins/doc.js +18 -29
  17. package/dist/cjs/plugins/card/pm-plugins/main.js +7 -21
  18. package/dist/cjs/plugins/card/toolbar.js +24 -8
  19. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +9 -5
  20. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +19 -53
  21. package/dist/cjs/plugins/card/utils.js +17 -3
  22. package/dist/cjs/plugins/collab-edit/actions.js +3 -3
  23. package/dist/cjs/plugins/copy-button/toolbar.js +5 -3
  24. package/dist/cjs/plugins/date/index.js +1 -7
  25. package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -2
  26. package/dist/cjs/plugins/emoji/index.js +7 -14
  27. package/dist/cjs/plugins/expand/pm-plugins/main.js +4 -1
  28. package/dist/cjs/plugins/expand/toolbar.js +1 -0
  29. package/dist/cjs/plugins/extension/commands.js +17 -2
  30. package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -0
  31. package/dist/cjs/plugins/extension/toolbar.js +49 -7
  32. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
  33. package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -2
  34. package/dist/cjs/plugins/floating-toolbar/index.js +16 -4
  35. package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +99 -0
  36. package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +10 -30
  37. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +16 -4
  38. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +108 -55
  39. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -2
  40. package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
  41. package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +51 -0
  42. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +27 -47
  43. package/dist/cjs/plugins/floating-toolbar/ui/messages.js +13 -3
  44. package/dist/cjs/plugins/floating-toolbar/utils.js +4 -19
  45. package/dist/cjs/plugins/help-dialog/index.js +3 -2
  46. package/dist/cjs/plugins/hyperlink/Toolbar.js +20 -1
  47. package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
  48. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
  49. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
  50. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
  51. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
  52. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
  53. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
  54. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +26 -12
  55. package/dist/cjs/plugins/layout/toolbar.js +1 -0
  56. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +34 -4
  57. package/dist/cjs/plugins/list/commands/outdent-list.js +1 -1
  58. package/dist/cjs/plugins/list/index.js +6 -2
  59. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
  60. package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +5 -2
  61. package/dist/cjs/plugins/list/pm-plugins/main.js +32 -10
  62. package/dist/cjs/plugins/media/index.js +35 -0
  63. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +7 -6
  64. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -1
  65. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
  66. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +3 -1
  67. package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
  68. package/dist/cjs/plugins/media/toolbar/index.js +3 -0
  69. package/dist/cjs/plugins/media/utils/media-single.js +19 -3
  70. package/dist/cjs/plugins/panel/toolbar.js +1 -0
  71. package/dist/cjs/plugins/panel/utils.js +1 -1
  72. package/dist/cjs/plugins/paste/index.js +2 -1
  73. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +19 -3
  74. package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
  75. package/dist/cjs/plugins/paste/util/index.js +2 -2
  76. package/dist/cjs/plugins/placeholder/index.js +24 -47
  77. package/dist/cjs/plugins/placeholder/styles.js +2 -4
  78. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +7 -3
  79. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
  80. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +10 -5
  81. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +5 -1
  82. package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
  83. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -6
  84. package/dist/cjs/plugins/type-ahead/index.js +2 -8
  85. package/dist/cjs/plugins/type-ahead/messages.js +44 -4
  86. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -1
  87. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +17 -1
  88. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +9 -4
  89. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
  90. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
  91. package/dist/cjs/plugins/type-ahead/utils.js +44 -2
  92. package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -2
  93. package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -1
  94. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
  95. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
  96. package/dist/cjs/ui/CollapsedEditor/index.js +4 -2
  97. package/dist/cjs/ui/ColorPickerButton/index.js +2 -1
  98. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -4
  99. package/dist/cjs/ui/ConfigPanel/FormContent.js +2 -1
  100. package/dist/cjs/ui/ContentStyles/index.js +1 -1
  101. package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +3 -1
  102. package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +55 -33
  103. package/dist/cjs/utils/commands.js +25 -13
  104. package/dist/cjs/utils/input-rules.js +26 -2
  105. package/dist/cjs/version-wrapper.js +1 -1
  106. package/dist/cjs/version.json +1 -1
  107. package/dist/es2019/create-editor/ReactEditorView.js +2 -1
  108. package/dist/es2019/create-editor/create-plugins-list.js +9 -6
  109. package/dist/es2019/create-editor/messages.js +8 -0
  110. package/dist/es2019/i18n/en.js +2 -2
  111. package/dist/es2019/i18n/en_GB.js +2 -2
  112. package/dist/es2019/i18n/en_ZZ.js +2 -2
  113. package/dist/es2019/i18n/index.js +4 -4
  114. package/dist/es2019/i18n/languages.js +9 -4
  115. package/dist/es2019/labs/next/presets/mobile.js +2 -2
  116. package/dist/es2019/labs/next/presets/preset.js +28 -7
  117. package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -0
  118. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
  119. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +4 -1
  120. package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -19
  121. package/dist/es2019/plugins/card/pm-plugins/main.js +4 -19
  122. package/dist/es2019/plugins/card/toolbar.js +19 -2
  123. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +8 -6
  124. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -36
  125. package/dist/es2019/plugins/card/utils.js +15 -2
  126. package/dist/es2019/plugins/collab-edit/actions.js +3 -3
  127. package/dist/es2019/plugins/copy-button/toolbar.js +5 -3
  128. package/dist/es2019/plugins/date/index.js +0 -7
  129. package/dist/es2019/plugins/date/ui/DatePicker/index.js +1 -2
  130. package/dist/es2019/plugins/emoji/index.js +7 -13
  131. package/dist/es2019/plugins/expand/pm-plugins/main.js +3 -3
  132. package/dist/es2019/plugins/expand/toolbar.js +1 -0
  133. package/dist/es2019/plugins/extension/commands.js +10 -1
  134. package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -0
  135. package/dist/es2019/plugins/extension/toolbar.js +43 -8
  136. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
  137. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
  138. package/dist/es2019/plugins/floating-toolbar/index.js +15 -5
  139. package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +70 -0
  140. package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +8 -27
  141. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +17 -4
  142. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +96 -50
  143. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
  144. package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +29 -76
  145. package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +32 -0
  146. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +26 -46
  147. package/dist/es2019/plugins/floating-toolbar/ui/messages.js +14 -4
  148. package/dist/es2019/plugins/floating-toolbar/utils.js +4 -17
  149. package/dist/es2019/plugins/help-dialog/index.js +2 -2
  150. package/dist/es2019/plugins/hyperlink/Toolbar.js +18 -2
  151. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -2
  152. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -9
  153. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
  154. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
  155. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
  156. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
  157. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
  158. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
  159. package/dist/es2019/plugins/layout/toolbar.js +1 -0
  160. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +24 -4
  161. package/dist/es2019/plugins/list/commands/outdent-list.js +1 -1
  162. package/dist/es2019/plugins/list/index.js +7 -3
  163. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
  164. package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +5 -2
  165. package/dist/es2019/plugins/list/pm-plugins/main.js +31 -11
  166. package/dist/es2019/plugins/media/index.js +38 -0
  167. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -5
  168. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +3 -1
  169. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
  170. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -1
  171. package/dist/es2019/plugins/media/pm-plugins/main.js +7 -0
  172. package/dist/es2019/plugins/media/toolbar/index.js +3 -0
  173. package/dist/es2019/plugins/media/utils/media-single.js +20 -3
  174. package/dist/es2019/plugins/panel/toolbar.js +1 -0
  175. package/dist/es2019/plugins/panel/utils.js +1 -1
  176. package/dist/es2019/plugins/paste/index.js +2 -1
  177. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +15 -2
  178. package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
  179. package/dist/es2019/plugins/paste/util/index.js +2 -2
  180. package/dist/es2019/plugins/placeholder/index.js +21 -47
  181. package/dist/es2019/plugins/placeholder/styles.js +1 -19
  182. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
  183. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
  184. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +8 -7
  185. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
  186. package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +18 -12
  187. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
  188. package/dist/es2019/plugins/type-ahead/index.js +2 -2
  189. package/dist/es2019/plugins/type-ahead/messages.js +44 -4
  190. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -1
  191. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +17 -1
  192. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -5
  193. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
  194. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
  195. package/dist/es2019/plugins/type-ahead/utils.js +38 -0
  196. package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
  197. package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
  198. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -2
  199. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
  200. package/dist/es2019/ui/CollapsedEditor/index.js +3 -2
  201. package/dist/es2019/ui/ColorPickerButton/index.js +2 -1
  202. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -5
  203. package/dist/es2019/ui/ConfigPanel/FormContent.js +3 -3
  204. package/dist/es2019/ui/ContentStyles/index.js +7 -2
  205. package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -0
  206. package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
  207. package/dist/es2019/utils/commands.js +26 -14
  208. package/dist/es2019/utils/input-rules.js +22 -1
  209. package/dist/es2019/version-wrapper.js +1 -1
  210. package/dist/es2019/version.json +1 -1
  211. package/dist/esm/create-editor/ReactEditorView.js +2 -1
  212. package/dist/esm/create-editor/create-plugins-list.js +9 -6
  213. package/dist/esm/create-editor/messages.js +8 -0
  214. package/dist/esm/i18n/en.js +2 -2
  215. package/dist/esm/i18n/en_GB.js +2 -2
  216. package/dist/esm/i18n/en_ZZ.js +2 -2
  217. package/dist/esm/i18n/index.js +4 -4
  218. package/dist/esm/i18n/languages.js +9 -4
  219. package/dist/esm/labs/next/presets/mobile.js +2 -2
  220. package/dist/esm/labs/next/presets/preset.js +36 -6
  221. package/dist/esm/plugins/annotation/nodeviews/index.js +1 -0
  222. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
  223. package/dist/esm/plugins/breakout/ui/LayoutButton.js +4 -1
  224. package/dist/esm/plugins/card/pm-plugins/doc.js +10 -20
  225. package/dist/esm/plugins/card/pm-plugins/main.js +4 -17
  226. package/dist/esm/plugins/card/toolbar.js +24 -8
  227. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +8 -6
  228. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +9 -39
  229. package/dist/esm/plugins/card/utils.js +15 -2
  230. package/dist/esm/plugins/collab-edit/actions.js +3 -3
  231. package/dist/esm/plugins/copy-button/toolbar.js +5 -3
  232. package/dist/esm/plugins/date/index.js +1 -6
  233. package/dist/esm/plugins/date/ui/DatePicker/index.js +1 -2
  234. package/dist/esm/plugins/emoji/index.js +7 -13
  235. package/dist/esm/plugins/expand/pm-plugins/main.js +3 -3
  236. package/dist/esm/plugins/expand/toolbar.js +1 -0
  237. package/dist/esm/plugins/extension/commands.js +12 -1
  238. package/dist/esm/plugins/extension/pm-plugins/main.js +10 -0
  239. package/dist/esm/plugins/extension/toolbar.js +50 -8
  240. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
  241. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
  242. package/dist/esm/plugins/floating-toolbar/index.js +16 -4
  243. package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +75 -0
  244. package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +11 -25
  245. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +17 -4
  246. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +100 -47
  247. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
  248. package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
  249. package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +30 -0
  250. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +27 -47
  251. package/dist/esm/plugins/floating-toolbar/ui/messages.js +13 -3
  252. package/dist/esm/plugins/floating-toolbar/utils.js +4 -17
  253. package/dist/esm/plugins/help-dialog/index.js +3 -2
  254. package/dist/esm/plugins/hyperlink/Toolbar.js +20 -2
  255. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -3
  256. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
  257. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
  258. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
  259. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
  260. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
  261. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
  262. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
  263. package/dist/esm/plugins/layout/toolbar.js +1 -0
  264. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +30 -4
  265. package/dist/esm/plugins/list/commands/outdent-list.js +1 -1
  266. package/dist/esm/plugins/list/index.js +7 -3
  267. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
  268. package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +5 -2
  269. package/dist/esm/plugins/list/pm-plugins/main.js +31 -11
  270. package/dist/esm/plugins/media/index.js +33 -0
  271. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +7 -6
  272. package/dist/esm/plugins/media/nodeviews/mediaInline.js +3 -1
  273. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
  274. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +3 -1
  275. package/dist/esm/plugins/media/pm-plugins/main.js +7 -0
  276. package/dist/esm/plugins/media/toolbar/index.js +3 -0
  277. package/dist/esm/plugins/media/utils/media-single.js +18 -3
  278. package/dist/esm/plugins/panel/toolbar.js +1 -0
  279. package/dist/esm/plugins/panel/utils.js +1 -1
  280. package/dist/esm/plugins/paste/index.js +2 -1
  281. package/dist/esm/plugins/paste/pm-plugins/analytics.js +15 -2
  282. package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
  283. package/dist/esm/plugins/paste/util/index.js +2 -2
  284. package/dist/esm/plugins/placeholder/index.js +23 -45
  285. package/dist/esm/plugins/placeholder/styles.js +1 -2
  286. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
  287. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
  288. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +9 -5
  289. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
  290. package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
  291. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
  292. package/dist/esm/plugins/type-ahead/index.js +2 -2
  293. package/dist/esm/plugins/type-ahead/messages.js +44 -4
  294. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -1
  295. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +17 -1
  296. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +10 -5
  297. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
  298. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
  299. package/dist/esm/plugins/type-ahead/utils.js +38 -0
  300. package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
  301. package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
  302. package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -2
  303. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
  304. package/dist/esm/ui/CollapsedEditor/index.js +3 -2
  305. package/dist/esm/ui/ColorPickerButton/index.js +2 -1
  306. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -5
  307. package/dist/esm/ui/ConfigPanel/FormContent.js +3 -3
  308. package/dist/esm/ui/ContentStyles/index.js +1 -1
  309. package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -0
  310. package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
  311. package/dist/esm/utils/commands.js +25 -13
  312. package/dist/esm/utils/input-rules.js +23 -1
  313. package/dist/esm/version-wrapper.js +1 -1
  314. package/dist/esm/version.json +1 -1
  315. package/dist/types/create-editor/messages.d.ts +7 -0
  316. package/dist/types/i18n/index.d.ts +4 -4
  317. package/dist/types/i18n/languages.d.ts +8 -3
  318. package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
  319. package/dist/types/labs/next/presets/default.d.ts +2 -2
  320. package/dist/types/labs/next/presets/mobile.d.ts +1 -1
  321. package/dist/types/labs/next/presets/preset.d.ts +10 -6
  322. package/dist/types/plugins/alignment/index.d.ts +2 -2
  323. package/dist/types/plugins/analytics/plugin.d.ts +2 -2
  324. package/dist/types/plugins/annotation/index.d.ts +2 -2
  325. package/dist/types/plugins/avatar-group/index.d.ts +4 -3
  326. package/dist/types/plugins/base/index.d.ts +2 -2
  327. package/dist/types/plugins/before-primaryToolbar/index.d.ts +4 -3
  328. package/dist/types/plugins/block-type/index.d.ts +2 -2
  329. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -1
  330. package/dist/types/plugins/breakout/index.d.ts +2 -2
  331. package/dist/types/plugins/caption/index.d.ts +2 -2
  332. package/dist/types/plugins/card/index.d.ts +2 -2
  333. package/dist/types/plugins/card/pm-plugins/doc.d.ts +4 -4
  334. package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
  335. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
  336. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +5 -5
  337. package/dist/types/plugins/card/utils.d.ts +2 -1
  338. package/dist/types/plugins/clear-marks-on-change-to-empty-document/index.d.ts +2 -2
  339. package/dist/types/plugins/clipboard/index.d.ts +2 -2
  340. package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -3
  341. package/dist/types/plugins/code-block/index.d.ts +2 -2
  342. package/dist/types/plugins/collab-edit/actions.d.ts +1 -1
  343. package/dist/types/plugins/collab-edit/index.d.ts +2 -2
  344. package/dist/types/plugins/context-panel/index.d.ts +2 -2
  345. package/dist/types/plugins/copy-button/index.d.ts +2 -2
  346. package/dist/types/plugins/custom-autoformat/index.d.ts +2 -2
  347. package/dist/types/plugins/data-consumer/index.d.ts +2 -2
  348. package/dist/types/plugins/date/index.d.ts +2 -2
  349. package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -1
  350. package/dist/types/plugins/editor-disabled/index.d.ts +2 -2
  351. package/dist/types/plugins/emoji/index.d.ts +2 -2
  352. package/dist/types/plugins/emoji/types.d.ts +2 -1
  353. package/dist/types/plugins/expand/index.d.ts +2 -2
  354. package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -0
  355. package/dist/types/plugins/extension/commands.d.ts +2 -0
  356. package/dist/types/plugins/extension/index.d.ts +2 -2
  357. package/dist/types/plugins/extension/toolbar.d.ts +10 -0
  358. package/dist/types/plugins/fake-text-cursor/index.d.ts +2 -2
  359. package/dist/types/plugins/feature-flags-context/index.d.ts +2 -2
  360. package/dist/types/plugins/feedback-dialog/index.d.ts +3 -2
  361. package/dist/types/plugins/find-replace/index.d.ts +4 -3
  362. package/dist/types/plugins/floating-toolbar/index.d.ts +2 -2
  363. package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +4 -0
  364. package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +1 -8
  365. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +3 -0
  366. package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +4 -0
  367. package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +4 -0
  368. package/dist/types/plugins/floating-toolbar/ui/messages.d.ts +10 -0
  369. package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -1
  370. package/dist/types/plugins/floating-toolbar/utils.d.ts +2 -3
  371. package/dist/types/plugins/fragment/index.d.ts +2 -2
  372. package/dist/types/plugins/grid/index.d.ts +2 -2
  373. package/dist/types/plugins/help-dialog/index.d.ts +2 -3
  374. package/dist/types/plugins/history/index.d.ts +2 -2
  375. package/dist/types/plugins/hyperlink/index.d.ts +2 -2
  376. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -2
  377. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
  378. package/dist/types/plugins/image-upload/index.d.ts +2 -2
  379. package/dist/types/plugins/indentation/index.d.ts +2 -2
  380. package/dist/types/plugins/insert-block/index.d.ts +2 -2
  381. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
  382. package/dist/types/plugins/jira-issue/index.d.ts +2 -2
  383. package/dist/types/plugins/layout/index.d.ts +2 -2
  384. package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -2
  385. package/dist/types/plugins/list/index.d.ts +3 -2
  386. package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +3 -1
  387. package/dist/types/plugins/list/pm-plugins/main.d.ts +2 -2
  388. package/dist/types/plugins/list/types.d.ts +2 -0
  389. package/dist/types/plugins/macro/index.d.ts +2 -2
  390. package/dist/types/plugins/max-content-size/index.d.ts +2 -2
  391. package/dist/types/plugins/media/index.d.ts +2 -2
  392. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -1
  393. package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
  394. package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
  395. package/dist/types/plugins/mentions/index.d.ts +2 -2
  396. package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -2
  397. package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +2 -2
  398. package/dist/types/plugins/panel/index.d.ts +2 -2
  399. package/dist/types/plugins/paste/index.d.ts +3 -2
  400. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
  401. package/dist/types/plugins/placeholder/index.d.ts +4 -4
  402. package/dist/types/plugins/placeholder/styles.d.ts +0 -1
  403. package/dist/types/plugins/placeholder-text/index.d.ts +2 -2
  404. package/dist/types/plugins/quick-insert/index.d.ts +2 -2
  405. package/dist/types/plugins/rule/index.d.ts +2 -2
  406. package/dist/types/plugins/save-on-enter/index.d.ts +3 -2
  407. package/dist/types/plugins/scroll-into-view/index.d.ts +2 -2
  408. package/dist/types/plugins/selection/index.d.ts +2 -2
  409. package/dist/types/plugins/status/index.d.ts +2 -2
  410. package/dist/types/plugins/submit-editor/index.d.ts +4 -2
  411. package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -2
  412. package/dist/types/plugins/text-color/index.d.ts +3 -2
  413. package/dist/types/plugins/text-formatting/index.d.ts +2 -2
  414. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +4 -3
  415. package/dist/types/plugins/type-ahead/index.d.ts +2 -2
  416. package/dist/types/plugins/type-ahead/messages.d.ts +41 -1
  417. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +3 -1
  418. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +1 -0
  419. package/dist/types/plugins/type-ahead/utils.d.ts +7 -1
  420. package/dist/types/plugins/undo-redo/index.d.ts +2 -2
  421. package/dist/types/plugins/unsupported-content/index.d.ts +2 -2
  422. package/dist/types/plugins/view-update-subscription/index.d.ts +2 -2
  423. package/dist/types/plugins/width/index.d.ts +2 -2
  424. package/dist/types/test-utils.d.ts +2 -1
  425. package/dist/types/types/editor-plugin.d.ts +1 -1
  426. package/dist/types/types/editor-props.d.ts +0 -2
  427. package/dist/types/types/index.d.ts +1 -1
  428. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
  429. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  430. package/dist/types/ui/ConfigPanel/Fields/Fieldset.d.ts +2 -1
  431. package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -23
  432. package/dist/types/ui/ConfigPanel/types.d.ts +22 -0
  433. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  434. package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +1 -0
  435. package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +4 -1
  436. package/package.json +23 -23
  437. package/report.api.md +25 -16
  438. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +0 -181
  439. package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -66
  440. package/dist/cjs/plugins/emoji/ui/EmojiContextProvider/index.js +0 -61
  441. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +0 -151
  442. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
  443. package/dist/es2019/plugins/emoji/ui/EmojiContextProvider/index.js +0 -21
  444. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +0 -161
  445. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
  446. package/dist/esm/plugins/emoji/ui/EmojiContextProvider/index.js +0 -46
  447. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +0 -25
  448. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +0 -5
  449. package/dist/types/plugins/emoji/ui/EmojiContextProvider/index.d.ts +0 -13
@@ -1,17 +1,13 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { Fragment } from 'prosemirror-model';
5
- import { setSelectedCardAppearance, changeSelectedCardToLink } from '../pm-plugins/doc';
4
+ import React from 'react';
5
+ import nodeNames from '../../../messages';
6
6
  import { isSupportedInParent } from '../../../utils/nodes';
7
- import Dropdown from '../../floating-toolbar/ui/Dropdown';
8
7
  import { messages } from '../messages';
9
- import nodeNames from '../../../messages';
10
- import { getFeatureFlags } from '../../../plugins/feature-flags-context';
11
- import { LinkToolbarIconDropdown } from './LinkToolbarIconDropdown';
12
- import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
8
+ import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
13
9
  import { getButtonGroupOption } from './link-toolbar-button-group-options';
14
- import { getIconDropdownOption } from './link-toolbar-icon-dropdown-options';
10
+ import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
15
11
  export class LinkToolbarAppearance extends React.Component {
16
12
  constructor(...args) {
17
13
  super(...args);
@@ -82,34 +78,9 @@ export class LinkToolbarAppearance extends React.Component {
82
78
  options.push(embedOption);
83
79
  }
84
80
 
85
- const {
86
- viewChangingExperimentToolbarStyle
87
- } = getFeatureFlags(editorState);
88
-
89
- if (viewChangingExperimentToolbarStyle === 'toolbarIcons') {
90
- return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
91
- key: "link-toolbar-button-group",
92
- options: options.map(option => getButtonGroupOption(intl, dispatchCommand, option))
93
- });
94
- }
95
-
96
- if (viewChangingExperimentToolbarStyle === 'newDropdown') {
97
- return /*#__PURE__*/React.createElement(LinkToolbarIconDropdown, {
98
- key: "link-toolbar-icon-dropdown",
99
- title: "Change view",
100
- buttonTestId: "link-toolbar-appearance-button",
101
- dispatchCommand: dispatchCommand,
102
- options: options.map(option => getIconDropdownOption(intl, dispatchCommand, option))
103
- });
104
- }
105
-
106
- const title = intl.formatMessage(currentAppearance ? messages[currentAppearance] : messages.url);
107
- return /*#__PURE__*/React.createElement(Dropdown, {
108
- key: "link-toolbar",
109
- buttonTestId: "link-toolbar-appearance-button",
110
- title: title,
111
- dispatchCommand: dispatchCommand,
112
- options: options
81
+ return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
82
+ key: "link-toolbar-button-group",
83
+ options: options.map(option => getButtonGroupOption(intl, dispatchCommand, option))
113
84
  });
114
85
  });
115
86
  }
@@ -41,18 +41,31 @@ export const findCardInfo = state => {
41
41
  const pluginState = pluginKey.getState(state);
42
42
  return pluginState.cards.find(cardInfo => cardInfo.pos === state.selection.from);
43
43
  };
44
- export const transformUnsupportedBlockCardToInline = (slice, state) => {
44
+ export const transformUnsupportedBlockCardToInline = (slice, state, cardOptions) => {
45
45
  const {
46
46
  blockCard,
47
47
  inlineCard
48
48
  } = state.schema.nodes;
49
49
  const children = [];
50
50
  mapChildren(slice.content, (node, i, frag) => {
51
- if (node.type === blockCard && !isSupportedInParent(state, frag)) {
51
+ var _cardOptions$allowBlo;
52
+
53
+ if (node.type === blockCard && !isBlockCardSupported(state, frag, (_cardOptions$allowBlo = cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards) !== null && _cardOptions$allowBlo !== void 0 ? _cardOptions$allowBlo : false)) {
52
54
  children.push(inlineCard.createChecked(node.attrs, node.content, node.marks));
53
55
  } else {
54
56
  children.push(node);
55
57
  }
56
58
  });
57
59
  return new Slice(Fragment.fromArray(children), slice.openStart, slice.openEnd);
60
+ };
61
+ /**
62
+ * Function to determine if a block card is supported by the editor
63
+ * @param state
64
+ * @param frag
65
+ * @param allowBlockCards
66
+ * @returns
67
+ */
68
+
69
+ const isBlockCardSupported = (state, frag, allowBlockCards) => {
70
+ return allowBlockCards && isSupportedInParent(state, frag);
58
71
  };
@@ -18,7 +18,7 @@ export const handleInit = (initData, view, options) => {
18
18
  tr.setMeta('isRemote', true);
19
19
  view.dispatch(tr);
20
20
  } else if (json) {
21
- applyRemoteSteps(json, undefined, view);
21
+ applyRemoteSteps(json, view);
22
22
  }
23
23
  };
24
24
  export const handleConnection = (connectionData, view) => {
@@ -44,10 +44,10 @@ export const applyRemoteData = (remoteData, view, options) => {
44
44
  } = remoteData;
45
45
 
46
46
  if (json) {
47
- applyRemoteSteps(json, userIds, view, options);
47
+ applyRemoteSteps(json, view, userIds, options);
48
48
  }
49
49
  };
50
- export const applyRemoteSteps = (json, userIds, view, options) => {
50
+ export const applyRemoteSteps = (json, view, userIds, options) => {
51
51
  if (!json || !json.length) {
52
52
  return;
53
53
  }
@@ -17,7 +17,9 @@ export function getCopyButtonConfig(options) {
17
17
  state,
18
18
  formatMessage,
19
19
  onMouseEnter,
20
- onMouseLeave
20
+ onMouseLeave,
21
+ onFocus,
22
+ onBlur
21
23
  } = options;
22
24
  const copyButtonState = copyButtonPluginKey.getState(state);
23
25
  let buttonActionHandlers;
@@ -28,11 +30,11 @@ export function getCopyButtonConfig(options) {
28
30
  // Note for future changes: these two handlers should perform
29
31
  // the same action.
30
32
  onMouseEnter: onMouseEnter || hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
31
- onFocus: hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
33
+ onFocus: onFocus || hoverDecoration(options.nodeType, true, 'ak-editor-selected-node'),
32
34
  // Note for future changes: these two handlers should perform
33
35
  // the same action.
34
36
  onMouseLeave: resetCopiedState(options.nodeType, onMouseLeave),
35
- onBlur: resetCopiedState(options.nodeType)
37
+ onBlur: resetCopiedState(options.nodeType, onBlur)
36
38
  };
37
39
  } else {
38
40
  buttonActionHandlers = {
@@ -6,7 +6,6 @@ import WithPluginState from '../../ui/WithPluginState';
6
6
  import { insertDate, closeDatePicker, closeDatePickerWithAnalytics, createDate, deleteDate } from './actions';
7
7
  import createDatePlugin from './pm-plugins/main';
8
8
  import keymap from './pm-plugins/keymap';
9
- import { getFeatureFlags } from '../feature-flags-context';
10
9
  import { pluginKey as editorDisabledPluginKey } from '../editor-disabled';
11
10
  import { IconDate } from '../quick-insert/assets';
12
11
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
@@ -53,7 +52,6 @@ const datePlugin = () => ({
53
52
  popupsScrollableElement
54
53
  }) {
55
54
  const {
56
- state,
57
55
  dispatch
58
56
  } = editorView;
59
57
  const domAtPos = editorView.domAtPos.bind(editorView);
@@ -76,16 +74,11 @@ const datePlugin = () => ({
76
74
  focusDateInput
77
75
  } = datePlugin;
78
76
  const element = findDomRefAtPos(showDatePickerAt, domAtPos);
79
- const allFlags = getFeatureFlags(state);
80
- const {
81
- keyboardAccessibleDatepicker
82
- } = allFlags;
83
77
  return /*#__PURE__*/React.createElement(DatePicker, {
84
78
  mountTo: popupsMountPoint,
85
79
  boundariesElement: popupsBoundariesElement,
86
80
  scrollableElement: popupsScrollableElement,
87
81
  key: showDatePickerAt,
88
- showTextField: keyboardAccessibleDatepicker,
89
82
  element: element,
90
83
  isNew: isNew,
91
84
  autoFocus: focusDateInput,
@@ -101,7 +101,6 @@ class DatePicker extends React.Component {
101
101
  mountTo,
102
102
  boundariesElement,
103
103
  scrollableElement,
104
- showTextField,
105
104
  intl,
106
105
  dispatchAnalyticsEvent,
107
106
  isNew,
@@ -143,7 +142,7 @@ class DatePicker extends React.Component {
143
142
  scrollableElement: scrollableElement
144
143
  }, jsx("div", {
145
144
  css: popupContentWrapper
146
- }, showTextField === true && jsx(DatePickerInput, {
145
+ }, jsx(DatePickerInput, {
147
146
  date: date,
148
147
  onNewDate: this.handleNewDate,
149
148
  onSubmitDate: this.handleKeyboardSubmitDate,
@@ -10,7 +10,6 @@ import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-inpu
10
10
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
11
11
  import { IconEmoji } from '../quick-insert/assets';
12
12
  import { EmojiNodeView } from './nodeviews/emoji';
13
- import { EmojiContextProvider } from './ui/EmojiContextProvider';
14
13
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
15
14
  import { openTypeAheadAtCursor } from '../type-ahead/transforms/open-typeahead-at-cursor';
16
15
  export const emojiToTypeaheadItem = (emoji, emojiProvider) => ({
@@ -22,18 +21,13 @@ export const emojiToTypeaheadItem = (emoji, emojiProvider) => ({
22
21
  onClick,
23
22
  onHover
24
23
  }) {
25
- return (
26
- /*#__PURE__*/
27
- // It's required to pass emojiProvider through the context for custom emojis to work
28
- React.createElement(EmojiContextProvider, {
29
- emojiProvider: emojiProvider
30
- }, /*#__PURE__*/React.createElement(EmojiTypeAheadItem, {
31
- emoji: emoji,
32
- selected: isSelected,
33
- onMouseMove: onHover,
34
- onSelection: onClick
35
- }))
36
- );
24
+ return /*#__PURE__*/React.createElement(EmojiTypeAheadItem, {
25
+ emoji: emoji,
26
+ selected: isSelected,
27
+ onMouseMove: onHover,
28
+ onSelection: onClick,
29
+ emojiProvider: emojiProvider
30
+ });
37
31
  },
38
32
 
39
33
  emoji
@@ -6,11 +6,11 @@ import { setExpandRef } from '../commands';
6
6
  import { findExpand } from '../utils';
7
7
  import { expandClassNames } from '../ui/class-names';
8
8
  import { getPluginState, createPluginState, pluginKey } from './plugin-factory';
9
+ export function containsClass(element, className) {
10
+ var _element$classList;
9
11
 
10
- function containsClass(element, className) {
11
- return !!element && element.classList.contains(className);
12
+ return Boolean(element === null || element === void 0 ? void 0 : (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(className));
12
13
  }
13
-
14
14
  export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLongPressSelection = false) => {
15
15
  const state = createPluginState(dispatch, {});
16
16
  const isMobile = appearance === 'mobile';
@@ -33,6 +33,7 @@ export const getToolbarConfig = (state, {
33
33
  id: 'editor.expand.delete',
34
34
  type: 'button',
35
35
  appearance: 'danger',
36
+ focusEditoronEnter: true,
36
37
  icon: RemoveIcon,
37
38
  onClick: deleteExpand(),
38
39
  onMouseEnter: hoverDecoration([nestedExpand, expand], true),
@@ -1,7 +1,8 @@
1
1
  import { removeSelectedNode, removeParentNodeOfType } from 'prosemirror-utils';
2
2
  import { applyChange } from '../context-panel/transforms';
3
3
  import { createCommand } from './plugin-factory';
4
- import { getSelectedExtension } from './utils'; // AFP-2532 TODO: Fix automatic suppressions below
4
+ import { getSelectedExtension } from './utils';
5
+ import { removeConnectedNodes } from '@atlaskit/editor-common/utils'; // AFP-2532 TODO: Fix automatic suppressions below
5
6
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
6
7
 
7
8
  export function updateState(state) {
@@ -70,4 +71,12 @@ export const removeExtension = () => createCommand({
70
71
  } else {
71
72
  return removeParentNodeOfType(state.schema.nodes.bodiedExtension)(tr);
72
73
  }
74
+ });
75
+ export const removeDescendantNodes = sourceNode => createCommand({
76
+ type: 'UPDATE_STATE',
77
+ data: {
78
+ element: undefined
79
+ }
80
+ }, (tr, state) => {
81
+ return sourceNode ? removeConnectedNodes(state, sourceNode) : tr;
73
82
  });
@@ -129,6 +129,16 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
129
129
  if (!selectedExtension) {
130
130
  if (showContextPanel) {
131
131
  clearEditingContext(state, dispatch);
132
+ } // if an extension is no longer selected, but the plugin has cached the previous selected extension id/ref
133
+ // then this should clear those values so that if an exention is selected again, then this sees it as a change
134
+ // and updates the state correctly.
135
+
136
+
137
+ if (!!localId || !!element) {
138
+ updateState({
139
+ localId: undefined,
140
+ element: undefined
141
+ })(state, dispatch);
132
142
  }
133
143
 
134
144
  return;
@@ -10,24 +10,34 @@ import { hoverDecoration } from '../base/pm-plugins/decoration';
10
10
  import { editExtension } from './actions';
11
11
  import { getPluginState } from './pm-plugins/main';
12
12
  import { getSelectedExtension } from './utils';
13
- import { updateExtensionLayout, removeExtension } from './commands';
13
+ import { updateExtensionLayout, removeExtension, removeDescendantNodes } from './commands';
14
14
  import { pluginKey as macroPluginKey } from '../macro/plugin-key';
15
- import { isReferencedSource } from '@atlaskit/editor-common/utils';
15
+ import { isReferencedSource, getChildrenInfo, getNodeName } from '@atlaskit/editor-common/utils';
16
16
  export const messages = defineMessages({
17
17
  edit: {
18
18
  id: 'fabric.editor.edit',
19
19
  defaultMessage: 'Edit',
20
20
  description: 'Edit the properties for this extension.'
21
21
  },
22
+ deleteElementTitle: {
23
+ id: 'fabric.editor.extension.deleteElementTitle',
24
+ defaultMessage: 'Delete element',
25
+ description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
26
+ },
22
27
  confirmDeleteLinkedModalOKButton: {
23
28
  id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
24
- defaultMessage: 'Remove extension',
29
+ defaultMessage: 'Delete',
25
30
  description: 'Action button label for confirm modal when deleting an extension linked to a data consumer.'
26
31
  },
27
32
  confirmDeleteLinkedModalMessage: {
28
33
  id: 'fabric.editor.extension.confirmDeleteLinkedModalMessage',
29
- defaultMessage: 'Removing this extension will break anything connected to it.',
34
+ defaultMessage: 'Deleting {nodeName} will break anything connected to it.',
30
35
  description: 'Message for confirm modal when deleting a extension linked to an data consumer.'
36
+ },
37
+ confirmModalCheckboxLabel: {
38
+ id: 'fabric.editor.floatingToolbar.confirmModalCheckboxLabel',
39
+ defaultMessage: 'Also delete connected elements',
40
+ description: 'checkbox label text'
31
41
  }
32
42
  });
33
43
 
@@ -106,7 +116,8 @@ const editButton = (formatMessage, extensionState) => {
106
116
  return true;
107
117
  },
108
118
  title: formatMessage(messages.edit),
109
- tabIndex: null
119
+ tabIndex: null,
120
+ focusEditoronEnter: true
110
121
  }];
111
122
  };
112
123
 
@@ -125,9 +136,18 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
125
136
  let confirmDialog;
126
137
 
127
138
  if (isReferencedSource(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
128
- confirmDialog = {
129
- okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
130
- message: formatMessage(messages.confirmDeleteLinkedModalMessage)
139
+ confirmDialog = () => {
140
+ return {
141
+ title: formatMessage(messages.deleteElementTitle),
142
+ okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
143
+ message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
144
+ nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
145
+ }),
146
+ isReferentialityDialog: true,
147
+ getChildrenInfo: () => getChildrenInfo(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node),
148
+ checkboxLabel: formatMessage(messages.confirmModalCheckboxLabel),
149
+ onConfirm: (isChecked = false) => clickWithCheckboxHandler(isChecked, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
150
+ };
131
151
  };
132
152
  }
133
153
 
@@ -160,6 +180,7 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
160
180
  onMouseLeave: hoverDecoration(nodeType, false),
161
181
  onFocus: hoverDecoration(nodeType, true),
162
182
  onBlur: hoverDecoration(nodeType, false),
183
+ focusEditoronEnter: true,
163
184
  title: formatMessage(commonMessages.remove),
164
185
  tabIndex: null,
165
186
  confirmDialog
@@ -169,4 +190,18 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
169
190
  }
170
191
 
171
192
  return;
193
+ };
194
+
195
+ const clickWithCheckboxHandler = (isChecked, node) => (state, dispatch) => {
196
+ if (!node) {
197
+ return false;
198
+ }
199
+
200
+ if (!isChecked) {
201
+ removeExtension()(state, dispatch);
202
+ } else {
203
+ removeDescendantNodes(node)(state, dispatch);
204
+ }
205
+
206
+ return true;
172
207
  };
@@ -26,7 +26,7 @@ function getSpellCheck(featureFlags) {
26
26
 
27
27
 
28
28
  export function createFeatureFlagsFromProps(props) {
29
- var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39;
29
+ var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42;
30
30
 
31
31
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
32
32
  const tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
@@ -34,11 +34,9 @@ export function createFeatureFlagsFromProps(props) {
34
34
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
35
35
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
36
36
  placeholderBracketHint: !!props.placeholderBracketHint,
37
- placeholderHints: Array.isArray(props.placeholderHints) && props.placeholderHints.length > 0,
38
37
  moreTextColors: typeof props.allowTextColor === 'boolean' ? false : Boolean(((_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) === true),
39
38
  findReplace: !!props.allowFindReplace,
40
39
  findReplaceMatchCase: typeof props.allowFindReplace === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
41
- keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
42
40
  addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
43
41
  singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
44
42
  undoRedoButtons: props.allowUndoRedoButtons,
@@ -59,17 +57,19 @@ export function createFeatureFlagsFromProps(props) {
59
57
  saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
60
58
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
61
59
  chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
62
- viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
63
60
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
64
- showHoverPreview: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.showHoverPreview) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.showHoverPreview) : false),
65
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags33 = props.featureFlags) !== null && _props$featureFlags33 !== void 0 && _props$featureFlags33.indentationButtonsInTheToolbar) : false)),
66
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags35 = props.featureFlags) !== null && _props$featureFlags35 !== void 0 && _props$featureFlags35.floatingToolbarCopyButton) : false)),
67
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
61
+ showHoverPreview: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.showHoverPreview) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.showHoverPreview) : false),
62
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.indentationButtonsInTheToolbar) : false)),
63
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.floatingToolbarCopyButton) : false)),
64
+ floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
68
65
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
69
66
  // Including fallback to props.featureFlags so that mobile feature flags
70
67
  // are included (they are not kebab cased)
71
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.restartNumberedLists) === true,
72
- listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.listNumberContinuity) === true,
73
- restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.restartNumberedListsToolbar) === true
68
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.restartNumberedLists) === true,
69
+ listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.listNumberContinuity) === true,
70
+ restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedListsToolbar) === true,
71
+ useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags40 = props.featureFlags) !== null && _props$featureFlags40 !== void 0 && _props$featureFlags40.useSomewhatSemanticTextColorNames) : false)),
72
+ lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
73
+ preventPopupOverflow: Boolean(typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42['prevent-popup-overflow']) : false)
74
74
  };
75
75
  }
@@ -11,7 +11,8 @@ import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
11
11
  import Dropdown from '../../../ui/Dropdown';
12
12
  import FindReplace from './FindReplace';
13
13
  import { TRIGGER_METHOD } from '../../analytics/types';
14
- import { ToolTipContent, findKeymapByDescription } from '../../../keymaps';
14
+ import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
15
+ import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
15
16
  const toolbarButtonWrapper = css`
16
17
  display: flex;
17
18
  flex: 1 1 auto;
@@ -72,6 +73,7 @@ class FindReplaceToolbarButton extends React.PureComponent {
72
73
  } = this.props;
73
74
  const title = formatMessage(messages.findReplaceToolbarButton);
74
75
  const stackBelowOtherEditorFloatingPanels = akEditorFloatingPanelZIndex - 1;
76
+ const keymap = findKeymapByDescription('Find');
75
77
  return jsx("div", {
76
78
  css: [toolbarButtonWrapper, takeFullWidth && toolbarButtonWrapperFullWith]
77
79
  }, jsx(Dropdown, {
@@ -95,14 +97,16 @@ class FindReplaceToolbarButton extends React.PureComponent {
95
97
  selected: isActive,
96
98
  title: jsx(ToolTipContent, {
97
99
  description: title,
98
- keymap: findKeymapByDescription('Find')
100
+ keymap: keymap
99
101
  }),
100
102
  iconBefore: jsx(EditorSearchIcon, {
101
103
  label: title
102
104
  }),
103
105
  onClick: this.toggleOpen,
104
106
  "aria-expanded": isActive,
105
- "aria-haspopup": true
107
+ "aria-haspopup": true,
108
+ "aria-label": keymap ? tooltip(keymap, title) : title,
109
+ "aria-keyshortcuts": getAriaKeyshortcuts(keymap)
106
110
  })
107
111
  }, jsx("div", {
108
112
  css: wrapper
@@ -190,7 +190,9 @@ const floatingToolbarPlugin = () => ({
190
190
  zIndex,
191
191
  offset = [0, 12],
192
192
  forcePlacement,
193
- onPositionCalculated
193
+ preventPopupOverflow,
194
+ onPositionCalculated,
195
+ focusTrap
194
196
  } = config;
195
197
  const targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
196
198
 
@@ -215,6 +217,7 @@ const floatingToolbarPlugin = () => ({
215
217
  } = floatingToolbarData || {};
216
218
  const confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
217
219
  const scrollable = getFeatureFlags(editorView.state).floatingToolbarCopyButton && config.scrollable;
220
+ const confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
218
221
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
219
222
  component: ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
220
223
  componentId: camelCase(title),
@@ -237,7 +240,9 @@ const floatingToolbarPlugin = () => ({
237
240
  onPositionCalculated: customPositionCalculation,
238
241
  style: scrollable ? {
239
242
  maxWidth: '100%'
240
- } : {}
243
+ } : {},
244
+ focusTrap: focusTrap,
245
+ preventOverflow: preventPopupOverflow
241
246
  }, /*#__PURE__*/React.createElement(ToolbarLoader, {
242
247
  target: targetRef,
243
248
  items: toolbarItems,
@@ -254,9 +259,14 @@ const floatingToolbarPlugin = () => ({
254
259
  extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
255
260
  scrollable: scrollable
256
261
  })), /*#__PURE__*/React.createElement(ConfirmationModal, {
257
- options: confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog,
258
- onConfirm: () => {
259
- dispatchCommand(confirmButtonItem.onClick);
262
+ options: confirmDialogOptions,
263
+ onConfirm: (isChecked = false) => {
264
+ if (!!confirmDialogOptions.onConfirm) {
265
+ dispatchCommand(confirmDialogOptions.onConfirm(isChecked));
266
+ } else {
267
+ dispatchCommand(confirmButtonItem.onClick);
268
+ }
269
+
260
270
  dispatchCommand(hideConfirmDialog());
261
271
  } // When closed without clicking OK or cancel buttons
262
272
  ,
@@ -0,0 +1,70 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useState } from 'react';
3
+ import Button from '@atlaskit/button/standard-button';
4
+ import { Checkbox } from '@atlaskit/checkbox';
5
+ import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
6
+ import messages from './messages';
7
+ export const CheckboxModal = props => {
8
+ const [isChecked, setCheckbox] = useState(false);
9
+ const {
10
+ onConfirm,
11
+ onClose,
12
+ options,
13
+ intl: {
14
+ formatMessage
15
+ },
16
+ testId
17
+ } = props;
18
+ const heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(messages.confirmModalDefaultHeading);
19
+ const okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
20
+ const cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
21
+ const checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
22
+
23
+ const ListComponent = ({
24
+ nodes
25
+ }) => {
26
+ if (!nodes) {
27
+ return null;
28
+ }
29
+
30
+ return /*#__PURE__*/React.createElement("ul", null, nodes.map(node => /*#__PURE__*/React.createElement(ListItem, _extends({}, node, {
31
+ key: node.id
32
+ }))));
33
+ };
34
+
35
+ const ListItem = props => {
36
+ const {
37
+ id,
38
+ name,
39
+ amount
40
+ } = props;
41
+ return /*#__PURE__*/React.createElement("li", {
42
+ id: id
43
+ }, formatMessage(messages.confirmModalListUnit, {
44
+ name,
45
+ amount
46
+ }));
47
+ };
48
+
49
+ return /*#__PURE__*/React.createElement(Modal, {
50
+ onClose: onClose,
51
+ testId: testId
52
+ }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
53
+ appearance: "warning"
54
+ }, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (options === null || options === void 0 ? void 0 : options.getChildrenInfo) && /*#__PURE__*/React.createElement(ListComponent, {
55
+ nodes: options === null || options === void 0 ? void 0 : options.getChildrenInfo()
56
+ }), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Checkbox, {
57
+ isChecked: isChecked,
58
+ onChange: () => setCheckbox(!isChecked),
59
+ label: checkboxlabel,
60
+ testId: testId ? `${testId}-checkbox` : undefined
61
+ }))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
62
+ appearance: "default",
63
+ onClick: onClose,
64
+ testId: testId ? `${testId}-cancel-button` : undefined
65
+ }, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
66
+ appearance: "warning",
67
+ onClick: () => onConfirm(isChecked),
68
+ testId: testId ? `${testId}-confirm-button` : undefined
69
+ }, okButtonLabel)));
70
+ };