@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
@@ -1,7 +1,9 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React, { PureComponent } from 'react';
3
- import styled from 'styled-components';
4
- import DropList from '@atlaskit/droplist';
3
+ import styled from 'styled-components'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
4
+
5
+ import DropList from '@atlaskit/droplist'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
+
5
7
  import Item, { ItemGroup } from '@atlaskit/item';
6
8
  import Tooltip from '@atlaskit/tooltip';
7
9
  import { Popup } from '@atlaskit/editor-common';
@@ -84,6 +86,7 @@ export default class DropdownMenuWrapper extends PureComponent {
84
86
  key: item.key || item.content,
85
87
  isSelected: item.isActive
86
88
  }, /*#__PURE__*/React.createElement(Item, {
89
+ role: "menuitem",
87
90
  elemBefore: item.elemBefore,
88
91
  elemAfter: item.elemAfter,
89
92
  isDisabled: item.isDisabled,
@@ -154,7 +157,8 @@ export default class DropdownMenuWrapper extends PureComponent {
154
157
  minWidth: fitWidth || 0
155
158
  }
156
159
  }), items.map((group, index) => /*#__PURE__*/React.createElement(ItemGroup, {
157
- key: index
160
+ key: index,
161
+ role: "menu"
158
162
  }, group.items.map(item => this.renderItem(item))))));
159
163
  }
160
164
 
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useCallback } from 'react';
2
2
  import styled, { ThemeProvider } from 'styled-components';
3
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
3
4
  import Item, { itemThemeNamespace } from '@atlaskit/item'; // AFP-2532 TODO: Fix automatic suppressions below
4
5
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
6
 
@@ -4,6 +4,7 @@ import memoizeOne from 'memoize-one';
4
4
  import styled, { ThemeProvider, css } from 'styled-components';
5
5
  import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
6
6
  import { Collection } from 'react-virtualized/dist/commonjs/Collection';
7
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
7
8
  import Item from '@atlaskit/item';
8
9
  import { B100, N20, N200 } from '@atlaskit/theme/colors';
9
10
  import Tooltip from '@atlaskit/tooltip';
@@ -4,7 +4,7 @@ import styled from 'styled-components'; // AFP-2532 TODO: Fix automatic suppress
4
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
5
 
6
6
  import { fontSizeSmall } from '@atlaskit/theme';
7
- import { N20, N800, N100 } from '@atlaskit/theme/colors';
7
+ import { N20, N300, N800 } from '@atlaskit/theme/colors';
8
8
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
9
9
  import formatDistance from 'date-fns/formatDistance';
10
10
  import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
@@ -30,7 +30,7 @@ export const Name = styled.div`
30
30
  line-height: 20px;
31
31
  `;
32
32
  export const ContainerName = styled.div`
33
- color: ${N100};
33
+ color: ${N300};
34
34
  line-height: 14px;
35
35
  font-size: ${relativeFontSizeToBase16(fontSizeSmall())};
36
36
  `;
