@atlaskit/editor-core 151.1.2 → 152.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 (339) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +22 -8
  3. package/dist/cjs/create-editor/create-plugins-list.js +30 -11
  4. package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
  5. package/dist/cjs/labs/next/presets/default.js +3 -1
  6. package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
  7. package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
  8. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  9. package/dist/cjs/plugins/annotation/utils.js +19 -8
  10. package/dist/cjs/plugins/avatar-group/index.js +2 -1
  11. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  12. package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
  13. package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
  14. package/dist/cjs/plugins/code-bidi-warning/index.js +5 -2
  15. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  16. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  17. package/dist/cjs/plugins/code-block/index.js +3 -3
  18. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  19. package/dist/cjs/plugins/code-block/pm-plugins/main.js +11 -3
  20. package/dist/cjs/plugins/extension/extension-api.js +10 -2
  21. package/dist/cjs/plugins/extension/ui/styles.js +1 -1
  22. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  23. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
  24. package/dist/cjs/plugins/find-replace/index.js +14 -137
  25. package/dist/cjs/plugins/find-replace/ui/Find.js +16 -9
  26. package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
  27. package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
  28. package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
  29. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
  30. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  31. package/dist/cjs/plugins/fragment/index.js +34 -0
  32. package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
  33. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  34. package/dist/cjs/plugins/index.js +16 -0
  35. package/dist/cjs/plugins/list/actions/conversions.js +39 -71
  36. package/dist/cjs/plugins/list/transforms.js +7 -1
  37. package/dist/cjs/plugins/media/index.js +2 -3
  38. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
  39. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
  40. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
  41. package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
  42. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  43. package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
  44. package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
  45. package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
  46. package/dist/cjs/plugins/media/toolbar/index.js +90 -3
  47. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  48. package/dist/cjs/plugins/media/utils/media-common.js +1 -1
  49. package/dist/cjs/plugins/media/utils/media-files.js +5 -1
  50. package/dist/cjs/plugins/panel/actions.js +2 -2
  51. package/dist/cjs/plugins/panel/index.js +3 -3
  52. package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
  53. package/dist/cjs/plugins/panel/toolbar.js +10 -5
  54. package/dist/cjs/plugins/panel/utils.js +15 -0
  55. package/dist/cjs/plugins/rank.js +3 -2
  56. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
  57. package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
  58. package/dist/cjs/plugins/table/commands/insert.js +1 -0
  59. package/dist/cjs/plugins/table/index.js +3 -2
  60. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
  61. package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
  62. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  63. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  64. package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
  65. package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
  66. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  67. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  68. package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
  69. package/dist/cjs/plugins/table/ui/consts.js +1 -1
  70. package/dist/cjs/plugins/table/ui/messages.js +1 -1
  71. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  72. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  73. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
  74. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  75. package/dist/cjs/plugins/text-formatting/index.js +2 -1
  76. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
  77. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
  78. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
  79. package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
  80. package/dist/cjs/ui/ColorPalette/index.js +7 -4
  81. package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
  82. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
  83. package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
  84. package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
  85. package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
  86. package/dist/cjs/ui/DropdownMenu/index.js +3 -1
  87. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
  88. package/dist/cjs/ui/Resizer/index.js +9 -1
  89. package/dist/cjs/version-wrapper.js +1 -1
  90. package/dist/cjs/version.json +1 -1
  91. package/dist/es2019/create-editor/ReactEditorView.js +19 -8
  92. package/dist/es2019/create-editor/create-plugins-list.js +31 -12
  93. package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
  94. package/dist/es2019/labs/next/presets/default.js +3 -1
  95. package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
  96. package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
  97. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  98. package/dist/es2019/plugins/annotation/utils.js +18 -7
  99. package/dist/es2019/plugins/avatar-group/index.js +2 -1
  100. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
  101. package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
  102. package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  103. package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
  104. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
  105. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
  106. package/dist/es2019/plugins/code-block/index.js +3 -2
  107. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  108. package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
  109. package/dist/es2019/plugins/extension/extension-api.js +9 -2
  110. package/dist/es2019/plugins/extension/ui/styles.js +6 -0
  111. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  112. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
  113. package/dist/es2019/plugins/find-replace/index.js +15 -128
  114. package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
  115. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
  116. package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
  117. package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
  118. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  119. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
  120. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  121. package/dist/es2019/plugins/fragment/index.js +22 -0
  122. package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
  123. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  124. package/dist/es2019/plugins/index.js +2 -0
  125. package/dist/es2019/plugins/list/actions/conversions.js +38 -69
  126. package/dist/es2019/plugins/list/transforms.js +5 -1
  127. package/dist/es2019/plugins/media/index.js +2 -2
  128. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
  129. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
  130. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
  131. package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
  132. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  133. package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
  134. package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
  135. package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
  136. package/dist/es2019/plugins/media/toolbar/index.js +90 -3
  137. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
  138. package/dist/es2019/plugins/media/utils/media-common.js +1 -1
  139. package/dist/es2019/plugins/media/utils/media-files.js +6 -1
  140. package/dist/es2019/plugins/panel/actions.js +2 -2
  141. package/dist/es2019/plugins/panel/index.js +5 -5
  142. package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
  143. package/dist/es2019/plugins/panel/toolbar.js +10 -5
  144. package/dist/es2019/plugins/panel/utils.js +8 -1
  145. package/dist/es2019/plugins/rank.js +3 -2
  146. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
  147. package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
  148. package/dist/es2019/plugins/table/commands/insert.js +1 -2
  149. package/dist/es2019/plugins/table/index.js +2 -1
  150. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  151. package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
  152. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  153. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  154. package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
  155. package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
  156. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  157. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  158. package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
  159. package/dist/es2019/plugins/table/ui/consts.js +2 -2
  160. package/dist/es2019/plugins/table/ui/messages.js +1 -1
  161. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  162. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  163. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  164. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  165. package/dist/es2019/plugins/text-formatting/index.js +3 -2
  166. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  167. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  168. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
  169. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
  170. package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
  171. package/dist/es2019/ui/ColorPalette/index.js +7 -4
  172. package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
  173. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
  174. package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
  175. package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
  176. package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
  177. package/dist/es2019/ui/Dropdown/index.js +2 -1
  178. package/dist/es2019/ui/DropdownMenu/index.js +7 -3
  179. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  180. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  181. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
  182. package/dist/es2019/ui/Resizer/index.js +9 -1
  183. package/dist/es2019/version-wrapper.js +1 -1
  184. package/dist/es2019/version.json +1 -1
  185. package/dist/esm/create-editor/ReactEditorView.js +22 -8
  186. package/dist/esm/create-editor/create-plugins-list.js +31 -12
  187. package/dist/esm/labs/next/presets/cxhtml.js +1 -2
  188. package/dist/esm/labs/next/presets/default.js +3 -1
  189. package/dist/esm/nodeviews/ReactNodeView.js +2 -2
  190. package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
  191. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  192. package/dist/esm/plugins/annotation/utils.js +18 -7
  193. package/dist/esm/plugins/avatar-group/index.js +2 -1
  194. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  195. package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
  196. package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  197. package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
  198. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  199. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  200. package/dist/esm/plugins/code-block/index.js +3 -3
  201. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  202. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  203. package/dist/esm/plugins/extension/extension-api.js +9 -2
  204. package/dist/esm/plugins/extension/ui/styles.js +1 -1
  205. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  206. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
  207. package/dist/esm/plugins/find-replace/index.js +14 -131
  208. package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
  209. package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
  210. package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
  211. package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
  212. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  213. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
  214. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  215. package/dist/esm/plugins/fragment/index.js +22 -0
  216. package/dist/esm/plugins/fragment/plugin-key.js +2 -0
  217. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  218. package/dist/esm/plugins/index.js +2 -0
  219. package/dist/esm/plugins/list/actions/conversions.js +38 -71
  220. package/dist/esm/plugins/list/transforms.js +7 -1
  221. package/dist/esm/plugins/media/index.js +2 -3
  222. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
  223. package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
  224. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
  225. package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
  226. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  227. package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
  228. package/dist/esm/plugins/media/toolbar/commands.js +45 -0
  229. package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
  230. package/dist/esm/plugins/media/toolbar/index.js +88 -3
  231. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  232. package/dist/esm/plugins/media/utils/media-common.js +1 -1
  233. package/dist/esm/plugins/media/utils/media-files.js +6 -1
  234. package/dist/esm/plugins/panel/actions.js +2 -2
  235. package/dist/esm/plugins/panel/index.js +5 -5
  236. package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
  237. package/dist/esm/plugins/panel/toolbar.js +9 -4
  238. package/dist/esm/plugins/panel/utils.js +13 -0
  239. package/dist/esm/plugins/rank.js +3 -2
  240. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
  241. package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
  242. package/dist/esm/plugins/table/commands/insert.js +1 -2
  243. package/dist/esm/plugins/table/index.js +3 -2
  244. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  245. package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
  246. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  247. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  248. package/dist/esm/plugins/table/transforms/column-width.js +13 -3
  249. package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
  250. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  251. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  252. package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
  253. package/dist/esm/plugins/table/ui/consts.js +2 -2
  254. package/dist/esm/plugins/table/ui/messages.js +1 -1
  255. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  256. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  257. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  258. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  259. package/dist/esm/plugins/text-formatting/index.js +3 -2
  260. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  261. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  262. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
  263. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
  264. package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
  265. package/dist/esm/ui/ColorPalette/index.js +7 -4
  266. package/dist/esm/ui/ColorPickerButton/index.js +1 -1
  267. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
  268. package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
  269. package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
  270. package/dist/esm/ui/ConfigPanel/utils.js +1 -6
  271. package/dist/esm/ui/Dropdown/index.js +2 -1
  272. package/dist/esm/ui/DropdownMenu/index.js +7 -3
  273. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  274. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  275. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
  276. package/dist/esm/ui/Resizer/index.js +9 -1
  277. package/dist/esm/version-wrapper.js +1 -1
  278. package/dist/esm/version.json +1 -1
  279. package/dist/types/labs/next/full-page.d.ts +1 -1
  280. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
  281. package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
  282. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  283. package/dist/types/plugins/analytics/types/events.d.ts +7 -1
  284. package/dist/types/plugins/annotation/utils.d.ts +1 -1
  285. package/dist/types/plugins/avatar-group/index.d.ts +1 -0
  286. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
  287. package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
  288. package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
  289. package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
  290. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
  291. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
  292. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
  293. package/dist/types/plugins/code-block/index.d.ts +1 -1
  294. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
  295. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
  296. package/dist/types/plugins/code-block/types.d.ts +2 -0
  297. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  298. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
  299. package/dist/types/plugins/find-replace/index.d.ts +1 -0
  300. package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
  301. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
  302. package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
  303. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
  304. package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
  305. package/dist/types/plugins/fragment/index.d.ts +5 -0
  306. package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
  307. package/dist/types/plugins/index.d.ts +2 -0
  308. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
  309. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
  310. package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
  311. package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
  312. package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
  313. package/dist/types/plugins/media/types.d.ts +0 -1
  314. package/dist/types/plugins/panel/actions.d.ts +1 -1
  315. package/dist/types/plugins/panel/types.d.ts +8 -2
  316. package/dist/types/plugins/quick-insert/index.d.ts +2 -1
  317. package/dist/types/plugins/table/commands/insert.d.ts +3 -0
  318. package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
  319. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
  320. package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
  321. package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
  322. package/dist/types/plugins/table/types.d.ts +8 -0
  323. package/dist/types/plugins/table/ui/consts.d.ts +1 -1
  324. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  325. package/dist/types/types/editor-props.d.ts +11 -1
  326. package/dist/types/types/feature-flags.d.ts +13 -0
  327. package/dist/types/types/index.d.ts +1 -1
  328. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  329. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
  330. package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
  331. package/dist/types/ui/ColorPalette/index.d.ts +1 -0
  332. package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
  333. package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
  334. package/dist/types/ui/Resizer/index.d.ts +1 -0
  335. package/package.json +35 -31
  336. package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
  337. package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  338. package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  339. package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
