@atlaskit/editor-core 151.1.2 → 151.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/CHANGELOG.md +22 -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/mediaNodeUpdater.js +3 -3
  41. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
  42. package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
  43. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  44. package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
  45. package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
  46. package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
  47. package/dist/cjs/plugins/media/toolbar/index.js +90 -3
  48. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  49. package/dist/cjs/plugins/media/utils/media-common.js +1 -1
  50. package/dist/cjs/plugins/media/utils/media-files.js +5 -1
  51. package/dist/cjs/plugins/panel/actions.js +2 -2
  52. package/dist/cjs/plugins/panel/index.js +3 -3
  53. package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
  54. package/dist/cjs/plugins/panel/toolbar.js +10 -5
  55. package/dist/cjs/plugins/panel/utils.js +15 -0
  56. package/dist/cjs/plugins/rank.js +3 -2
  57. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
  58. package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
  59. package/dist/cjs/plugins/table/commands/insert.js +1 -0
  60. package/dist/cjs/plugins/table/index.js +3 -2
  61. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
  62. package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
  63. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  64. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  65. package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
  66. package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
  67. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  68. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  69. package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
  70. package/dist/cjs/plugins/table/ui/consts.js +1 -1
  71. package/dist/cjs/plugins/table/ui/messages.js +1 -1
  72. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  73. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  74. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
  75. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  76. package/dist/cjs/plugins/text-formatting/index.js +2 -1
  77. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
  78. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
  79. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
  80. package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
  81. package/dist/cjs/ui/ColorPalette/index.js +7 -4
  82. package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
  83. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
  84. package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
  85. package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
  86. package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
  87. package/dist/cjs/ui/DropdownMenu/index.js +3 -1
  88. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
  89. package/dist/cjs/ui/Resizer/index.js +9 -1
  90. package/dist/cjs/version-wrapper.js +1 -1
  91. package/dist/cjs/version.json +1 -1
  92. package/dist/es2019/create-editor/ReactEditorView.js +19 -8
  93. package/dist/es2019/create-editor/create-plugins-list.js +31 -12
  94. package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
  95. package/dist/es2019/labs/next/presets/default.js +3 -1
  96. package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
  97. package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
  98. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  99. package/dist/es2019/plugins/annotation/utils.js +18 -7
  100. package/dist/es2019/plugins/avatar-group/index.js +2 -1
  101. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
  102. package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
  103. package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  104. package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
  105. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
  106. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
  107. package/dist/es2019/plugins/code-block/index.js +3 -2
  108. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  109. package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
  110. package/dist/es2019/plugins/extension/extension-api.js +9 -2
  111. package/dist/es2019/plugins/extension/ui/styles.js +6 -0
  112. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  113. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
  114. package/dist/es2019/plugins/find-replace/index.js +15 -128
  115. package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
  116. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
  117. package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
  118. package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
  119. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  120. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
  121. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  122. package/dist/es2019/plugins/fragment/index.js +22 -0
  123. package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
  124. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  125. package/dist/es2019/plugins/index.js +2 -0
  126. package/dist/es2019/plugins/list/actions/conversions.js +38 -69
  127. package/dist/es2019/plugins/list/transforms.js +5 -1
  128. package/dist/es2019/plugins/media/index.js +2 -2
  129. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
  130. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
  131. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  132. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
  133. package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
  134. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  135. package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
  136. package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
  137. package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
  138. package/dist/es2019/plugins/media/toolbar/index.js +90 -3
  139. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
  140. package/dist/es2019/plugins/media/utils/media-common.js +1 -1
  141. package/dist/es2019/plugins/media/utils/media-files.js +6 -1
  142. package/dist/es2019/plugins/panel/actions.js +2 -2
  143. package/dist/es2019/plugins/panel/index.js +5 -5
  144. package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
  145. package/dist/es2019/plugins/panel/toolbar.js +10 -5
  146. package/dist/es2019/plugins/panel/utils.js +8 -1
  147. package/dist/es2019/plugins/rank.js +3 -2
  148. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
  149. package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
  150. package/dist/es2019/plugins/table/commands/insert.js +1 -2
  151. package/dist/es2019/plugins/table/index.js +2 -1
  152. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  153. package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
  154. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  155. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  156. package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
  157. package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
  158. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  159. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  160. package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
  161. package/dist/es2019/plugins/table/ui/consts.js +2 -2
  162. package/dist/es2019/plugins/table/ui/messages.js +1 -1
  163. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  164. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  165. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  166. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  167. package/dist/es2019/plugins/text-formatting/index.js +3 -2
  168. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  169. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  170. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
  171. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
  172. package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
  173. package/dist/es2019/ui/ColorPalette/index.js +7 -4
  174. package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
  175. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
  176. package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
  177. package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
  178. package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
  179. package/dist/es2019/ui/Dropdown/index.js +2 -1
  180. package/dist/es2019/ui/DropdownMenu/index.js +7 -3
  181. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  182. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  183. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
  184. package/dist/es2019/ui/Resizer/index.js +9 -1
  185. package/dist/es2019/version-wrapper.js +1 -1
  186. package/dist/es2019/version.json +1 -1
  187. package/dist/esm/create-editor/ReactEditorView.js +22 -8
  188. package/dist/esm/create-editor/create-plugins-list.js +31 -12
  189. package/dist/esm/labs/next/presets/cxhtml.js +1 -2
  190. package/dist/esm/labs/next/presets/default.js +3 -1
  191. package/dist/esm/nodeviews/ReactNodeView.js +2 -2
  192. package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
  193. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  194. package/dist/esm/plugins/annotation/utils.js +18 -7
  195. package/dist/esm/plugins/avatar-group/index.js +2 -1
  196. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  197. package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
  198. package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  199. package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
  200. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  201. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  202. package/dist/esm/plugins/code-block/index.js +3 -3
  203. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  204. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  205. package/dist/esm/plugins/extension/extension-api.js +9 -2
  206. package/dist/esm/plugins/extension/ui/styles.js +1 -1
  207. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  208. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
  209. package/dist/esm/plugins/find-replace/index.js +14 -131
  210. package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
  211. package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
  212. package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
  213. package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
  214. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  215. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
  216. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  217. package/dist/esm/plugins/fragment/index.js +22 -0
  218. package/dist/esm/plugins/fragment/plugin-key.js +2 -0
  219. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  220. package/dist/esm/plugins/index.js +2 -0
  221. package/dist/esm/plugins/list/actions/conversions.js +38 -71
  222. package/dist/esm/plugins/list/transforms.js +7 -1
  223. package/dist/esm/plugins/media/index.js +2 -3
  224. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
  225. package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
  226. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  227. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
  228. package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
  229. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  230. package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
  231. package/dist/esm/plugins/media/toolbar/commands.js +45 -0
  232. package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
  233. package/dist/esm/plugins/media/toolbar/index.js +88 -3
  234. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  235. package/dist/esm/plugins/media/utils/media-common.js +1 -1
  236. package/dist/esm/plugins/media/utils/media-files.js +6 -1
  237. package/dist/esm/plugins/panel/actions.js +2 -2
  238. package/dist/esm/plugins/panel/index.js +5 -5
  239. package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
  240. package/dist/esm/plugins/panel/toolbar.js +9 -4
  241. package/dist/esm/plugins/panel/utils.js +13 -0
  242. package/dist/esm/plugins/rank.js +3 -2
  243. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
  244. package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
  245. package/dist/esm/plugins/table/commands/insert.js +1 -2
  246. package/dist/esm/plugins/table/index.js +3 -2
  247. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  248. package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
  249. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  250. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  251. package/dist/esm/plugins/table/transforms/column-width.js +13 -3
  252. package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
  253. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  254. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  255. package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
  256. package/dist/esm/plugins/table/ui/consts.js +2 -2
  257. package/dist/esm/plugins/table/ui/messages.js +1 -1
  258. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  259. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  260. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  261. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  262. package/dist/esm/plugins/text-formatting/index.js +3 -2
  263. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  264. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  265. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
  266. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
  267. package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
  268. package/dist/esm/ui/ColorPalette/index.js +7 -4
  269. package/dist/esm/ui/ColorPickerButton/index.js +1 -1
  270. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
  271. package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
  272. package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
  273. package/dist/esm/ui/ConfigPanel/utils.js +1 -6
  274. package/dist/esm/ui/Dropdown/index.js +2 -1
  275. package/dist/esm/ui/DropdownMenu/index.js +7 -3
  276. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  277. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  278. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
  279. package/dist/esm/ui/Resizer/index.js +9 -1
  280. package/dist/esm/version-wrapper.js +1 -1
  281. package/dist/esm/version.json +1 -1
  282. package/dist/types/labs/next/full-page.d.ts +1 -1
  283. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
  284. package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
  285. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  286. package/dist/types/plugins/analytics/types/events.d.ts +7 -1
  287. package/dist/types/plugins/annotation/utils.d.ts +1 -1
  288. package/dist/types/plugins/avatar-group/index.d.ts +1 -0
  289. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
  290. package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
  291. package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
  292. package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
  293. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
  294. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
  295. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
  296. package/dist/types/plugins/code-block/index.d.ts +1 -1
  297. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
  298. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
  299. package/dist/types/plugins/code-block/types.d.ts +2 -0
  300. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  301. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
  302. package/dist/types/plugins/find-replace/index.d.ts +1 -0
  303. package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
  304. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
  305. package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
  306. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
  307. package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
  308. package/dist/types/plugins/fragment/index.d.ts +5 -0
  309. package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
  310. package/dist/types/plugins/index.d.ts +2 -0
  311. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
  312. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  313. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
  314. package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
  315. package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
  316. package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
  317. package/dist/types/plugins/media/types.d.ts +0 -1
  318. package/dist/types/plugins/panel/actions.d.ts +1 -1
  319. package/dist/types/plugins/panel/types.d.ts +8 -2
  320. package/dist/types/plugins/quick-insert/index.d.ts +2 -1
  321. package/dist/types/plugins/table/commands/insert.d.ts +3 -0
  322. package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
  323. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
  324. package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
  325. package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
  326. package/dist/types/plugins/table/types.d.ts +8 -0
  327. package/dist/types/plugins/table/ui/consts.d.ts +1 -1
  328. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  329. package/dist/types/types/editor-props.d.ts +11 -1
  330. package/dist/types/types/feature-flags.d.ts +13 -0
  331. package/dist/types/types/index.d.ts +1 -1
  332. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  333. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
  334. package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
  335. package/dist/types/ui/ColorPalette/index.d.ts +1 -0
  336. package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
  337. package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
  338. package/dist/types/ui/Resizer/index.d.ts +1 -0
  339. package/package.json +14 -10
  340. package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
  341. package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  342. package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  343. package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