@@ -146,6 +146,7 @@ export default class Resizer extends React.Component {
146
146
  render() {
147
147
  const handleStyles = {};
148
148
  const handles = {};
149
+ const handleComponent = {};
149
150
  const {
150
151
  innerPadding = 0,
151
152
  width,
@@ -154,7 +155,8 @@ export default class Resizer extends React.Component {
154
155
  layout,
155
156
  enable,
156
157
  children,
157
- ratio
158
+ ratio,
159
+ handleComponentFunc
158
160
  } = this.props;
159
161
  const {
160
162
  isResizing
@@ -167,6 +169,11 @@ export default class Resizer extends React.Component {
167
169
  zIndex: akRichMediaResizeZIndex,
168
170
  pointerEvents: 'auto'
169
171
  };
172
+ const sideHandleComponent = handleComponentFunc && handleComponentFunc(side);
173
+
174
+ if (sideHandleComponent) {
175
+ handleComponent[side] = sideHandleComponent;
176
+ }
170
177
  });
171
178
  const className = classnames(richMediaClassName, `image-${layout}`, this.props.className, {
172
179
  'is-resizing': isResizing,
@@ -199,6 +206,7 @@ export default class Resizer extends React.Component {
199
206
  handleClasses: handles,
200
207
  handleStyles: handleStyles,
201
208
  handleWrapperStyle: handleWrapperStyle,
209
+ handleComponent: handleComponent,
202
210
  enable: enable,
203
211
  onResize: this.handleResize,
204
212
  onResizeStop: this.handleResizeStop,
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "151.1.2";
2
+ export const version = "151.3.1";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "151.1.2",
3
+ "version": "151.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -510,8 +510,30 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
510
510
  transformer: _this.contentTransformer
511
511
  });
512
512
 
513
+ if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
514
+ _this.focusTimeoutId = handleEditorFocus(view);
515
+ }
516
+
513
517
  if (_this.featureFlags.ufo) {
518
+ _this.experienceStore = ExperienceStore.getInstance(view);
519
+
520
+ _this.experienceStore.start(EditorExperience.editSession);
521
+
522
+ _this.experienceStore.addMetadata(EditorExperience.editSession, {
523
+ reliabilityInterval: RELIABILITY_INTERVAL
524
+ });
525
+
514
526
  _this.reliabilityInterval = window.setInterval(function () {
527
+ var _this$experienceStore11, _this$experienceStore12;
528
+
529
+ (_this$experienceStore11 = _this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : (_this$experienceStore12 = _this$experienceStore11.success(EditorExperience.editSession)) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.finally(function () {
530
+ var _this$experienceStore13, _this$experienceStore14;
531
+
532
+ (_this$experienceStore13 = _this.experienceStore) === null || _this$experienceStore13 === void 0 ? void 0 : _this$experienceStore13.start(EditorExperience.editSession);
533
+ (_this$experienceStore14 = _this.experienceStore) === null || _this$experienceStore14 === void 0 ? void 0 : _this$experienceStore14.addMetadata(EditorExperience.editSession, {
534
+ reliabilityInterval: RELIABILITY_INTERVAL
535
+ });
536
+ });
515
537
  var reliabilityEvent = {
516
538
  action: ACTION.UFO_SESSION_COMPLETE,
517
539
  actionSubject: ACTION_SUBJECT.EDITOR,
@@ -523,14 +545,6 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
523
545
 
524
546
  _this.dispatchAnalyticsEvent(reliabilityEvent);
525
547
  }, RELIABILITY_INTERVAL);
526
- }
527
-
528
- if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
529
- _this.focusTimeoutId = handleEditorFocus(view);
530
- }
531
-
532
- if (_this.featureFlags.ufo) {
533
- _this.experienceStore = ExperienceStore.getInstance(view);
534
548
  } // Force React to re-render so consumers get a reference to the editor view
535
549
 
536
550
 
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
 
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7
7
 
8
- import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, codeBidiWarningPlugin } from '../plugins';
8
+ import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
9
9
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
10
10
  import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
11
11
  import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
@@ -96,7 +96,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
96
96
  },
97
97
  cardOptions: props.smartLinks || props.UNSAFE_cards,
98
98
  codeBlock: _objectSpread(_objectSpread({}, props.codeBlock), {}, {
99
- useLongPressSelection: false
99
+ useLongPressSelection: false,
100
+ appearance: props.appearance
100
101
  })
101
102
  };
102
103
  }
@@ -108,8 +109,6 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
108
109
  */
109
110
 
110
111
  export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
111
- var _props$featureFlags;
112
-
113
112
  var appearance = props.appearance;
114
113
  var isMobile = appearance === 'mobile';
115
114
  var isComment = appearance === 'comment';
@@ -277,8 +276,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
277
276
  if (props.allowPanel) {
278
277
  preset.add([panelPlugin, {
279
278
  useLongPressSelection: false,
280
- UNSAFE_allowCustomPanel: props.allowPanel.UNSAFE_allowCustomPanel,
281
- UNSAFE_allowCustomPanelEdit: props.allowPanel.UNSAFE_allowCustomPanelEdit
279
+ allowCustomPanel: props.allowPanel.allowCustomPanel,
280
+ allowCustomPanelEdit: props.allowPanel.allowCustomPanelEdit
282
281
  }]);
283
282
  }
284
283
 