@@ -22,9 +22,9 @@ var generateColgroup = function generateColgroup(table) {
22
22
  // We slice here to guard against our colwidth array having more entries
23
23
  // Than the we actually span. We'll patch the document at a later point.
24
24
  cell.attrs.colwidth.slice(0, colspan).forEach(function (width) {
25
- cols.push(['col', {
25
+ cols.push(['col', width ? {
26
26
  style: "width: ".concat(width, "px;")
27
- }]);
27
+ } : {}]);
28
28
  });
29
29
  } else {
30
30
  // When we have merged cells on the first row (firstChild),
@@ -56,6 +56,7 @@ var getResizeState = function getResizeState(_ref) {
56
56
  cols: _cols,
57
57
  widths: _widths,
58
58
  maxSize: maxSize,
59
+ tableWidth: _tableWidth,
59
60
  overflow: _overflow
60
61
  };
61
62
  } // Getting the resize state from DOM
@@ -77,6 +78,7 @@ var getResizeState = function getResizeState(_ref) {
77
78
  cols: cols,
78
79
  widths: widths,
79
80
  maxSize: maxSize,
81
+ tableWidth: tableWidth,
80
82
  overflow: overflow
81
83
  };
82
84
  }; // updates Colgroup DOM node with new widths
@@ -11,6 +11,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
 