@@ -6,7 +6,7 @@ import { browser } from '@atlaskit/editor-common';
6
6
  */
7
7
 
8
8
  export function createFeatureFlagsFromProps(props) {
9
- var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
9
+ var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31;
10
10
 
11
11
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
12
12
  return { ...normalizedFeatureFlags,
@@ -19,6 +19,7 @@ export function createFeatureFlagsFromProps(props) {
19
19
  findReplaceMatchCase: typeof props.allowFindReplace === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
20
20
  keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
21
21
  addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
22
+ singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
22
23
  undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
23
24
  catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
24
25
  nextEmojiNodeView: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.nextEmojiNodeView) === true,
@@ -37,6 +38,7 @@ export function createFeatureFlagsFromProps(props) {
37
38
  collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false),
38
39
  ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
39
40
  codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
40
- codeBidiWarnings: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.codeBidiWarnings) : true)
41
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.twoLineEditorToolbar) : false),
42
+ codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true)
41
43
  };
42
44
  }
@@ -0,0 +1,152 @@
1
+ import React from 'react';
2
+ import { findReplacePluginKey } from './types';
3
+ import WithPluginState from '../../ui/WithPluginState';
4
+ import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
5
+ import { blur, toggleMatchCase } from './commands';
6
+ import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
7
+ import { TRIGGER_METHOD } from '../analytics';
8
+ import { getFeatureFlags } from '../feature-flags-context';
9
+
10
+ const FindReplaceToolbarButtonWithState = props => {
11
+ const {
12
+ popupsBoundariesElement,
13
+ popupsMountPoint,
14
+ popupsScrollableElement,
15
+ isToolbarReducedSpacing,
16
+ editorView,
17
+ containerElement,
18
+ dispatchAnalyticsEvent
19
+ } = props;
20
+
21
+ if (!editorView) {
22
+ return null;
23
+ } // we need the editor to be in focus for scrollIntoView() to work
24
+ // so we focus it while we run the command, then put focus back into
25
+ // whatever element was previously focused in find replace component
26
+
27
+
28
+ const runWithEditorFocused = fn => {
29
+ const activeElement = document.activeElement;
30
+ editorView.focus();
31
+ fn();
32
+ activeElement === null || activeElement === void 0 ? void 0 : activeElement.focus();
33
+ };
34
+
35
+ const dispatchCommand = cmd => {
36
+ const {
37
+ state,
38
+ dispatch
39
+ } = editorView;
40
+ cmd(state, dispatch);
41
+ };
42
+
43
+ const handleActivate = () => {
44
+ runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
45
+ triggerMethod: TRIGGER_METHOD.TOOLBAR
46
+ })));
47
+ };
48
+
49
+ const handleFind = keyword => {
50
+ runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
51
+ editorView,
52
+ containerElement,
53
+ keyword
54
+ })));
55
+ };
56
+
57
+ const handleFindNext = ({
58
+ triggerMethod
59
+ }) => {
60
+ runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
61
+ triggerMethod
62
+ })));
63
+ };
64
+
65
+ const handleFindPrev = ({
66
+ triggerMethod
67
+ }) => {
68
+ runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
69
+ triggerMethod
70
+ })));
71
+ };
72
+
73
+ const handleReplace = ({
74
+ triggerMethod,
75
+ replaceText
76
+ }) => {
77
+ runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
78
+ triggerMethod,
79
+ replaceText
80
+ })));
81
+ };
82
+
83
+ const handleReplaceAll = ({
84
+ replaceText
85
+ }) => {
86
+ runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
87
+ replaceText
88
+ })));
89
+ };
90
+
91
+ const handleFindBlur = () => {
92
+ dispatchCommand(blur());
93
+ };
94
+
95
+ const handleCancel = ({
96
+ triggerMethod
97
+ }) => {
98
+ dispatchCommand(cancelSearchWithAnalytics({
99
+ triggerMethod
100
+ }));
101
+ editorView.focus();
102
+ };
103
+
104
+ const handleToggleMatchCase = () => {
105
+ dispatchCommand(toggleMatchCase());
106
+ };
107
+
108
+ const {
109
+ findReplaceMatchCase
110
+ } = getFeatureFlags(editorView.state);
111
+ return /*#__PURE__*/React.createElement(WithPluginState, {
112
+ debounce: false,
113
+ plugins: {
114
+ findReplaceState: findReplacePluginKey
115
+ },
116
+ render: ({
117
+ findReplaceState
118
+ }) => {
119
+ if (!findReplaceState) {
120
+ return null;
121
+ }
122
+
123
+ return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
124
+ allowMatchCase: findReplaceMatchCase,
125
+ shouldMatchCase: findReplaceState.shouldMatchCase,
126
+ onToggleMatchCase: handleToggleMatchCase,
127
+ isActive: findReplaceState.isActive,
128
+ findText: findReplaceState.findText,
129
+ index: findReplaceState.index,
130
+ numMatches: findReplaceState.matches.length,
131
+ replaceText: findReplaceState.replaceText,
132
+ shouldFocus: findReplaceState.shouldFocus,
133
+ popupsBoundariesElement: popupsBoundariesElement,
134
+ popupsMountPoint: popupsMountPoint,
135
+ popupsScrollableElement: popupsScrollableElement,
136
+ isReducedSpacing: !!isToolbarReducedSpacing,
137
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
138
+ onFindBlur: handleFindBlur,
139
+ onCancel: handleCancel,
140
+ onActivate: handleActivate,
141
+ onFind: handleFind,
142
+ onFindNext: handleFindNext,
143
+ onFindPrev: handleFindPrev,
144
+ onReplace: handleReplace,
145
+ onReplaceAll: handleReplaceAll,
146
+ takeFullWidth: !!props.takeFullWidth
147
+ });
148
+ }
149
+ });
150
+ };
151
+
152
+ export default FindReplaceToolbarButtonWithState;
@@ -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 const findReplacePlugin = props => {
12
6
  return {
13
7
  name: 'findReplace',
@@ -33,127 +27,20 @@ export const findReplacePlugin = props => {
33
27
  containerElement,
34
28
  dispatchAnalyticsEvent
35
29
  }) {
36
- // we need the editor to be in focus for scrollIntoView() to work
37
- // so we focus it while we run the command, then put focus back into
38
- // whatever element was previously focused in find replace component
39
- const runWithEditorFocused = fn => {
40
- const activeElement = document.activeElement;
41
- editorView.focus();
42
- fn();
43
- activeElement === null || activeElement === void 0 ? void 0 : activeElement.focus();
44
- };
45
-
46
- const dispatchCommand = cmd => {
47
- const {
48
- state,
49
- dispatch
50
- } = editorView;
51
- cmd(state, dispatch);
52
- };
53
-
54
- const handleActivate = () => {
55
- runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
56
- triggerMethod: TRIGGER_METHOD.TOOLBAR
57
- })));
58
- };
59
-
60
- const handleFind = keyword => {
61
- runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
62
- editorView,
63
- containerElement,
64
- keyword
65
- })));
66
- };
67
-
68
- const handleFindNext = ({
69
- triggerMethod
70
- }) => {
71
- runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
72
- triggerMethod
73
- })));
74
- };
75
-
76
- const handleFindPrev = ({
77
- triggerMethod
78
- }) => {
79
- runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
80
- triggerMethod
81
- })));
82
- };
83
-
84
- const handleReplace = ({
85
- triggerMethod,
86
- replaceText
87
- }) => {
88
- runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
89
- triggerMethod,
90
- replaceText
91
- })));
92
- };
93
-
94
- const handleReplaceAll = ({
95
- replaceText
96
- }) => {
97
- runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
98
- replaceText
99
- })));
100
- };
101
-
102
- const handleFindBlur = () => {
103
- dispatchCommand(blur());
104
- };
105
-
106
- const handleCancel = ({
107
- triggerMethod
108
- }) => {
109
- dispatchCommand(cancelSearchWithAnalytics({
110
- triggerMethod
111
- }));
112
- editorView.focus();
113
- };
114
-
115
- const handleToggleMatchCase = () => {
116
- dispatchCommand(toggleMatchCase());
117
- };
118
-
119
- const {
120
- findReplaceMatchCase
121
- } = getFeatureFlags(editorView.state);
122
- return /*#__PURE__*/React.createElement(WithPluginState, {
123
- debounce: false,
124
- plugins: {
125
- findReplaceState: findReplacePluginKey
126
- },
127
- render: ({
128
- findReplaceState
129
- }) => {
130
- return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
131
- allowMatchCase: findReplaceMatchCase,
132
- shouldMatchCase: findReplaceState.shouldMatchCase,
133
- onToggleMatchCase: handleToggleMatchCase,
134
- isActive: findReplaceState.isActive,
135
- findText: findReplaceState.findText,
136
- index: findReplaceState.index,
137
- numMatches: findReplaceState.matches.length,
138
- replaceText: findReplaceState.replaceText,
139
- shouldFocus: findReplaceState.shouldFocus,
140
- popupsBoundariesElement: popupsBoundariesElement,
141
- popupsMountPoint: popupsMountPoint,
142
- popupsScrollableElement: popupsScrollableElement,
143
- isReducedSpacing: isToolbarReducedSpacing,
144
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
145
- onFindBlur: handleFindBlur,
146
- onCancel: handleCancel,
147
- onActivate: handleActivate,
148
- onFind: handleFind,
149
- onFindNext: handleFindNext,
150
- onFindPrev: handleFindPrev,
151
- onReplace: handleReplace,
152
- onReplaceAll: handleReplaceAll,
153
- takeFullWidth: props.takeFullWidth
154
- });
155
- }
156
- });
30
+ if (props.twoLineEditorToolbar) {
31
+ return null;
32
+ } else {
33
+ return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
34
+ popupsBoundariesElement: popupsBoundariesElement,
35
+ popupsMountPoint: popupsMountPoint,
36
+ popupsScrollableElement: popupsScrollableElement,
37
+ isToolbarReducedSpacing: isToolbarReducedSpacing,
38
+ editorView: editorView,
39
+ containerElement: containerElement,
40
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
41
+ takeFullWidth: props.takeFullWidth
42
+ });
43
+ }
157
44
  }