@@ -375,26 +374,46 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
375
374
  replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
376
375
  }]);
377
376
 
378
- if (((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.showAvatarGroupAsPlugin) === true) {
377
+ var hasBeforePrimaryToolbar = function hasBeforePrimaryToolbar(components) {
378
+ if (components && 'before' in components) {
379
+ return !!components.before;
380
+ }
381
+
382
+ return false;
383
+ };
384
+
385
+ if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
386
+ preset.add([beforePrimaryToolbarPlugin, {
387
+ beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
388
+ }]);
389
+ }
390
+
391
+ if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
379
392
  preset.add([avatarGroupPlugin, {
380
- collabEdit: props.collabEdit
393
+ collabEdit: props.collabEdit,
394
+ takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
381
395
  }]);
382
396
  }
383
397
 
384
398
  if (props.allowFindReplace) {
385
- var _props$featureFlags2;
386
-
387
399
  preset.add([findReplacePlugin, {
388
- takeFullWidth: !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.showAvatarGroupAsPlugin) === false
400
+ takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
401
+ twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
389
402
  }]);
390
403
  }
391
404
 
405
+ if (props.UNSAFE_allowFragmentMark) {
406
+ preset.add(fragmentMarkPlugin);
407
+ }
408
+
392
409
  if (featureFlags.enableViewUpdateSubscription) {
393
410
  preset.add([viewUpdateSubscriptionPlugin]);
394
411
  }
395
412
 
396
413
  if (featureFlags.codeBidiWarnings) {
397
- preset.add(codeBidiWarningPlugin);
414
+ preset.add([codeBidiWarningPlugin, {
415
+ appearance: props.appearance
416
+ }]);
398
417
  }
399
418
 
400
419
  var excludes = new Set();
@@ -32,8 +32,7 @@ export function useCXHTMLPreset(_ref) {
32
32
  }
33
33
  }]);
34
34
  preset.add([panelPlugin, {
35
- UNSAFE_allowCustomPanel: true,
36
- UNSAFE_allowCustomPanelEdit: true
35
+ allowCustomPanel: true
37
36
  }]);
38
37
  preset.add(listPlugin);
39
38
  preset.add(textColorPlugin);
@@ -63,7 +63,9 @@ export function createDefaultPreset(options) {
63
63
  preset.add(floatingToolbarPlugin);
64
64
  preset.add([featureFlagsContextPlugin, options.featureFlags || {}]);
65
65
  preset.add([selectionPlugin, options.selection]);
66
- preset.add([codeBlockPlugin, options.codeBlock]);
66
+ preset.add([codeBlockPlugin, options.codeBlock || {
67
+ appearance: 'full-page'
68
+ }]);
67
69
  return preset;
68
70
  }