12
12
  var _tableMap = require("@atlaskit/editor-tables/table-map");
13
13
 
14
+ var _editorCommon = require("@atlaskit/editor-common");
15
+
14
16
  var _utils = require("../pm-plugins/table-resizing/utils");
15
17
 
16
18
  var _metadata = require("./metadata");
@@ -19,8 +21,6 @@ var _resizeState = require("../pm-plugins/table-resizing/utils/resize-state");
19
21
 
20
22
  var _misc = require("../pm-plugins/table-resizing/utils/misc");
21
23
 
22
- var _editorCommon = require("@atlaskit/editor-common");
23
-
24
24
  var _scaleTable = require("../pm-plugins/table-resizing/utils/scale-table");
25
25
 
26
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -132,7 +132,10 @@ var updateColumnWidths = function updateColumnWidths(resizeState, table, start)
132
132
  };
133
133
  };
134
134
  /**
135
- * This function is called when user inserts/deletes a column in a table to rescale all columns.
135
+ * This function is called when user inserts/deletes a column in a table to;
136
+ * - rescale all columns (if the table did not overflow before the insertion)
137
+ * - and update column widths.
138
+ *
136
139
  * This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
137
140
  * @param table
138
141
  * @param view
@@ -144,6 +147,8 @@ exports.updateColumnWidths = updateColumnWidths;
144
147
 
145
148
  var rescaleColumns = function rescaleColumns(table, view) {
146
149
  return function (tr) {
150
+ // If the table has been not been resized we skip updating the size
151
+ // of columns here.
147
152
  if (!view || !(0, _utils.hasTableBeenResized)(table.node)) {
148
153
  return tr;
149
154
  }
@@ -157,7 +162,8 @@ var rescaleColumns = function rescaleColumns(table, view) {
157
162
  return tr;
158
163
  }
159
164
 
160
- var layout = (0, _resizeState.normaliseTableLayout)(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
165
+ var layout = (0, _resizeState.normaliseTableLayout)(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout); // The is the width the table can reach before overflowing
166
+
161
167
  var maxSize = (0, _misc.getTableMaxWidth)({
162
168
  table: table.node,
163
169
  tableStart: table.start,
@@ -173,8 +179,11 @@ var rescaleColumns = function rescaleColumns(table, view) {
173
179
  domAtPos: domAtPos,
174
180
  maxSize: maxSize
175
181
  });
182
+ var previousTableWidth = resizeState.tableWidth - _editorCommon.tableNewColumnMinWidth;
183
+ var tableDidntPreviouslyOverflow = previousTableWidth <= maxSize; // If the new table width will result in the table going into an overflow state
184
+ // we resize the cells to avoid the overflow occuring
176
185
 
177
- if (resizeState.overflow) {
186
+ if (tableDidntPreviouslyOverflow && resizeState.overflow) {
178
187
  resizeState = (0, _scaleTable.scaleTableTo)(resizeState, maxSize);
179
188
  }
180
189
 
@@ -33,6 +33,36 @@ var fireAnalytics = function fireAnalytics() {
33
33
  user: '-'
34
34
  }]
35
35
  });
36
+ };
37
+
38
+ exports.fireAnalytics = fireAnalytics;
39
+
40
+ var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, reportInvalidTableCellSpanAttrs) {
41
+ var colspan = _ref.colspan,
42
+ rowspan = _ref.rowspan,
43
+ tableLocalId = _ref.tableLocalId;
44
+
45
+ if (colspan && colspan < 0) {
46
+ reportInvalidTableCellSpanAttrs({
47
+ nodeType: 'tableCell',
48
+ attribute: 'colspan',
49
+ reason: 'negative value',
50
+ tableLocalId: tableLocalId,
51
+ spanValue: colspan
52
+ });
53
+ }
54
+
55
+ if (rowspan && rowspan < 0) {
56
+ reportInvalidTableCellSpanAttrs({
57
+ nodeType: 'tableCell',
58
+ attribute: 'rowspan',
59
+ reason: 'negative value',
60
+ tableLocalId: tableLocalId,
61
+ spanValue: rowspan
62
+ });
63
+ }
64
+
65
+ return;
36
66
  }; // We attempt to patch the document when we have extra, unneeded, column widths
37
67
  // Take this node for example:
38
68
  //
@@ -42,14 +72,21 @@ var fireAnalytics = function fireAnalytics() {
42
72
  // We remove the third width here, assumed duplicate content.
43
73
 
44
74
 
45
- exports.fireAnalytics = fireAnalytics;
46
-
47
- var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr) {
75
+ var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs) {
48
76
  var hasProblems = false;
49
77
  tr = replaceCells(tr, node, basePos, function (cell) {
50
78
  var _cell$attrs = cell.attrs,
51
79
  colwidth = _cell$attrs.colwidth,
52
- colspan = _cell$attrs.colspan;
80
+ colspan = _cell$attrs.colspan,
81
+ rowspan = _cell$attrs.rowspan;
82
+
83
+ if (reportInvalidTableCellSpanAttrs) {
84
+ validateTableCellNodeAttrs({
85
+ colspan: colspan,
86
+ rowspan: rowspan,
87
+ tableLocalId: node.attrs.localId
88
+ }, reportInvalidTableCellSpanAttrs);
89
+ }
53
90
 
54
91
  if (colwidth && colwidth.length > colspan) {
55
92
  hasProblems = true;
@@ -73,12 +110,12 @@ var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, b
73
110
 
74
111
  exports.removeExtraneousColumnWidths = removeExtraneousColumnWidths;
75
112
 
76
- var fixTables = function fixTables(tr) {
113
+ var fixTables = function fixTables(tr, reportInvalidTableCellSpanAttrs) {
77
114
  var hasProblems = false;
78
115
  tr.doc.descendants(function (node, pos) {
79
116
  if (node.type.name === 'table') {
80
117
  // in the unlikely event of having to fix multiple tables at the same time
81
- hasProblems = removeExtraneousColumnWidths(node, tr.mapping.map(pos), tr);
118
+ hasProblems = removeExtraneousColumnWidths(node, tr.mapping.map(pos), tr, reportInvalidTableCellSpanAttrs);
82
119
  }
83
120
  });
84
121
 
@@ -147,8 +147,9 @@ var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Component) {
147
147
  title: labelCellOptions,
148
148
  onClick: this.handleClick,
149
149
  iconBefore: /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
150
- label: labelCellOptions
151
- })
150
+ label: ""
151
+ }),
152
+ "aria-label": labelCellOptions
152
153
  }));
153
154
 
154
155
  var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
@@ -491,6 +491,7 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
491
491
  }
492
492
 
493
493
  return /*#__PURE__*/_react.default.createElement("div", {
494
+ "data-testid": "table-cell-contextual-menu",
494
495
  onMouseLeave: this.closeSubmenu
495
496
  }, /*#__PURE__*/_react.default.createElement(_DropdownMenu.default, {
496
497
  mountTo: mountPoint,
@@ -30,7 +30,7 @@ var _uiStyles = require("./ui-styles.css");
30
30
  var _templateObject, _templateObject2, _templateObject3;
31
31
 
32
32
  var rangeSelectionStyles = "\n.".concat(_types.TableCssClassName.NODEVIEW_WRAPPER, ".").concat(_editorSharedStyles.akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat((0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), "\n }\n}\n");
33
- var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}");
33
+ var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}");
34
34
  var tableStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: white !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button*/\n ", "\n /* Ends Delete button*/\n\n /* sticky styles */\n .", " .", " .", ":first-child {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n\n box-shadow: 0px -", "px white;\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: white;\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid white;\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid green;\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: white;\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-child {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-child {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid white;\n }\n\n ", "\n\n ", "\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: 0.3;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /* \n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-top: ", "px;\n margin-top: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n"])), _types.TableCssClassName.LAYOUT_BUTTON, _colors.N20A, _colors.N300, _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, _colors.B300, _editorCommon.tableSharedStyle, _uiStyles.columnControlsLineMarker, _uiStyles.hoveredDeleteButton, _uiStyles.hoveredCell, _uiStyles.hoveredWarningCell, _uiStyles.resizeHandle, rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, _consts.tableCellBackgroundColor, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, _uiStyles.insertColumnButtonWrapper, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, _uiStyles.insertRowButtonWrapper, _uiStyles.DeleteButton, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _consts.stickyRowOffsetTop, _consts.stickyRowZIndex, _colors.N40A, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.stickyRowZIndex + 1, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, _consts.tableBorderColor, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, function (props) {
35
35
  var _props$featureFlags;
36
36
 
@@ -48,7 +48,7 @@ var tableBorderSelectedColor = _colors.B300;
48
48
  exports.tableBorderSelectedColor = tableBorderSelectedColor;
49
49
  var tableCellDeleteColor = _colors.R50;
50
50
  exports.tableCellDeleteColor = tableCellDeleteColor;
51
- var tableBorderDeleteColor = _colors.R300;
51
+ var tableBorderDeleteColor = _colors.R400;
52
52
  exports.tableBorderDeleteColor = tableBorderDeleteColor;
53
53
  var tableToolbarDeleteColor = _colors.R75;
54
54
  exports.tableToolbarDeleteColor = tableToolbarDeleteColor;
@@ -40,7 +40,7 @@ var _default = (0, _reactIntl.defineMessages)({
40
40
  },
41
41
  confirmDeleteLinkedModalMessage: {
42
42
  id: 'fabric.editor.tables.confirmDeleteLinkedModalMessage',
43
- defaultMessage: 'Removing this table will also remove all of the data contained in any connected charts.',
43
+ defaultMessage: 'Removing this table will break all the charts connected to it.',
44
44
  description: 'Message for confirm modal when deleting a table linked to an extension.'
45
45
  }
46
46
  });
@@ -87,7 +87,7 @@ var Decision = /*#__PURE__*/function (_ReactNodeView) {
87
87
  value: function update(node, decorations) {
88
88
  var _this = this;
89
89
 
90
- return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations, // Toggle the placeholder based on whether user input exists.
90
+ return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations, undefined, // Toggle the placeholder based on whether user input exists.
91
91
  function (_currentNode, _newNode) {
92
92
  return !_this.isContentEmpty(_newNode);
93
93
  });
@@ -170,7 +170,7 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
170
170
  value: function update(node, decorations) {
171
171
  var _this3 = this;
172
172
 
173
- return (0, _get2.default)((0, _getPrototypeOf2.default)(Task.prototype), "update", this).call(this, node, decorations, function (currentNode, newNode) {
173
+ return (0, _get2.default)((0, _getPrototypeOf2.default)(Task.prototype), "update", this).call(this, node, decorations, undefined, function (currentNode, newNode) {
174
174
  return (// Toggle the placeholder based on whether user input exists
175
175
  !_this3.isContentEmpty(newNode) && !!(currentNode.attrs.state === newNode.attrs.state)
176
176
  );
@@ -162,9 +162,9 @@ function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispa
162
162
  rest = (0, _objectWithoutProperties2.default)(_node$attrs, ["localId"]);
163
163
 
164
164
  if (localId === undefined || localId === null || localId === '') {
165
- tr.setNodeMarkup(pos, undefined, _objectSpread({
165
+ tr.step(new _utils.SetAttrsStep(pos, _objectSpread({
166
166
  localId: _adfSchema.uuid.generate()
167
- }, rest));
167
+ }, rest)));
168
168
  modified = true;
169
169
  }
170
170
  }
@@ -267,7 +267,8 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
267
267
  onClick: function onClick(color) {
268
268
  return _this2.changeTextColor(color, pluginState.disabled);
269
269
  },
270
- selectedColor: pluginState.color
270
+ selectedColor: pluginState.color,
271
+ isShowingMoreColors: isShowingMoreColors
271
272
  })), showMoreColorsToggle && /*#__PURE__*/_react.default.createElement(_styles2.ShowMoreWrapper, null, /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
272
273
  appearance: "subtle",
273
274
  onClick: this.handleShowMoreToggle,
@@ -107,7 +107,8 @@ var textFormatting = function textFormatting() {
107
107
  disabled = _ref6.disabled;
108
108
  return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
109
109
  plugins: {
110
- textFormattingState: _main.pluginKey
110
+ textFormattingState: _main.pluginKey,
111
+ clearFormattingPluginState: _clearFormatting.pluginKey
111
112
  },
112
113
  render: function render() {
113
114
  return /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
@@ -35,6 +35,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
35
35
 
36
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
37
 
38
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
38
39
  var ITEM_PADDING = 12;
39
40
  var LIST_ITEM_ESTIMATED_HEIGHT = _TypeAheadListItem.ICON_HEIGHT + ITEM_PADDING * 2;
40
41
  var LIST_MAX_HEIGHT = 380;
@@ -2,52 +2,103 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
8
10
  exports.FullPageToolbar = void 0;
9
11
 
10
- var _react = _interopRequireDefault(require("react"));
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
14
+ var _react = _interopRequireWildcard(require("react"));
11
15
 
12
16
  var _ui = _interopRequireDefault(require("../../../plugins/collab-edit/ui"));
13
17
 
18
+ var _FindReplaceToolbarButtonWithState = _interopRequireDefault(require("../../../plugins/find-replace/FindReplaceToolbarButtonWithState"));
19
+
20
+ var _BeforePrimaryToolbarWrapper = require("../../../plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper");
21
+
14
22
  var _Toolbar = _interopRequireDefault(require("../../Toolbar"));
15
23
 
16
24
  var _MainToolbar = require("./MainToolbar");
17
25
 
18
26
  var _context = require("../../ContextPanel/context");
19
27
 
28
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
+
30
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
+
20
32
  var FullPageToolbar = /*#__PURE__*/_react.default.memo(function (props) {
33
+ var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags4, _props$featureFlags5;
34
+
35
+ var _useState = (0, _react.useState)(false),
36
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
37
+ shouldSplitToolbar = _useState2[0],
38
+ setShouldSplitToolbar = _useState2[1];
39
+
40
+ var nonCustomToolbar = /*#__PURE__*/_react.default.createElement(_MainToolbar.NonCustomToolbarWrapper, null, props.beforeIcon && /*#__PURE__*/_react.default.createElement(_MainToolbar.MainToolbarIconBefore, null, props.beforeIcon), /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
41
+ editorView: props.editorView,
42
+ editorActions: props.editorActions,
43
+ eventDispatcher: props.eventDispatcher,
44
+ providerFactory: props.providerFactory,
45
+ appearance: props.appearance,
46
+ items: props.primaryToolbarComponents,
47
+ popupsMountPoint: props.popupsMountPoint,
48
+ popupsBoundariesElement: props.popupsBoundariesElement,
49
+ popupsScrollableElement: props.popupsScrollableElement,
50
+ disabled: props.disabled,
51
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
52
+ containerElement: props.containerElement,
53
+ hasMinWidth: props.hasMinWidth
54
+ }));
55
+
56
+ var customToolbar = /*#__PURE__*/_react.default.createElement(_MainToolbar.CustomToolbarWrapper, null, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? /*#__PURE__*/_react.default.createElement(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
57
+ beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
58
+ }) : null, (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : /*#__PURE__*/_react.default.createElement(_ui.default, {
59
+ editorView: props.editorView,
60
+ eventDispatcher: props.eventDispatcher,
61
+ inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
62
+ inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
63
+ isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
64
+ }), (_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.findReplace && (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.twoLineEditorToolbar ? /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButtonWithState.default, {
65
+ popupsBoundariesElement: props.popupsBoundariesElement,
66
+ popupsMountPoint: props.popupsMountPoint,
67
+ popupsScrollableElement: props.popupsScrollableElement,
68
+ editorView: props.editorView,
69
+ containerElement: props.containerElement,
70
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
71
+ }) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
72
+
73
+ (0, _react.useEffect)(function () {
74
+ var _props$featureFlags6;
75
+
76
+ if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
77
+ var updateOnResize = function updateOnResize() {
78
+ setShouldSplitToolbar(window.innerWidth <= _MainToolbar.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
79
+ };
80
+
81
+ window.addEventListener('resize', updateOnResize);
82
+ updateOnResize();
83
+ return function () {
84
+ return window.removeEventListener('resize', updateOnResize);
85
+ };
86
+ }
87
+ });
21
88
  return /*#__PURE__*/_react.default.createElement(_context.ContextPanelConsumer, null, function (_ref) {
22
- var _props$featureFlags;
89
+ var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
23
90
 
24
91
  var contextPanelWidth = _ref.width;
25
92
  return /*#__PURE__*/_react.default.createElement(_MainToolbar.MainToolbar, {
26
93
  "data-testid": "ak-editor-main-toolbar",
27
- showKeyline: props.showKeyline || contextPanelWidth > 0
28
- }, props.beforeIcon && /*#__PURE__*/_react.default.createElement(_MainToolbar.MainToolbarIconBefore, null, props.beforeIcon), /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
29
- editorView: props.editorView,
30
- editorActions: props.editorActions,
31
- eventDispatcher: props.eventDispatcher,
32
- providerFactory: props.providerFactory,
33
- appearance: props.appearance,
34
- items: props.primaryToolbarComponents,
35
- popupsMountPoint: props.popupsMountPoint,
36
- popupsBoundariesElement: props.popupsBoundariesElement,
37
- popupsScrollableElement: props.popupsScrollableElement,
38
- disabled: props.disabled,
39
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
40
- containerElement: props.containerElement,
41
- hasMinWidth: props.hasMinWidth
42
- }), /*#__PURE__*/_react.default.createElement(_MainToolbar.MainToolbarCustomComponentsSlot, {
43
- "data-testid": 'avatar-group-outside-plugin'
44
- }, (props === null || props === void 0 ? void 0 : (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.showAvatarGroupAsPlugin) === true ? null : /*#__PURE__*/_react.default.createElement(_ui.default, {
45
- editorView: props.editorView,
46
- eventDispatcher: props.eventDispatcher,
47
- inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
48
- inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
49
- isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected
50
- }), props.customPrimaryToolbarComponents));
94
+ showKeyline: props.showKeyline || contextPanelWidth > 0,
95
+ twoLineEditorToolbar: !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar)
96
+ }, /*#__PURE__*/_react.default.createElement(_MainToolbar.MainToolbarFirstChild, {
97
+ twoLineEditorToolbar: !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)
98
+ }, shouldSplitToolbar ? customToolbar : nonCustomToolbar), /*#__PURE__*/_react.default.createElement(_MainToolbar.MainToolbarSecondChild, {
99
+ "data-testid": 'avatar-group-outside-plugin',
100
+ twoLineEditorToolbar: !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)
101
+ }, shouldSplitToolbar ? nonCustomToolbar : customToolbar));
51
102
  });
52
103
  });
53
104
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.SecondaryToolbar = exports.MainToolbarCustomComponentsSlot = exports.MainToolbarIconBefore = exports.MainToolbar = void 0;
8
+ exports.CustomToolbarWrapper = exports.NonCustomToolbarWrapper = exports.SecondaryToolbar = exports.MainToolbarSecondChild = exports.MainToolbarFirstChild = exports.MainToolbarIconBefore = exports.MainToolbar = exports.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = void 0;
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
 
@@ -17,13 +17,17 @@ var _constants = require("@atlaskit/theme/constants");
17
17
 
18
18
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
19
 
20
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
20
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
21
21
 
22
+ var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
23
+ exports.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT;
22
24
  var toolbarLineHeight = 56;
23
25
 
24
- var MainToolbar = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n box-shadow: ", ";\n transition: box-shadow 200ms ", ";\n z-index: ", ";\n display: flex;\n height: ", "px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n\n @media (max-width: ", "px) {\n display: grid;\n height: calc(", "px * 2);\n }\n"])), function (props) {
26
+ var MainToolbar = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n box-shadow: ", ";\n transition: box-shadow 200ms ", ";\n z-index: ", ";\n display: flex;\n height: ", "px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n\n @media (max-width: ", "px) {\n ", "\n }\n\n @media (max-width: ", "px) {\n display: grid;\n height: calc(", "px * 2);\n }\n"])), function (props) {
25
27
  return props.showKeyline ? "0 ".concat(_editorSharedStyles.akEditorToolbarKeylineHeight, "px 0 0 ").concat(_colors.N30) : 'none';
26
- }, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorMenuZIndex, toolbarLineHeight, _editorSharedStyles.akEditorMobileMaxWidth, toolbarLineHeight);
28
+ }, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorMenuZIndex, toolbarLineHeight, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, function (props) {
29
+ return props.twoLineEditorToolbar && "\n flex-wrap: wrap;\n height: calc(".concat(toolbarLineHeight, "px * 2);\n ");
30
+ }, _editorSharedStyles.akEditorMobileMaxWidth, toolbarLineHeight);
27
31
 
