@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
@@ -1,13 +1,7 @@
1
1
  import React from 'react';
2
2
  import { createPlugin } from './plugin';
3
- import { findReplacePluginKey } from './types';
4
3
  import keymapPlugin from './keymap';
5
- import WithPluginState from '../../ui/WithPluginState';
6
- import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
7
- import { blur, toggleMatchCase } from './commands';
8
- import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
9
- import { TRIGGER_METHOD } from '../analytics';
10
- import { getFeatureFlags } from '../feature-flags-context';
4
+ import FindReplaceToolbarButtonWithState from './FindReplaceToolbarButtonWithState';
11
5
  export var findReplacePlugin = function findReplacePlugin(props) {
12
6
  return {
13
7
  name: 'findReplace',
@@ -34,131 +28,20 @@ export var findReplacePlugin = function findReplacePlugin(props) {
34
28
  containerElement = _ref2.containerElement,
35
29
  dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
36
30
 
37
- // we need the editor to be in focus for scrollIntoView() to work
38
- // so we focus it while we run the command, then put focus back into
39
- // whatever element was previously focused in find replace component
40
- var runWithEditorFocused = function runWithEditorFocused(fn) {
41
- var activeElement = document.activeElement;
42
- editorView.focus();
43
- fn();
44
- activeElement === null || activeElement === void 0 ? void 0 : activeElement.focus();
45
- };
46
-
47
- var dispatchCommand = function dispatchCommand(cmd) {
48
- var state = editorView.state,
49
- dispatch = editorView.dispatch;
50
- cmd(state, dispatch);
51
- };
52
-
53
- var handleActivate = function handleActivate() {
54
- runWithEditorFocused(function () {
55
- return dispatchCommand(activateWithAnalytics({
56
- triggerMethod: TRIGGER_METHOD.TOOLBAR
57
- }));
58
- });
59
- };
60
-
61
- var handleFind = function handleFind(keyword) {
62
- runWithEditorFocused(function () {
63
- return dispatchCommand(findWithAnalytics({
64
- editorView: editorView,
65
- containerElement: containerElement,
66
- keyword: keyword
67
- }));
68
- });
69
- };
70
-
71
- var handleFindNext = function handleFindNext(_ref3) {
72
- var triggerMethod = _ref3.triggerMethod;
73
- runWithEditorFocused(function () {
74
- return dispatchCommand(findNextWithAnalytics({
75
- triggerMethod: triggerMethod
76
- }));
77
- });
78
- };
79
-
80
- var handleFindPrev = function handleFindPrev(_ref4) {
81
- var triggerMethod = _ref4.triggerMethod;
82
- runWithEditorFocused(function () {
83
- return dispatchCommand(findPrevWithAnalytics({
84
- triggerMethod: triggerMethod
85
- }));
86
- });
87
- };
88
-
89
- var handleReplace = function handleReplace(_ref5) {
90
- var triggerMethod = _ref5.triggerMethod,
91
- replaceText = _ref5.replaceText;
92
- runWithEditorFocused(function () {
93
- return dispatchCommand(replaceWithAnalytics({
94
- triggerMethod: triggerMethod,
95
- replaceText: replaceText
96
- }));
97
- });
98
- };
99
-
100
- var handleReplaceAll = function handleReplaceAll(_ref6) {
101
- var replaceText = _ref6.replaceText;
102
- runWithEditorFocused(function () {
103
- return dispatchCommand(replaceAllWithAnalytics({
104
- replaceText: replaceText
105
- }));
31
+ if (props.twoLineEditorToolbar) {
32
+ return null;
33
+ } else {
34
+ return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
35
+ popupsBoundariesElement: popupsBoundariesElement,
36
+ popupsMountPoint: popupsMountPoint,
37
+ popupsScrollableElement: popupsScrollableElement,
38
+ isToolbarReducedSpacing: isToolbarReducedSpacing,
39
+ editorView: editorView,
40
+ containerElement: containerElement,
41
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
42
+ takeFullWidth: props.takeFullWidth
106
43
  });
107
- };
108
-
109
- var handleFindBlur = function handleFindBlur() {
110
- dispatchCommand(blur());
111
- };
112
-
113
- var handleCancel = function handleCancel(_ref7) {
114
- var triggerMethod = _ref7.triggerMethod;
115
- dispatchCommand(cancelSearchWithAnalytics({
116
- triggerMethod: triggerMethod
117
- }));
118
- editorView.focus();
119
- };
120
-
121
- var handleToggleMatchCase = function handleToggleMatchCase() {
122
- dispatchCommand(toggleMatchCase());
123
- };
124
-
125
- var _getFeatureFlags = getFeatureFlags(editorView.state),
126
- findReplaceMatchCase = _getFeatureFlags.findReplaceMatchCase;
127
-
128
- return /*#__PURE__*/React.createElement(WithPluginState, {
129
- debounce: false,
130
- plugins: {
131
- findReplaceState: findReplacePluginKey
132
- },
133
- render: function render(_ref8) {
134
- var findReplaceState = _ref8.findReplaceState;
135
- return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
136
- allowMatchCase: findReplaceMatchCase,
137
- shouldMatchCase: findReplaceState.shouldMatchCase,
138
- onToggleMatchCase: handleToggleMatchCase,
139
- isActive: findReplaceState.isActive,
140
- findText: findReplaceState.findText,
141
- index: findReplaceState.index,
142
- numMatches: findReplaceState.matches.length,
143
- replaceText: findReplaceState.replaceText,
144
- shouldFocus: findReplaceState.shouldFocus,
145
- popupsBoundariesElement: popupsBoundariesElement,
146
- popupsMountPoint: popupsMountPoint,
147
- popupsScrollableElement: popupsScrollableElement,
148
- isReducedSpacing: isToolbarReducedSpacing,
149
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
150
- onFindBlur: handleFindBlur,
151
- onCancel: handleCancel,
152
- onActivate: handleActivate,
153
- onFind: handleFind,
154
- onFindNext: handleFindNext,
155
- onFindPrev: handleFindPrev,
156
- onReplace: handleReplace,
157
- onReplaceAll: handleReplaceAll,
158
- takeFullWidth: props.takeFullWidth
159
- });
160
- }
161
- });
44
+ }
162
45
  }