69
71
  export function useDefaultPreset(props) {
@@ -173,10 +173,10 @@ var ReactNodeView = /*#__PURE__*/function () {
173
173
  }
174
174
  }, {
175
175
  key: "update",
176
- value: function update(node, _decorations) {
176
+ value: function update(node, _decorations, _innerDecorations) {
177
177
  var _this4 = this;
178
178
 
179
- var validUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {
179
+ var validUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
180
180
  return true;
181
181
  };
182
182
  // @see https://github.com/ProseMirror/prosemirror/issues/648
@@ -97,6 +97,13 @@ export var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
97
97
  return _this.isSelectedNode(_this.view.state.selection) || _this.isSelectionInsideNode(from, to);
98
98
  });
99
99
 
100
+ _defineProperty(_assertThisInitialized(_this), "nodeInsideSelection", function () {
101
+ var selection = _this.view.state.selection;
102
+ var from = selection.from,
103
+ to = selection.to;
104
+ return _this.isSelectedNode(selection) || _this.isNodeInsideSelection(from, to);
105
+ });
106
+
100
107
  _defineProperty(_assertThisInitialized(_this), "onSelectionChange", function () {
101
108
  _this.update(_this.node, []);
102
109
  });
@@ -55,6 +55,7 @@ export var ACTION;
55
55
  ACTION["INITIALISED"] = "initialised";
56
56
  ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
57
57
  ACTION["INSERTED"] = "inserted";
58
+ ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
58
59
  ACTION["INVOKED"] = "invoked";
59
60
  ACTION["LANGUAGE_SELECTED"] = "languageSelected";
60
61
  ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
@@ -264,7 +264,7 @@ export var isSelectionValid = function isSelectionValid(state) {
264
264
  return AnnotationSelectionType.DISABLED;
265
265
  }
266
266
 
267
- if (disallowOnWhitespace && hasWhitespaceNode(selection)) {
267
+ if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
268
268
  return AnnotationSelectionType.INVALID;
269
269
  }
270
270
 
@@ -314,16 +314,27 @@ function isEmptyTextSelection(selection, schema) {
314
314
  */
315
315
 
316
316
 
317
- export function hasWhitespaceNode(selection) {
318
- var foundWhitespace = false;
319
- selection.content().content.descendants(function (node) {
317
+ export function hasInvalidWhitespaceNode(selection) {
318
+ var foundInvalidWhitespace = false;
319
+ var content = selection.content().content;
320
+ content.descendants(function (node) {
320
321
  if (node.textContent.trim() === '') {
321
- foundWhitespace = true;
322
+ // Trailing new lines do not result in the annotation spanning into
323
+ // the trailing new line so can be ignored when looking for invalid
324
+ // whitespace nodes.
325
+ var nodeIsTrailingNewLine = // it is the final node
326
+ node.eq(content.lastChild) && // and there are multiple nodes
327
+ !node.eq(content.firstChild) && // and it is a paragraph node
328
+ node.type.name === 'paragraph';
329
+
330
+ if (!nodeIsTrailingNewLine) {
331
+ foundInvalidWhitespace = true;
332
+ }
322
333
  }
323
334
 
324
- return !foundWhitespace;
335
+ return !foundInvalidWhitespace;
325
336
  });
326
- return foundWhitespace;
337
+ return foundInvalidWhitespace;
327
338
  }
328
339
  /*
329
340
  * verifies if node contains annotation mark
@@ -17,7 +17,8 @@ var avatarGroup = function avatarGroup(props) {
17
17
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
18
18
  editorView: editorView,
19
19
  eventDispatcher: eventDispatcher,
20
- collabEdit: props.collabEdit
20
+ collabEdit: props.collabEdit,
21
+ takeFullWidth: props.takeFullWidth
21
22
  });
22
23
  }
23
24
  };
@@ -6,7 +6,9 @@ import React, { useEffect } from 'react';
6
6
  import AvatarsWithPluginState from '../../collab-edit/ui/avatars-with-plugin-state';
7
7
  import styled from 'styled-components';
8
8
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
9
- var ToolbarButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])));
9
+ var ToolbarButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-grow: ", ";\n justify-content: flex-end;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])), function (props) {
10
+ return props.takeFullWidth ? 1 : 0;
11
+ });
10
12
  export var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
11
13
  var dispatchAnalyticsEvent = props.dispatchAnalyticsEvent;
12
14
  useEffect(function () {
@@ -23,7 +25,8 @@ export var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
23
25
  }, [dispatchAnalyticsEvent]);
24
26
  return /*#__PURE__*/React.createElement(ToolbarButtonWrapper, {
25
27
  "aria-label": "Editors",
26
- "data-testid": 'avatar-group-in-plugin'
28
+ "data-testid": 'avatar-group-in-plugin',
29
+ takeFullWidth: props.takeFullWidth
27
30
  }, /*#__PURE__*/React.createElement(AvatarsWithPluginState, {
28
31
  editorView: props.editorView,
29
32
  eventDispatcher: props.eventDispatcher,
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { BeforePrimaryToolbarWrapper } from './ui/BeforePrimaryToolbarWrapper';
3
+
4
+ var beforePrimaryToolbar = function beforePrimaryToolbar(props) {
5
+ return {
6
+ name: 'beforePrimaryToolbar',
7
+ primaryToolbarComponent: function primaryToolbarComponent() {
8
+ return /*#__PURE__*/React.createElement(BeforePrimaryToolbarWrapper, {
9
+ beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
10
+ });
11
+ }
12
+ };
13
+ };
14
+
15
+ export default beforePrimaryToolbar;
@@ -0,0 +1,12 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ import React from 'react';
6
+ import styled from 'styled-components';
7
+ export var BeforePrimaryToolbarPluginWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 8px;\n flex-grow: 1;\n justify-content: flex-end;\n align-items: center;\n"])));
8
+ export var BeforePrimaryToolbarWrapper = function BeforePrimaryToolbarWrapper(props) {
9
+ return /*#__PURE__*/React.createElement(BeforePrimaryToolbarPluginWrapper, {
10
+ "data-testid": 'before-primary-toolbar-components-plugin'
11
+ }, props.beforePrimaryToolbarComponents);
12
+ };
@@ -1,13 +1,16 @@
1
1
  import { createPlugin } from './pm-plugins/main';
2
2
 
3
- var codeBidiWarning = function codeBidiWarning() {
3
+ var codeBidiWarning = function codeBidiWarning(_ref) {
4
+ var appearance = _ref.appearance;
4
5
  return {
5
6
  name: 'codeBidiWarning',
6
7
  pmPlugins: function pmPlugins() {
7
8
  return [{
8
9
  name: 'codeBidiWarning',
9
10
  plugin: function plugin(options) {
10
- return createPlugin(options);
11
+ return createPlugin(options, {
12
+ appearance: appearance
13
+ });
11
14
  }
12
15
  }];
13
16
  }
@@ -2,20 +2,29 @@ import { Plugin } from 'prosemirror-state';
2
2
  import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
3
3
  import { codeBidiWarningPluginKey } from '../plugin-key';
4
4
  import { createBidiWarningsDecorationSetFromDoc, createPluginState, getPluginState } from './plugin-factory';
5
- export var createPlugin = function createPlugin(_ref) {
5
+ export var createPlugin = function createPlugin(_ref, _ref2) {
6
6
  var dispatch = _ref.dispatch,
7
7
  reactContext = _ref.reactContext;
8
+ var appearance = _ref2.appearance;
8
9
  var intl = reactContext().intl;
9
10
  var codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
10
11
  return new Plugin({
11
12
  key: codeBidiWarningPluginKey,
12
13
  state: createPluginState(dispatch, function (state) {
14
+ // The appearance being mobile indicates we are in an editor being
15
+ // rendered by mobile bridge in a web view.
16
+ // The tooltip is likely to have unexpected behaviour there, with being cut
17
+ // off, so we disable it. This is also to keep the behaviour consistent with
18
+ // the rendering in the mobile Native Renderer.
19
+ var tooltipEnabled = appearance !== 'mobile';
13
20
  return {
14
21
  decorationSet: createBidiWarningsDecorationSetFromDoc({
15
22
  doc: state.doc,
16
- codeBidiWarningLabel: codeBidiWarningLabel
23
+ codeBidiWarningLabel: codeBidiWarningLabel,
24
+ tooltipEnabled: tooltipEnabled
17
25
  }),
18
- codeBidiWarningLabel: codeBidiWarningLabel
26
+ codeBidiWarningLabel: codeBidiWarningLabel,
27
+ tooltipEnabled: tooltipEnabled
19
28
  };
20
29
  }),
21
30
  props: {
@@ -22,7 +22,8 @@ var _pluginFactory = pluginFactory(codeBidiWarningPluginKey, reducer, {
22
22
 
23
23
  var newBidiWarningsDecorationSet = createBidiWarningsDecorationSetFromDoc({
24
24
  doc: tr.doc,
25
- codeBidiWarningLabel: pluginState.codeBidiWarningLabel
25
+ codeBidiWarningLabel: pluginState.codeBidiWarningLabel,
26
+ tooltipEnabled: pluginState.tooltipEnabled
26
27
  });
27
28
  return _objectSpread(_objectSpread({}, pluginState), {}, {
28
29
  decorationSet: newBidiWarningsDecorationSet
@@ -35,7 +36,8 @@ var _pluginFactory = pluginFactory(codeBidiWarningPluginKey, reducer, {
35
36
  export { createPluginState, getPluginState };
36
37
  export function createBidiWarningsDecorationSetFromDoc(_ref) {
37
38
  var doc = _ref.doc,
38
- codeBidiWarningLabel = _ref.codeBidiWarningLabel;
39
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel,
40
+ tooltipEnabled = _ref.tooltipEnabled;
39
41
  var bidiCharactersAndTheirPositions = [];
40
42
  doc.descendants(function (node, pos) {
41
43
  var isTextWithCodeMark = node.type.name === 'text' && node.marks && node.marks.some(function (mark) {
@@ -77,20 +79,28 @@ export function createBidiWarningsDecorationSetFromDoc(_ref) {
77
79
  var position = _ref4.position,
78
80
  bidiCharacter = _ref4.bidiCharacter;
79
81
  return Decoration.widget(position, function () {
80
- return renderDOM(bidiCharacter, codeBidiWarningLabel);
82
+ return renderDOM({
83
+ bidiCharacter: bidiCharacter,
84
+ codeBidiWarningLabel: codeBidiWarningLabel,
85
+ tooltipEnabled: tooltipEnabled
86
+ });
81
87
  });
82
88
  }));
83
89
  return newBidiWarningsDecorationSet;
84
90
  }
85
91
 
86
- function renderDOM(bidiCharacter, codeBidiWarningLabel) {
92
+ function renderDOM(_ref5) {
93
+ var bidiCharacter = _ref5.bidiCharacter,
94
+ codeBidiWarningLabel = _ref5.codeBidiWarningLabel,
95
+ tooltipEnabled = _ref5.tooltipEnabled;
87
96
  var element = document.createElement('span'); // Note: we use this pattern elsewhere (see highlighting code block, and drop cursor widget decoration)
88
97
  // we should investigate if there is a memory leak with such usage.
89
98
 
90
99
  ReactDOM.render( /*#__PURE__*/React.createElement(CodeBidiWarning, {
91
100
  bidiCharacter: bidiCharacter,
92
101
  skipChildren: true,
93
- label: codeBidiWarningLabel
102
+ label: codeBidiWarningLabel,
103
+ tooltipEnabled: tooltipEnabled
94
104
  }), element);
95
105
  return element;
96
106
  }
@@ -9,8 +9,7 @@ import { IconCode } from '../quick-insert/assets';
9
9
  import { messages } from '../block-type/messages';
10
10
  import refreshBrowserSelectionOnChange from './refresh-browser-selection';
11
11
 
12
- var codeBlockPlugin = function codeBlockPlugin() {
13
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12
+ var codeBlockPlugin = function codeBlockPlugin(options) {
14
13
  return {
15
14
  name: 'codeBlock',
16
15
  nodes: function nodes() {
@@ -26,7 +25,8 @@ var codeBlockPlugin = function codeBlockPlugin() {
26
25
  var reactContext = _ref.reactContext;
27
26
  return createPlugin({
28
27
  useLongPressSelection: options.useLongPressSelection,
29
- reactContext: reactContext
28
+ reactContext: reactContext,
29
+ appearance: options.appearance
30
30
  });
31
31
  }
32
32
  }, {
@@ -121,7 +121,8 @@ export var CodeBlockView = /*#__PURE__*/function () {
121
121
  language: node.attrs.language,
122
122
  showLineNumbers: false,
123
123
  codeBidiWarnings: this.codeBidiWarningOptions.enabled,
124
- codeBidiWarningLabel: this.codeBidiWarningOptions.label
124
+ codeBidiWarningLabel: this.codeBidiWarningOptions.label,
125
+ codeBidiWarningTooltipEnabled: this.codeBidiWarningOptions.tooltipEnabled
125
126
  }), highlighting);
126
127
  this.measure(performance.now() - start);
127
128
  content === null || content === void 0 ? void 0 : content.setAttribute('data-debounce', 'false');
@@ -165,11 +166,13 @@ export var CodeBlockView = /*#__PURE__*/function () {
165
166
  }();
166
167
  export var highlightingCodeBlockNodeView = function highlightingCodeBlockNodeView(_ref) {
167
168
  var codeBidiWarnings = _ref.codeBidiWarnings,
168
- codeBidiWarningLabel = _ref.codeBidiWarningLabel;
169
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel,
170
+ codeBidiWarningTooltipEnabled = _ref.codeBidiWarningTooltipEnabled;
169
171
  return function (node, view, getPos) {
170
172
  return new CodeBlockView(node, view, getPos, {
173
+ label: codeBidiWarningLabel,
171
174
  enabled: codeBidiWarnings,
172
- label: codeBidiWarningLabel
175
+ tooltipEnabled: codeBidiWarningTooltipEnabled
173
176
  });
174
177
  };
175
178
  };
@@ -17,7 +17,8 @@ import { getFeatureFlags } from '../../feature-flags-context';
17
17
  export var createPlugin = function createPlugin(_ref) {
18
18
  var _ref$useLongPressSele = _ref.useLongPressSelection,
19
19
  useLongPressSelection = _ref$useLongPressSele === void 0 ? false : _ref$useLongPressSele,
20
- reactContext = _ref.reactContext;
20
+ reactContext = _ref.reactContext,
21
+ appearance = _ref.appearance;
21
22
  var intl = reactContext().intl;
22
23
  var codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
23
24
  return new Plugin({
@@ -57,10 +58,17 @@ export var createPlugin = function createPlugin(_ref) {
57
58
  props: {
58
59
  nodeViews: {
59
60
  codeBlock: function codeBlock(node, view, getPos) {
60
- var featureFlags = getFeatureFlags(view.state);
61
+ var featureFlags = getFeatureFlags(view.state); // The appearance being mobile indicates we are in an editor being
62
+ // rendered by mobile bridge in a web view.
63
+ // The tooltip is likely to have unexpected behaviour there, with being cut
64
+ // off, so we disable it. This is also to keep the behaviour consistent with
65
+ // the rendering in the mobile Native Renderer.
66
+
67
+ var codeBidiWarningTooltipEnabled = appearance !== 'mobile';
61
68
  var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockNodeView({
62
69
  codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
63
- codeBidiWarningLabel: codeBidiWarningLabel
70
+ codeBidiWarningLabel: codeBidiWarningLabel,
71
+ codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
64
72
  }) : codeBlockNodeView();
65
73
  return createCodeBlockNodeView(node, view, getPos);
66
74
  }
@@ -1,5 +1,6 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import { Fragment, Mark } from 'prosemirror-model';
3
+ import { NodeSelection } from 'prosemirror-state';
3
4
  import { insertMacroFromMacroBrowser } from '../macro';
4
5
  import { pluginKey as macroPluginKey } from '../macro/plugin-key';
5
6
  import { setEditingContextToContextPanel } from './commands';
@@ -43,7 +44,7 @@ var extensionAPICallPayload = function extensionAPICallPayload(functionName) {
43
44
 
44
45
  export var createExtensionAPI = function createExtensionAPI(options) {
45
46
  var doc = {
46
- insertAfter: function insertAfter(localId, adf) {
47
+ insertAfter: function insertAfter(localId, adf, opt) {
47
48
  var editorView = options.editorView;
48
49
  var dispatch = editorView.dispatch; // Be extra cautious since 3rd party devs can use regular JS without type safety
49
50
 
@@ -82,7 +83,8 @@ export var createExtensionAPI = function createExtensionAPI(options) {
82
83
  throw new Error('insertAfter(): Could not create a node for given ADFEntity.');
83
84
  }
84
85
 
85
- tr.insert(nodePos.pos + nodePos.node.nodeSize, newNode); // Validate if the document is valid at this point
86
+ var insertPosition = nodePos.pos + nodePos.node.nodeSize;
87
+ tr.insert(insertPosition, newNode); // Validate if the document is valid at this point
86
88
 
87
89
  try {
88
90
  tr.doc.check();
@@ -126,6 +128,11 @@ export var createExtensionAPI = function createExtensionAPI(options) {
126
128
  };
127
129
  addAnalytics(state, tr, payload);
128
130
  });
131
+
132
+ if (opt && opt.allowSelectionToNewNode) {
133
+ tr.setSelection(new NodeSelection(tr.doc.resolve(insertPosition)));
134
+ }
135
+
129
136
  dispatch(tr);
130
137
  },
131
138
  scrollTo: function scrollTo(localId) {