28
32
  exports.MainToolbar = MainToolbar;
29
33
  MainToolbar.displayName = 'MainToolbar';
@@ -33,12 +37,31 @@ var MainToolbarIconBefore = _styledComponents.default.div(_templateObject2 || (_
33
37
  exports.MainToolbarIconBefore = MainToolbarIconBefore;
34
38
  MainToolbarIconBefore.displayName = 'MainToolbarIconBefore';
35
39
 
36
- var MainToolbarCustomComponentsSlot = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n // ED-10241: We add fit-content to ensure that MainToolbar does not\n // shrink more than the size of its contents. This will prevent the\n // find/replace icon from being overlapped during a confluence\n // publish operation\n min-width: fit-content;\n @media (max-width: ", "px) {\n grid-column: 1;\n grid-row: 1;\n }\n"])), _editorSharedStyles.akEditorMobileMaxWidth);
40
+ var MainToolbarFirstChild = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-grow: 1;\n\n @media (max-width: ", "px) {\n ", "\n }\n @media (max-width: ", "px) {\n grid-column: 1;\n grid-row: 1;\n }\n"])), MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, function (props) {
41
+ return props.twoLineEditorToolbar && "\n flex: 1 1 100%;\n height: ".concat(toolbarLineHeight, "px;\n justify-content: flex-end;\n // ED-10241: We add fit-content to ensure that MainToolbar does not\n // shrink more than the size of its contents. This will prevent the\n // find/replace icon from being overlapped during a confluence\n // publish operation\n min-width: fit-content;\n ");
42
+ }, _editorSharedStyles.akEditorMobileMaxWidth);
37
43
 