163
46
  };
164
47
  };
@@ -10,14 +10,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  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; } }
12
12
 
13
+ /** @jsx jsx */
13
14
  import React from 'react';
15
+ import { jsx } from '@emotion/core';
14
16
  import { defineMessages, injectIntl } from 'react-intl';
15
17
  import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
16
18
  import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
17
19
  import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
18
20
  import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
19
21
  import Textfield from '@atlaskit/textfield';
20
- import { SectionWrapper, Count } from './styles';
22
+ import { countStyles, sectionWrapperStyles } from './styles';
21
23
  import { TRIGGER_METHOD } from '../../analytics/types';
22
24
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
23
25
  var messages = defineMessages({
@@ -170,16 +172,16 @@ var Find = /*#__PURE__*/function (_React$Component) {
170
172
  _this.findNext = formatMessage(messages.findNext);
171
173
  _this.findPrevious = formatMessage(messages.findPrevious);
172
174
  _this.matchCase = formatMessage(messages.matchCase);
173
- _this.matchCaseIcon = /*#__PURE__*/React.createElement(MatchCaseIcon, {
175
+ _this.matchCaseIcon = jsx(MatchCaseIcon, {
174
176
  label: _this.matchCase
175
177
  });
176
- _this.findNextIcon = /*#__PURE__*/React.createElement(ChevronDownIcon, {
178
+ _this.findNextIcon = jsx(ChevronDownIcon, {
177
179
  label: _this.findNext
178
180
  });
179
- _this.findPrevIcon = /*#__PURE__*/React.createElement(ChevronUpIcon, {
181
+ _this.findPrevIcon = jsx(ChevronUpIcon, {
180
182
  label: _this.findPrevious
181
183
  });
182
- _this.closeIcon = /*#__PURE__*/React.createElement(EditorCloseIcon, {
184
+ _this.closeIcon = jsx(EditorCloseIcon, {
183
185
  label: _this.closeFindReplaceDialog
184
186
  }); // We locally manage the value of the input inside this component in order to support compositions.
185
187
  // This requires some additional work inside componentDidUpdate to ensure we support changes that
@@ -225,7 +227,9 @@ var Find = /*#__PURE__*/function (_React$Component) {
225
227
  selectedMatchPosition: count.index + 1,
226
228
  totalResultsCount: count.total
227
229
  });
228
- return /*#__PURE__*/React.createElement(SectionWrapper, null, /*#__PURE__*/React.createElement(Textfield, {
230
+ return jsx("div", {
231
+ css: sectionWrapperStyles
232
+ }, jsx(Textfield, {
229
233
  name: "find",
230
234
  appearance: "none",
231
235
  placeholder: this.find,
@@ -237,24 +241,27 @@ var Find = /*#__PURE__*/function (_React$Component) {
237
241
  onBlur: this.props.onFindBlur,
238
242
  onCompositionStart: this.handleCompositionStart,
239
243
  onCompositionEnd: this.handleCompositionEnd
240
- }), findText && /*#__PURE__*/React.createElement(Count, null, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
244
+ }), findText && jsx("span", {
245
+ "data-testid": "textfield-count",
246
+ css: countStyles
247
+ }, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && jsx(FindReplaceTooltipButton, {
241
248
  title: this.matchCase,
242
249
  icon: this.matchCaseIcon,
243
250
  onClick: this.handleMatchCaseClick,
244
251
  isPressed: shouldMatchCase
245
- }), /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
252
+ }), jsx(FindReplaceTooltipButton, {
246
253
  title: this.findNext,
247
254
  icon: this.findNextIcon,
248
255
  keymapDescription: 'Enter',
249
256
  onClick: this.handleFindNextClick,
250
257
  disabled: count.total <= 1
251
- }), /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
258
+ }), jsx(FindReplaceTooltipButton, {
252
259
  title: this.findPrevious,
253
260
  icon: this.findPrevIcon,
254
261
  keymapDescription: 'Shift Enter',
255
262
  onClick: this.handleFindPrevClick,
256
263
  disabled: count.total <= 1
257
- }), /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
264
+ }), jsx(FindReplaceTooltipButton, {
258
265
  title: this.closeFindReplaceDialog,
259
266
  icon: this.closeIcon,
260
267
  keymapDescription: 'Escape',
@@ -10,10 +10,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  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; } }
12
12
 
13
+ /** @jsx jsx */
13
14
  import React from 'react';
15
+ import { jsx } from '@emotion/core';
14
16
  import Find from './Find';
15
17
  import Replace from './Replace';
16
- import { Rule, Wrapper } from './styles';
18
+ import { ruleStyles, wrapperStyles } from './styles';
17
19
 
18
20
  var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
19
21
  _inherits(FindReplace, _React$PureComponent);
@@ -77,7 +79,9 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
77
79
  allowMatchCase = _this$props.allowMatchCase,
78
80
  shouldMatchCase = _this$props.shouldMatchCase,
79
81
  onToggleMatchCase = _this$props.onToggleMatchCase;
80
- return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Find, {
82
+ return jsx("div", {
83
+ css: wrapperStyles
84
+ }, jsx(Find, {
81
85
  allowMatchCase: allowMatchCase,
82
86
  shouldMatchCase: shouldMatchCase,
83
87
  onToggleMatchCase: onToggleMatchCase,
@@ -91,7 +95,10 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
91
95
  onFindTextfieldRefSet: this.setFindTextfieldRef,
92
96
  onCancel: onCancel,
93
97
  onArrowDown: this.setFocusToReplace
94
- }), /*#__PURE__*/React.createElement(Rule, null), /*#__PURE__*/React.createElement(Replace, {
98
+ }), jsx("hr", {
99
+ css: ruleStyles,
100
+ id: "replace-hr-element"
101
+ }), jsx(Replace, {
95
102
  canReplace: count.total > 0,
96
103
  replaceText: replaceText,
97
104
  onReplace: onReplace,
@@ -10,10 +10,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  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; } }
12
12
 
13
+ /** @jsx jsx */
13
14
  import React from 'react';
15
+ import { jsx } from '@emotion/core';
16
+ import Button from '@atlaskit/button/standard-button';
14
17
  import { defineMessages, injectIntl } from 'react-intl';
15
18
  import Textfield from '@atlaskit/textfield';
16
- import { SectionWrapper, ReplaceSectionButton } from './styles';
19
+ import { sectionWrapperStyles, replaceSectionButtonStyles } from './styles';
17
20
  import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '../../analytics/types';
18
21
  var messages = defineMessages({
19
22
  replaceWith: {
@@ -158,7 +161,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
158
161
  value: function render() {
159
162
  var replaceText = this.state.replaceText;
160
163
  var canReplace = this.props.canReplace;
161
- return /*#__PURE__*/React.createElement(SectionWrapper, null, /*#__PURE__*/React.createElement(Textfield, {
164
+ return jsx("div", {
165
+ css: sectionWrapperStyles
166
+ }, jsx(Textfield, {
162
167
  name: "replace",
163
168
  appearance: "none",
164
169
  placeholder: this.replaceWith,
@@ -169,11 +174,13 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
169
174
  onKeyDown: this.handleReplaceKeyDown,
170
175
  onCompositionStart: this.handleCompositionStart,
171
176
  onCompositionEnd: this.handleCompositionEnd
172
- }), /*#__PURE__*/React.createElement(ReplaceSectionButton, {
177
+ }), jsx(Button, {
178
+ css: replaceSectionButtonStyles,
173
179
  testId: this.replace,
174
180
  onClick: this.handleReplaceClick,
175
181
  isDisabled: !canReplace
176
- }, this.replace), /*#__PURE__*/React.createElement(ReplaceSectionButton, {
182
+ }, this.replace), jsx(Button, {
183
+ css: replaceSectionButtonStyles,
177
184
  testId: this.replaceAll,
178
185
  onClick: this.handleReplaceAllClick,
179
186
  isDisabled: !canReplace
@@ -1,19 +1,40 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
4
-
5
- import React from 'react';
6
- import styled from 'styled-components';
1
+ /** @jsx jsx */
2
+ import { css } from '@emotion/core';
7
3
  import { N60, N30A } from '@atlaskit/theme/colors';
8
- import Button from '@atlaskit/button/standard-button';
9
- import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles'; // This is a workaround because React.memo does not play well with styled-components
10
-
11
- function StyledComponentsButton(props) {
12
- return /*#__PURE__*/React.createElement(Button, props);
13
- }
14
-
15
- export var ReplaceSectionButton = styled(StyledComponentsButton)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* increase specificity to override default Button styles */\n && {\n margin-left: 4px;\n }\n"])));
16
- export var Rule = styled.hr(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n border: none;\n background-color: ", ";\n margin: 4px 0px;\n height: 1px;\n border-radius: 1px;\n"])), N30A);
17
- export var Wrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n > *:not(", ") {\n margin: 0px 4px;\n }\n"])), Rule);
18
- export var SectionWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > * {\n flex: 0 0 auto;\n display: inline-flex;\n height: 32px;\n }\n"])));
19
- export var Count = styled.span(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n flex: 0 0 auto;\n justify-content: center;\n align-items: center;\n margin-left: 4px;\n margin-right: 8px;\n"])), N60, relativeFontSizeToBase16(12));
4
+ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
5
+ export var replaceSectionButtonStyles = css({
6
+ marginLeft: '4px'
7
+ });
8
+ export var ruleStyles = css({
9
+ width: '100%',
10
+ border: 'none',
11
+ backgroundColor: "".concat(N30A),
12
+ margin: '4px 0px',
13
+ height: '1px',
14
+ borderRadius: '1px'
15
+ });
16
+ export var wrapperStyles = css({
17
+ display: 'flex',
18
+ flexDirection: 'column',
19
+ '> *:not(#replace-hr-element)': {
20
+ margin: '0px 4px'
21
+ }
22
+ });
23
+ export var sectionWrapperStyles = css({
24
+ display: 'flex',
25
+ alignItems: 'column',
26
+ '> *': {
27
+ display: 'inline-flex',
28
+ height: '32px',
29
+ flex: '0 0 auto'
30
+ }
31
+ });
32
+ export var countStyles = css({
33
+ color: "".concat(N60),
34
+ fontSize: "".concat(relativeFontSizeToBase16(12)),
35
+ flex: '0 0 auto',
36
+ justifyContent: 'center',
37
+ alignItems: 'center',
38
+ marginLeft: '4px',
39
+ marginRight: '8px'
40
+ });
@@ -16,7 +16,8 @@ import React from 'react';
16
16
  import { Component } from 'react';
17
17
  import styled, { ThemeProvider } from 'styled-components';
18
18
  import { gridSize } from '@atlaskit/theme/constants';
19
- import { B400 } from '@atlaskit/theme/colors';
19
+ import { B400 } from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
20
+
20
21
  import Item, { itemThemeNamespace } from '@atlaskit/item';
21
22
  import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
22
23
  import Tooltip from '@atlaskit/tooltip';
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
3
 
4
- var _templateObject;
4
+ var _templateObject, _templateObject2;
5
5
 
6
6
  import React from 'react';
7
7
  import styled from 'styled-components';
@@ -11,7 +11,11 @@ import { EmojiPicker } from '@atlaskit/emoji';
11
11
  import Tooltip from '@atlaskit/tooltip';
12
12
  import EditorEmojiAddIcon from './EditorEmojiAddIcon'; // helps adjusts position of popup
13
13
 
14
- var EmojiPickerButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
14
+ var EmojiPickerButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"]))); // helps to vertically align emoji picker
15
+ // both top and bottom margin should be 2px
16
+ // https://product-fabric.atlassian.net/browse/CETI-148
17
+
18
+ var EmojiPickerWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: -12px;\n margin-top: -4px;\n"])));
15
19
  export var EmojiPickerButton = function EmojiPickerButton(props) {
16
20
  var buttonRef = React.useRef(null);
17
21
 
@@ -28,6 +32,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
28
32
 
29
33
  var updateEmoji = function updateEmoji(emoji) {
30
34
  setIsPopupOpen(false);
35
+ props.editorView && props.editorView.focus();
31
36
  props.onChange && props.onChange(emoji);
32
37
  };
33
38
 
@@ -55,11 +60,11 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
55
60
  fitHeight: 350,
56
61
  fitWidth: 350,
57
62
  offset: [0, 10]
58
- }, /*#__PURE__*/React.createElement(WithProviders, {
63
+ }, /*#__PURE__*/React.createElement(EmojiPickerWrapper, null, /*#__PURE__*/React.createElement(WithProviders, {
59
64
  providers: ['emojiProvider'],
60
65
  providerFactory: props.providerFactory,
61
66
  renderNode: renderPicker
62
- }));
67
+ })));
63
68
  };
64
69
 
65
70
  var title = props.title || '';
@@ -267,7 +267,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
267
267
  if (item.selectType === 'emoji') {
268
268
  return /*#__PURE__*/React.createElement(EmojiPickerButton, {
269
269
  key: idx,
270
- view: editorView,
270
+ editorView: editorView,
271
271
  title: item.title,
272
272
  providerFactory: providerFactory,
273
273
  isSelected: item.selected,
@@ -0,0 +1,22 @@
1
+ import { fragment } from '@atlaskit/adf-schema';
2
+ import { Plugin } from 'prosemirror-state';
3
+ import { pluginKey } from './plugin-key';
4
+ export function createPlugin() {
5
+ return new Plugin({
6
+ key: pluginKey
7
+ });
8
+ }
9
+
10
+ var fragmentMarkPlugin = function fragmentMarkPlugin() {
11
+ return {
12
+ name: 'fragmentPlugin',
13
+ marks: function marks() {
14
+ return [{
15
+ name: 'fragment',
16
+ mark: fragment
17
+ }];
18
+ }
19
+ };
20
+ };
21
+
22
+ export default fragmentMarkPlugin;
@@ -0,0 +1,2 @@
1
+ import { PluginKey } from 'prosemirror-state';
2
+ export var pluginKey = new PluginKey('fragmentMarkPlugin');
@@ -22,7 +22,7 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
22
22
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
23
23
  import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
24
24
  import LinkIcon from '@atlaskit/icon/glyph/link';
25
- import { N80, N30 } from '@atlaskit/theme/colors';
25
+ import { N90, N80, N30 } from '@atlaskit/theme/colors';
26
26
  import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
27
27
  import Tooltip from '@atlaskit/tooltip';
28
28
  import { PureComponent } from 'react';
@@ -42,7 +42,7 @@ import { hideLinkToolbar } from '../../commands';
42
42
  import { hideLinkToolbar as cardHideLinkToolbar } from '../../../card/pm-plugins/actions';
43
43
  import { ScreenReaderText } from '../../styles';
44
44
  export var RECENT_SEARCH_LIST_SIZE = 5;
45
- var ClearText = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n padding-right: 8px;\n color: ", ";\n"])), N80);
45
+ var ClearText = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n padding-right: 8px;\n color: ", ";\n"])), N90);
46
46
  var TextInputWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), InputWrapper, N30, N30);
47
47
  var IconWrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n padding: 4px 8px;\n width: 18px;\n"])), N80);
48
48
  export var messages = defineMessages({
@@ -42,6 +42,7 @@ export { default as breakoutPlugin } from './breakout';
42
42
  export { default as alignmentPlugin } from './alignment';
43
43
  export { default as dataConsumerMarkPlugin } from './data-consumer';
44
44
  export { default as editorDisabledPlugin } from './editor-disabled';
45
+ export { default as fragmentMarkPlugin } from './fragment';
45
46
  export { default as indentationPlugin } from './indentation';
46
47
  export { default as annotationPlugin } from './annotation';
47
48
  export { default as analyticsPlugin } from './analytics';
@@ -61,4 +62,5 @@ export { default as clipboardPlugin } from './clipboard';
61
62
  export { default as undoRedoPlugin } from './undo-redo';
62
63
  export { default as avatarGroupPlugin } from './avatar-group';
63
64
  export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
65
+ export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
64
66
  export { default as codeBidiWarningPlugin } from './code-bidi-warning';
@@ -4,6 +4,7 @@ import { findWrapping } from 'prosemirror-transform';
4
4
  import { findParentNodeClosestToPos } from 'prosemirror-utils';
5
5
  import { isListNode, joinSiblingLists } from '../utils/node';
6
6
  import { isEmptyParagraph } from '../../../utils';
7
+ import { findFirstParentListNode } from '../utils/find';
7
8
  export function convertListType(_ref) {
8
9
  var tr = _ref.tr,
9
10
  nextListNodeType = _ref.nextListNodeType;
@@ -29,84 +30,50 @@ export function convertListType(_ref) {
29
30
  var parentNode = nodeRangeAroundList.parent;
30
31
  var startIndex = nodeRangeAroundList.startIndex,
31
32
  endIndex = nodeRangeAroundList.endIndex,
32
- depth = nodeRangeAroundList.depth;
33
- var before = {
34
- from: !isListNode(parentNode.child(startIndex)) ? // @ts-ignore
35
- doc.resolve(nodeRangeAroundList.$from.posAtIndex(startIndex, depth) + 1) : null,
36
- to: null
37
- };
38
- var after = {
39
- from: null,
40
- to: !isListNode(parentNode.child(endIndex - 1)) ? doc.resolve( // @ts-ignore
41
- nodeRangeAroundList.$from.posAtIndex(endIndex - 1, depth) + 1) : null
42
- };
43
- var isListNodeFound = false;
44
- var firstEmptyParagraphAfterListFound = false;
45
-
46
- for (var i = startIndex; i < endIndex; i++) {
47
- // @ts-ignore posAtIndex is a public API but has no type yet
48
- var position = nodeRangeAroundList.$from.posAtIndex(i, depth);
49
- var resolvedPosition = doc.resolve(position);
50
-
51
- if (isEmptyParagraph(parentNode.child(i)) && !isListNodeFound) {
52
- before.from = doc.resolve( // @ts-ignore posAtIndex is a public API but has no type yet
53
- nodeRangeAroundList.$from.posAtIndex(i, depth) + 2);
54
- }
55
-
56
- if (isEmptyParagraph(parentNode.child(i)) && isListNodeFound && !firstEmptyParagraphAfterListFound) {
57
- after.to = resolvedPosition;
58
- firstEmptyParagraphAfterListFound = true;
59
- }
60
-
61
- if (!isListNode(parentNode.child(i)) && !isListNodeFound) {
62
- before.to = doc.resolve(resolvedPosition.pos + 1);
63
- } else if (!isListNodeFound) {
64
- isListNodeFound = true;
65
- var endNodePosition = doc.resolve(resolvedPosition.pos + 1).end() + 1;
66
-
67
- if (doc.resolve(endNodePosition).nodeAfter) {
68
- after.from = doc.resolve(endNodePosition + 1);
33
+ depth = nodeRangeAroundList.depth; // Checking for invalid nodes to prevent conversion
34
+ // eg. a panel cannot be wrapped in a list so return
35
+ // It will skip this check if the selection begins within a list
36
+ // This is to match the behaviour of the toolbar buttons being disabled
37
+
38
+ if (!findFirstParentListNode($from)) {
39
+ for (var i = startIndex; i < endIndex; i++) {
40
+ var position = nodeRangeAroundList.$from.posAtIndex(i, depth);
41
+ var resolvedPosition = doc.resolve(position);
42
+ var currentChild = parentNode.child(i);
43
+ var currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
44
+
45
+ if (currentNodeRange && !isListNode(currentChild) && !findWrapping(currentNodeRange, nextListNodeType)) {
46
+ return;
69
47
  }
70
48
  }
71
- }
72
-
73
- var beforeConversionArgs, beforeRange, afterConversionArgs, afterRange;
74
-
75
- if (after.from && after.to) {
76
- var mappedFrom = tr.mapping.map(after.from.pos);
77
- var mappedTo = tr.mapping.map(after.to.pos);
78
- afterRange = new NodeRange(tr.doc.resolve(mappedFrom), tr.doc.resolve(mappedTo), nodeRangeAroundList.depth);
79
- afterConversionArgs = {
80
- tr: tr,
81
- nextListNodeType: nextListNodeType,
82
- nodeRange: afterRange
83
- };
84
- }
49
+ } // Checking for any non list nodes and wrapping them in a list
50
+ // so they can be converted
85
51
 
86
- if (before.from && before.to) {
87
- var _mappedFrom = tr.mapping.map(before.from.pos);
88
52
 
89
- var _mappedTo = tr.mapping.map(before.to.pos);
53
+ tr.doc.nodesBetween(nodeRangeAroundList.start, nodeRangeAroundList.end, function (node, pos) {
54
+ // Skip over any nodes that are part of a list
55
+ if (findFirstParentListNode(tr.doc.resolve(tr.mapping.map(pos)))) {
56
+ return false;
57
+ } // The following applies to suitable nodes that are not within a list
90
58
 
91
- beforeRange = new NodeRange(tr.doc.resolve(_mappedFrom), tr.doc.resolve(_mappedTo), nodeRangeAroundList.depth);
92
- beforeConversionArgs = {
93
- tr: tr,
94
- nextListNodeType: nextListNodeType,
95
- nodeRange: beforeRange
96
- };
97
- }
98
59
 
99
- if (!afterRange && !beforeRange || afterRange && !findWrapping(afterRange, nextListNodeType) || beforeRange && !findWrapping(beforeRange, nextListNodeType)) {
100
- return;
101
- }
60
+ var currentNodeNotWrappedInList = node;
61
+ var isNotAnEmptyParagraphAndIsParagraphOrLeafNode = !isEmptyParagraph(currentNodeNotWrappedInList) && (!node.type.isBlock || node.type.name === 'paragraph');
102
62
 
103
- if (afterConversionArgs) {
104
- convertAroundList(afterConversionArgs);
105
- }
106
-
107
- if (beforeConversionArgs) {
108
- convertAroundList(beforeConversionArgs);
109
- }
63
+ if (isNotAnEmptyParagraphAndIsParagraphOrLeafNode) {
64
+ var remainingNodeRange = new NodeRange(tr.doc.resolve(tr.mapping.map(pos)), tr.doc.resolve(tr.mapping.map(pos) + currentNodeNotWrappedInList.nodeSize), nodeRangeAroundList.depth);
65
+ convertAroundList({
66
+ tr: tr,
67
+ nextListNodeType: nextListNodeType,
68
+ nodeRange: remainingNodeRange
69
+ });
70
+ return false;
71
+ }
72
+ });
73
+ convertSelectedList({
74
+ tr: tr,
75
+ nextListNodeType: nextListNodeType
76
+ });
110
77
 
111
78
  if (tr.docChanged) {
112
79
  joinSiblingLists({