158
45
 
159
46
  };
@@ -1,12 +1,15 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /** @jsx jsx */
2
4
  import React from 'react';
5
+ import { jsx } from '@emotion/core';
3
6
  import { defineMessages, injectIntl } from 'react-intl';
4
7
  import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
5
8
  import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
6
9
  import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
7
10
  import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
8
11
  import Textfield from '@atlaskit/textfield';
9
- import { SectionWrapper, Count } from './styles';
12
+ import { countStyles, sectionWrapperStyles } from './styles';
10
13
  import { TRIGGER_METHOD } from '../../analytics/types';
11
14
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
12
15
  const messages = defineMessages({
@@ -147,16 +150,16 @@ class Find extends React.Component {
147
150
  this.findNext = formatMessage(messages.findNext);
148
151
  this.findPrevious = formatMessage(messages.findPrevious);
149
152
  this.matchCase = formatMessage(messages.matchCase);
150
- this.matchCaseIcon = /*#__PURE__*/React.createElement(MatchCaseIcon, {
153
+ this.matchCaseIcon = jsx(MatchCaseIcon, {
151
154
  label: this.matchCase
152
155
  });
153
- this.findNextIcon = /*#__PURE__*/React.createElement(ChevronDownIcon, {
156
+ this.findNextIcon = jsx(ChevronDownIcon, {
154
157
  label: this.findNext
155
158
  });
156
- this.findPrevIcon = /*#__PURE__*/React.createElement(ChevronUpIcon, {
159
+ this.findPrevIcon = jsx(ChevronUpIcon, {
157
160
  label: this.findPrevious
158
161
  });
159
- this.closeIcon = /*#__PURE__*/React.createElement(EditorCloseIcon, {
162
+ this.closeIcon = jsx(EditorCloseIcon, {
160
163
  label: this.closeFindReplaceDialog
161
164
  }); // We locally manage the value of the input inside this component in order to support compositions.
162
165
  // This requires some additional work inside componentDidUpdate to ensure we support changes that
@@ -200,7 +203,9 @@ class Find extends React.Component {
200
203
  selectedMatchPosition: count.index + 1,
201
204
  totalResultsCount: count.total
202
205
  });
203
- return /*#__PURE__*/React.createElement(SectionWrapper, null, /*#__PURE__*/React.createElement(Textfield, {
206
+ return jsx("div", {
207
+ css: sectionWrapperStyles
208
+ }, jsx(Textfield, {
204
209
  name: "find",
205
210
  appearance: "none",
206
211
  placeholder: this.find,
@@ -212,24 +217,27 @@ class Find extends React.Component {
212
217
  onBlur: this.props.onFindBlur,
213
218
  onCompositionStart: this.handleCompositionStart,
214
219
  onCompositionEnd: this.handleCompositionEnd
215
- }), findText && /*#__PURE__*/React.createElement(Count, null, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
220
+ }), findText && jsx("span", {
221
+ "data-testid": "textfield-count",
222
+ css: countStyles
223
+ }, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && jsx(FindReplaceTooltipButton, {
216
224
  title: this.matchCase,
217
225
  icon: this.matchCaseIcon,
218
226
  onClick: this.handleMatchCaseClick,
219
227
  isPressed: shouldMatchCase
220
- }), /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
228
+ }), jsx(FindReplaceTooltipButton, {
221
229
  title: this.findNext,
222
230
  icon: this.findNextIcon,
223
231
  keymapDescription: 'Enter',
224
232
  onClick: this.handleFindNextClick,
225
233
  disabled: count.total <= 1
226
- }), /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
234
+ }), jsx(FindReplaceTooltipButton, {
227
235
  title: this.findPrevious,
228
236
  icon: this.findPrevIcon,
229
237
  keymapDescription: 'Shift Enter',
230
238
  onClick: this.handleFindPrevClick,
231
239
  disabled: count.total <= 1
232
- }), /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
240
+ }), jsx(FindReplaceTooltipButton, {
233
241
  title: this.closeFindReplaceDialog,
234
242
  icon: this.closeIcon,
235
243
  keymapDescription: 'Escape',
@@ -1,8 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /** @jsx jsx */
2
4
  import React from 'react';
5
+ import { jsx } from '@emotion/core';
3
6
  import Find from './Find';
4
7
  import Replace from './Replace';
5
- import { Rule, Wrapper } from './styles';
8
+ import { ruleStyles, wrapperStyles } from './styles';
6
9
 
7
10
  class FindReplace extends React.PureComponent {
8
11
  constructor(...args) {
@@ -51,7 +54,9 @@ class FindReplace extends React.PureComponent {
51
54
  shouldMatchCase,
52
55
  onToggleMatchCase
53
56
  } = this.props;
54
- return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Find, {
57
+ return jsx("div", {
58
+ css: wrapperStyles
59
+ }, jsx(Find, {
55
60
  allowMatchCase: allowMatchCase,
56
61
  shouldMatchCase: shouldMatchCase,
57
62
  onToggleMatchCase: onToggleMatchCase,
@@ -65,7 +70,10 @@ class FindReplace extends React.PureComponent {
65
70
  onFindTextfieldRefSet: this.setFindTextfieldRef,
66
71
  onCancel: onCancel,
67
72
  onArrowDown: this.setFocusToReplace
68
- }), /*#__PURE__*/React.createElement(Rule, null), /*#__PURE__*/React.createElement(Replace, {
73
+ }), jsx("hr", {
74
+ css: ruleStyles,
75
+ id: "replace-hr-element"
76
+ }), jsx(Replace, {
69
77
  canReplace: count.total > 0,
70
78
  replaceText: replaceText,
71
79
  onReplace: onReplace,
@@ -1,8 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /** @jsx jsx */
2
4
  import React from 'react';
5
+ import { jsx } from '@emotion/core';
6
+ import Button from '@atlaskit/button/standard-button';
3
7
  import { defineMessages, injectIntl } from 'react-intl';
4
8
  import Textfield from '@atlaskit/textfield';
5
- import { SectionWrapper, ReplaceSectionButton } from './styles';
9
+ import { sectionWrapperStyles, replaceSectionButtonStyles } from './styles';
6
10
  import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '../../analytics/types';
7
11
  const messages = defineMessages({
8
12
  replaceWith: {
@@ -138,7 +142,9 @@ class Replace extends React.PureComponent {
138
142
  const {
139
143
  canReplace
140
144
  } = this.props;
141
- return /*#__PURE__*/React.createElement(SectionWrapper, null, /*#__PURE__*/React.createElement(Textfield, {
145
+ return jsx("div", {
146
+ css: sectionWrapperStyles
147
+ }, jsx(Textfield, {
142
148
  name: "replace",
143
149
  appearance: "none",
144
150
  placeholder: this.replaceWith,
@@ -149,11 +155,13 @@ class Replace extends React.PureComponent {
149
155
  onKeyDown: this.handleReplaceKeyDown,
150
156
  onCompositionStart: this.handleCompositionStart,
151
157
  onCompositionEnd: this.handleCompositionEnd
152
- }), /*#__PURE__*/React.createElement(ReplaceSectionButton, {
158
+ }), jsx(Button, {
159
+ css: replaceSectionButtonStyles,
153
160
  testId: this.replace,
154
161
  onClick: this.handleReplaceClick,
155
162
  isDisabled: !canReplace
156
- }, this.replace), /*#__PURE__*/React.createElement(ReplaceSectionButton, {
163
+ }, this.replace), jsx(Button, {
164
+ css: replaceSectionButtonStyles,
157
165
  testId: this.replaceAll,
158
166
  onClick: this.handleReplaceAllClick,
159
167
  isDisabled: !canReplace
@@ -1,50 +1,40 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
1
+ /** @jsx jsx */
2
+ import { css } from '@emotion/core';
3
3
  import { N60, N30A } from '@atlaskit/theme/colors';
4
- import Button from '@atlaskit/button/standard-button';
5
- import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles'; // This is a workaround because React.memo does not play well with styled-components
6
-
7
- function StyledComponentsButton(props) {
8
- return /*#__PURE__*/React.createElement(Button, props);
9
- }
10
-
11
- export const ReplaceSectionButton = styled(StyledComponentsButton)`
12
- /* increase specificity to override default Button styles */
13
- && {
14
- margin-left: 4px;
4
+ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
5
+ export const replaceSectionButtonStyles = css({
6
+ marginLeft: '4px'
7
+ });
8
+ export const ruleStyles = css({
9
+ width: '100%',
10
+ border: 'none',
11
+ backgroundColor: `${N30A}`,
12
+ margin: '4px 0px',
13
+ height: '1px',
14
+ borderRadius: '1px'
15
+ });
16
+ export const wrapperStyles = css({
17
+ display: 'flex',
18
+ flexDirection: 'column',
19
+ '> *:not(#replace-hr-element)': {
20
+ margin: '0px 4px'
15
21
  }
16
- `;
17
- export const Rule = styled.hr`
18
- width: 100%;
19
- border: none;
20
- background-color: ${N30A};
21
- margin: 4px 0px;
22
- height: 1px;
23
- border-radius: 1px;
24
- `;
25
- export const Wrapper = styled.div`
26
- display: flex;
27
- flex-direction: column;
28
- > *:not(${Rule}) {
29
- margin: 0px 4px;
22
+ });
23
+ export const sectionWrapperStyles = css({
24
+ display: 'flex',
25
+ alignItems: 'column',
26
+ '> *': {
27
+ display: 'inline-flex',
28
+ height: '32px',
29
+ flex: '0 0 auto'
30
30
  }
31
- `;
32
- export const SectionWrapper = styled.div`
33
- display: flex;
34
- align-items: center;
35
-
36
- > * {
37
- flex: 0 0 auto;
38
- display: inline-flex;
39
- height: 32px;
40
- }
41
- `;
42
- export const Count = styled.span`
43
- color: ${N60};
44
- font-size: ${relativeFontSizeToBase16(12)};
45
- flex: 0 0 auto;
46
- justify-content: center;
47
- align-items: center;
48
- margin-left: 4px;
49
- margin-right: 8px;
50
- `;
31
+ });
32
+ export const countStyles = css({
33
+ color: `${N60}`,
34
+ fontSize: `${relativeFontSizeToBase16(12)}`,
35
+ flex: '0 0 auto',
36
+ justifyContent: 'center',
37
+ alignItems: 'center',
38
+ marginLeft: '4px',
39
+ marginRight: '8px'
40
+ });
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import { Component } from 'react';
3
3
  import styled, { ThemeProvider } from 'styled-components';
4
4
  import { gridSize } from '@atlaskit/theme/constants';
5
- import { B400 } from '@atlaskit/theme/colors';
5
+ import { B400 } from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
+
6
7
  import Item, { itemThemeNamespace } from '@atlaskit/item';
7
8
  import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
8
9
  import Tooltip from '@atlaskit/tooltip';
@@ -8,6 +8,13 @@ import EditorEmojiAddIcon from './EditorEmojiAddIcon'; // helps adjusts position
8
8
 
9
9
  const EmojiPickerButtonWrapper = styled.div`
10
10
  position: relative;
11
+ `; // helps to vertically align emoji picker
12
+ // both top and bottom margin should be 2px
13
+ // https://product-fabric.atlassian.net/browse/CETI-148
14
+
15
+ const EmojiPickerWrapper = styled.div`
16
+ margin-bottom: -12px;
17
+ margin-top: -4px;
11
18
  `;
12
19
  export const EmojiPickerButton = props => {
13
20
  const buttonRef = React.useRef(null);
@@ -20,6 +27,7 @@ export const EmojiPickerButton = props => {
20
27
 
21
28
  const updateEmoji = emoji => {
22
29
  setIsPopupOpen(false);
30
+ props.editorView && props.editorView.focus();
23
31
  props.onChange && props.onChange(emoji);
24
32
  };
25
33
 
@@ -47,11 +55,11 @@ export const EmojiPickerButton = props => {
47
55
  fitHeight: 350,
48
56
  fitWidth: 350,
49
57
  offset: [0, 10]
50
- }, /*#__PURE__*/React.createElement(WithProviders, {
58
+ }, /*#__PURE__*/React.createElement(EmojiPickerWrapper, null, /*#__PURE__*/React.createElement(WithProviders, {
51
59
  providers: ['emojiProvider'],
52
60
  providerFactory: props.providerFactory,
53
61
  renderNode: renderPicker
54
- }));
62
+ })));
55
63
  };
56
64
 
57
65
  const title = props.title || '';
@@ -224,7 +224,7 @@ export default class Toolbar extends Component {
224
224
  if (item.selectType === 'emoji') {
225
225
  return /*#__PURE__*/React.createElement(EmojiPickerButton, {
226
226
  key: idx,
227
- view: editorView,
227
+ editorView: editorView,
228
228
  title: item.title,
229
229
  providerFactory: providerFactory,
230
230
  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
+ const fragmentMarkPlugin = () => ({
11
+ name: 'fragmentPlugin',
12
+
13
+ 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 const pluginKey = new PluginKey('fragmentMarkPlugin');