38
- exports.MainToolbarCustomComponentsSlot = MainToolbarCustomComponentsSlot;
39
- MainToolbarCustomComponentsSlot.displayName = 'MainToolbar';
44
+ exports.MainToolbarFirstChild = MainToolbarFirstChild;
45
+ MainToolbarFirstChild.displayName = 'MainToolbarFirstChild';
40
46
 
41
- var SecondaryToolbar = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n flex-shrink: 0;\n display: flex;\n padding: 24px 0;\n"])));
47
+ var MainToolbarSecondChild = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n // ED-10241: We add fit-content to ensure that MainToolbar does not\n // shrink more than the size of its contents. This will prevent the\n // find/replace icon from being overlapped during a confluence\n // publish operation\n min-width: fit-content;\n @media (max-width: ", "px) {\n ", "\n }\n"])), MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, function (props) {
48
+ return props.twoLineEditorToolbar && "\n display: flex;\n flex-grow: 1;\n flex: 1 1 100%;\n margin: auto;\n height: ".concat(toolbarLineHeight, "px;\n min-width: 0;\n ");
49
+ });
50
+
51
+ exports.MainToolbarSecondChild = MainToolbarSecondChild;
52
+ MainToolbarSecondChild.displayName = 'MainToolbarSecondChild';
53
+
54
+ var SecondaryToolbar = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n flex-shrink: 0;\n display: flex;\n padding: 24px 0;\n"])));
42
55
 
43
56
  exports.SecondaryToolbar = SecondaryToolbar;
44
- SecondaryToolbar.displayName = 'SecondaryToolbar';
57
+ SecondaryToolbar.displayName = 'SecondaryToolbar';
58
+
59
+ var NonCustomToolbarWrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n display: flex;\n flex-grow: 1;\n"])));
60
+
61
+ exports.NonCustomToolbarWrapper = NonCustomToolbarWrapper;
62
+ NonCustomToolbarWrapper.displayName = 'NonCustomToolbar';
63
+
64
+ var CustomToolbarWrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n display: flex;\n"])));
65
+
66
+ exports.CustomToolbarWrapper = CustomToolbarWrapper;
67
+ CustomToolbarWrapper.displayName = 'CustomToolbar';
@@ -25,8 +25,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
25
25
 
26
26
  var _react = _interopRequireWildcard(require("react"));
27
27
 
28
- var _reactIntl = require("react-intl");
29
-
30
28
  var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
31
29
 
32
30
  var _colors = require("@atlaskit/theme/colors");
@@ -43,15 +41,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
43
41
 
44
42
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
45
43
 
46
- // IMO these should live inside @atlaskit/theme
47
- var messages = (0, _reactIntl.defineMessages)({
48
- selected: {
49
- id: 'fabric.editor.selected',
50
- defaultMessage: 'Selected',
51
- description: 'If the item is selected or not.'
52
- }
53
- });
54
-
55
44
  var Color = /*#__PURE__*/function (_PureComponent) {
56
45
  (0, _inherits2.default)(Color, _PureComponent);
57
46
 
@@ -85,19 +74,20 @@ var Color = /*#__PURE__*/function (_PureComponent) {
85
74
  key: "render",
86
75
  value: function render() {
87
76
  var _this$props2 = this.props,
77
+ autoFocus = _this$props2.autoFocus,
88
78
  tabIndex = _this$props2.tabIndex,
89
79
  value = _this$props2.value,
90
80
  label = _this$props2.label,
91
81
  isSelected = _this$props2.isSelected,
92
82
  borderColor = _this$props2.borderColor,
93
83
  _this$props2$checkMar = _this$props2.checkMarkColor,
94
- checkMarkColor = _this$props2$checkMar === void 0 ? _colors.N0 : _this$props2$checkMar,
95
- formatMessage = _this$props2.intl.formatMessage;
96
- var ariaLabelText = isSelected ? "".concat(label, " ").concat(formatMessage(messages.selected)) : label;
84
+ checkMarkColor = _this$props2$checkMar === void 0 ? _colors.N0 : _this$props2$checkMar;
97
85
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
98
86
  content: label
99
87
  }, /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
100
- "aria-label": ariaLabelText,
88
+ "aria-label": label,
89
+ role: "radio",
90
+ "aria-checked": isSelected,
101
91
  onClick: this.onClick,
102
92
  onMouseDown: this.onMouseDown,
103
93
  tabIndex: tabIndex,
@@ -105,7 +95,8 @@ var Color = /*#__PURE__*/function (_PureComponent) {
105
95
  style: {
106
96
  backgroundColor: value || 'transparent',
107
97
  border: "1px solid ".concat(borderColor)
108
- }
98
+ },
99
+ autoFocus: autoFocus
109
100
  }, isSelected && /*#__PURE__*/_react.default.createElement(_done.default, {
110
101
  primaryColor: checkMarkColor,
111
102
  label: ""
@@ -115,6 +106,5 @@ var Color = /*#__PURE__*/function (_PureComponent) {
115
106
  return Color;
116
107
  }(_react.PureComponent);
117
108
 
118
- var _default = (0, _reactIntl.injectIntl)(Color);
119
-
109
+ var _default = Color;
120
110
  exports.default = _default;
@@ -40,6 +40,7 @@ var ColorPalette = function ColorPalette(props) {
40
40
  onClick = props.onClick,
41
41
  selectedColor = props.selectedColor,
42
42
  className = props.className,
43
+ isShowingMoreColors = props.isShowingMoreColors,
43
44
  formatMessage = props.intl.formatMessage;
44
45
 
45
46
  var colorsPerRow = _react.default.useMemo(function () {
@@ -52,11 +53,12 @@ var ColorPalette = function ColorPalette(props) {
52
53
  }, []);
53
54
  }, [palette, cols]);
54
55
 
55
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, colorsPerRow.map(function (row) {
56
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, colorsPerRow.map(function (row, rowIdx) {
56
57
  return /*#__PURE__*/_react.default.createElement(_styles.ColorPaletteWrapper, {
57
58
  className: className,
58
- key: "row-first-color-".concat(row[0].value)
59
- }, row.map(function (_ref) {
59
+ key: "row-first-color-".concat(row[0].value),
60
+ role: "radiogroup"
61
+ }, row.map(function (_ref, colorIdx) {
60
62
  var value = _ref.value,
61
63
  label = _ref.label,
62
64
  border = _ref.border,
@@ -68,7 +70,8 @@ var ColorPalette = function ColorPalette(props) {
68
70
  label: message ? formatMessage(message) : label,
69
71
  onClick: onClick,
70
72
  isSelected: value === selectedColor,
71
- checkMarkColor: getContrastColor(value, [_colors.N0, _colors.N500])
73
+ checkMarkColor: getContrastColor(value, [_colors.N0, _colors.N500]),
74
+ autoFocus: isShowingMoreColors && rowIdx === 1 && colorIdx === 0
72
75
  });
73
76
  }));
74
77
  }));