@atlaskit/editor-core 151.1.2 → 152.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +22 -8
  3. package/dist/cjs/create-editor/create-plugins-list.js +30 -11
  4. package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
  5. package/dist/cjs/labs/next/presets/default.js +3 -1
  6. package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
  7. package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
  8. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  9. package/dist/cjs/plugins/annotation/utils.js +19 -8
  10. package/dist/cjs/plugins/avatar-group/index.js +2 -1
  11. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  12. package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
  13. package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
  14. package/dist/cjs/plugins/code-bidi-warning/index.js +5 -2
  15. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  16. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  17. package/dist/cjs/plugins/code-block/index.js +3 -3
  18. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  19. package/dist/cjs/plugins/code-block/pm-plugins/main.js +11 -3
  20. package/dist/cjs/plugins/extension/extension-api.js +10 -2
  21. package/dist/cjs/plugins/extension/ui/styles.js +1 -1
  22. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  23. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
  24. package/dist/cjs/plugins/find-replace/index.js +14 -137
  25. package/dist/cjs/plugins/find-replace/ui/Find.js +16 -9
  26. package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
  27. package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
  28. package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
  29. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
  30. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  31. package/dist/cjs/plugins/fragment/index.js +34 -0
  32. package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
  33. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  34. package/dist/cjs/plugins/index.js +16 -0
  35. package/dist/cjs/plugins/list/actions/conversions.js +39 -71
  36. package/dist/cjs/plugins/list/transforms.js +7 -1
  37. package/dist/cjs/plugins/media/index.js +2 -3
  38. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
  39. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
  40. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
  41. package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
  42. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  43. package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
  44. package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
  45. package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
  46. package/dist/cjs/plugins/media/toolbar/index.js +90 -3
  47. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  48. package/dist/cjs/plugins/media/utils/media-common.js +1 -1
  49. package/dist/cjs/plugins/media/utils/media-files.js +5 -1
  50. package/dist/cjs/plugins/panel/actions.js +2 -2
  51. package/dist/cjs/plugins/panel/index.js +3 -3
  52. package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
  53. package/dist/cjs/plugins/panel/toolbar.js +10 -5
  54. package/dist/cjs/plugins/panel/utils.js +15 -0
  55. package/dist/cjs/plugins/rank.js +3 -2
  56. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
  57. package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
  58. package/dist/cjs/plugins/table/commands/insert.js +1 -0
  59. package/dist/cjs/plugins/table/index.js +3 -2
  60. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
  61. package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
  62. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  63. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  64. package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
  65. package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
  66. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  67. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  68. package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
  69. package/dist/cjs/plugins/table/ui/consts.js +1 -1
  70. package/dist/cjs/plugins/table/ui/messages.js +1 -1
  71. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  72. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  73. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
  74. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  75. package/dist/cjs/plugins/text-formatting/index.js +2 -1
  76. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
  77. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
  78. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
  79. package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
  80. package/dist/cjs/ui/ColorPalette/index.js +7 -4
  81. package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
  82. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
  83. package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
  84. package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
  85. package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
  86. package/dist/cjs/ui/DropdownMenu/index.js +3 -1
  87. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
  88. package/dist/cjs/ui/Resizer/index.js +9 -1
  89. package/dist/cjs/version-wrapper.js +1 -1
  90. package/dist/cjs/version.json +1 -1
  91. package/dist/es2019/create-editor/ReactEditorView.js +19 -8
  92. package/dist/es2019/create-editor/create-plugins-list.js +31 -12
  93. package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
  94. package/dist/es2019/labs/next/presets/default.js +3 -1
  95. package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
  96. package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
  97. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  98. package/dist/es2019/plugins/annotation/utils.js +18 -7
  99. package/dist/es2019/plugins/avatar-group/index.js +2 -1
  100. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
  101. package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
  102. package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  103. package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
  104. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
  105. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
  106. package/dist/es2019/plugins/code-block/index.js +3 -2
  107. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  108. package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
  109. package/dist/es2019/plugins/extension/extension-api.js +9 -2
  110. package/dist/es2019/plugins/extension/ui/styles.js +6 -0
  111. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  112. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
  113. package/dist/es2019/plugins/find-replace/index.js +15 -128
  114. package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
  115. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
  116. package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
  117. package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
  118. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  119. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
  120. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  121. package/dist/es2019/plugins/fragment/index.js +22 -0
  122. package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
  123. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  124. package/dist/es2019/plugins/index.js +2 -0
  125. package/dist/es2019/plugins/list/actions/conversions.js +38 -69
  126. package/dist/es2019/plugins/list/transforms.js +5 -1
  127. package/dist/es2019/plugins/media/index.js +2 -2
  128. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
  129. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
  130. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
  131. package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
  132. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  133. package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
  134. package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
  135. package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
  136. package/dist/es2019/plugins/media/toolbar/index.js +90 -3
  137. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
  138. package/dist/es2019/plugins/media/utils/media-common.js +1 -1
  139. package/dist/es2019/plugins/media/utils/media-files.js +6 -1
  140. package/dist/es2019/plugins/panel/actions.js +2 -2
  141. package/dist/es2019/plugins/panel/index.js +5 -5
  142. package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
  143. package/dist/es2019/plugins/panel/toolbar.js +10 -5
  144. package/dist/es2019/plugins/panel/utils.js +8 -1
  145. package/dist/es2019/plugins/rank.js +3 -2
  146. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
  147. package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
  148. package/dist/es2019/plugins/table/commands/insert.js +1 -2
  149. package/dist/es2019/plugins/table/index.js +2 -1
  150. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  151. package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
  152. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  153. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  154. package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
  155. package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
  156. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  157. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  158. package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
  159. package/dist/es2019/plugins/table/ui/consts.js +2 -2
  160. package/dist/es2019/plugins/table/ui/messages.js +1 -1
  161. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  162. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  163. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  164. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  165. package/dist/es2019/plugins/text-formatting/index.js +3 -2
  166. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  167. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  168. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
  169. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
  170. package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
  171. package/dist/es2019/ui/ColorPalette/index.js +7 -4
  172. package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
  173. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
  174. package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
  175. package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
  176. package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
  177. package/dist/es2019/ui/Dropdown/index.js +2 -1
  178. package/dist/es2019/ui/DropdownMenu/index.js +7 -3
  179. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  180. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  181. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
  182. package/dist/es2019/ui/Resizer/index.js +9 -1
  183. package/dist/es2019/version-wrapper.js +1 -1
  184. package/dist/es2019/version.json +1 -1
  185. package/dist/esm/create-editor/ReactEditorView.js +22 -8
  186. package/dist/esm/create-editor/create-plugins-list.js +31 -12
  187. package/dist/esm/labs/next/presets/cxhtml.js +1 -2
  188. package/dist/esm/labs/next/presets/default.js +3 -1
  189. package/dist/esm/nodeviews/ReactNodeView.js +2 -2
  190. package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
  191. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  192. package/dist/esm/plugins/annotation/utils.js +18 -7
  193. package/dist/esm/plugins/avatar-group/index.js +2 -1
  194. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  195. package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
  196. package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  197. package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
  198. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
  199. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
  200. package/dist/esm/plugins/code-block/index.js +3 -3
  201. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
  202. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  203. package/dist/esm/plugins/extension/extension-api.js +9 -2
  204. package/dist/esm/plugins/extension/ui/styles.js +1 -1
  205. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  206. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
  207. package/dist/esm/plugins/find-replace/index.js +14 -131
  208. package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
  209. package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
  210. package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
  211. package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
  212. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  213. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
  214. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  215. package/dist/esm/plugins/fragment/index.js +22 -0
  216. package/dist/esm/plugins/fragment/plugin-key.js +2 -0
  217. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  218. package/dist/esm/plugins/index.js +2 -0
  219. package/dist/esm/plugins/list/actions/conversions.js +38 -71
  220. package/dist/esm/plugins/list/transforms.js +7 -1
  221. package/dist/esm/plugins/media/index.js +2 -3
  222. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
  223. package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
  224. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
  225. package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
  226. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  227. package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
  228. package/dist/esm/plugins/media/toolbar/commands.js +45 -0
  229. package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
  230. package/dist/esm/plugins/media/toolbar/index.js +88 -3
  231. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  232. package/dist/esm/plugins/media/utils/media-common.js +1 -1
  233. package/dist/esm/plugins/media/utils/media-files.js +6 -1
  234. package/dist/esm/plugins/panel/actions.js +2 -2
  235. package/dist/esm/plugins/panel/index.js +5 -5
  236. package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
  237. package/dist/esm/plugins/panel/toolbar.js +9 -4
  238. package/dist/esm/plugins/panel/utils.js +13 -0
  239. package/dist/esm/plugins/rank.js +3 -2
  240. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
  241. package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
  242. package/dist/esm/plugins/table/commands/insert.js +1 -2
  243. package/dist/esm/plugins/table/index.js +3 -2
  244. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  245. package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
  246. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  247. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  248. package/dist/esm/plugins/table/transforms/column-width.js +13 -3
  249. package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
  250. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  251. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  252. package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
  253. package/dist/esm/plugins/table/ui/consts.js +2 -2
  254. package/dist/esm/plugins/table/ui/messages.js +1 -1
  255. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  256. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  257. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  258. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  259. package/dist/esm/plugins/text-formatting/index.js +3 -2
  260. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  261. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  262. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
  263. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
  264. package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
  265. package/dist/esm/ui/ColorPalette/index.js +7 -4
  266. package/dist/esm/ui/ColorPickerButton/index.js +1 -1
  267. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
  268. package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
  269. package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
  270. package/dist/esm/ui/ConfigPanel/utils.js +1 -6
  271. package/dist/esm/ui/Dropdown/index.js +2 -1
  272. package/dist/esm/ui/DropdownMenu/index.js +7 -3
  273. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  274. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  275. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
  276. package/dist/esm/ui/Resizer/index.js +9 -1
  277. package/dist/esm/version-wrapper.js +1 -1
  278. package/dist/esm/version.json +1 -1
  279. package/dist/types/labs/next/full-page.d.ts +1 -1
  280. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
  281. package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
  282. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  283. package/dist/types/plugins/analytics/types/events.d.ts +7 -1
  284. package/dist/types/plugins/annotation/utils.d.ts +1 -1
  285. package/dist/types/plugins/avatar-group/index.d.ts +1 -0
  286. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
  287. package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
  288. package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
  289. package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
  290. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
  291. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
  292. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
  293. package/dist/types/plugins/code-block/index.d.ts +1 -1
  294. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
  295. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
  296. package/dist/types/plugins/code-block/types.d.ts +2 -0
  297. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  298. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
  299. package/dist/types/plugins/find-replace/index.d.ts +1 -0
  300. package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
  301. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
  302. package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
  303. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
  304. package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
  305. package/dist/types/plugins/fragment/index.d.ts +5 -0
  306. package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
  307. package/dist/types/plugins/index.d.ts +2 -0
  308. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
  309. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
  310. package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
  311. package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
  312. package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
  313. package/dist/types/plugins/media/types.d.ts +0 -1
  314. package/dist/types/plugins/panel/actions.d.ts +1 -1
  315. package/dist/types/plugins/panel/types.d.ts +8 -2
  316. package/dist/types/plugins/quick-insert/index.d.ts +2 -1
  317. package/dist/types/plugins/table/commands/insert.d.ts +3 -0
  318. package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
  319. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
  320. package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
  321. package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
  322. package/dist/types/plugins/table/types.d.ts +8 -0
  323. package/dist/types/plugins/table/ui/consts.d.ts +1 -1
  324. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  325. package/dist/types/types/editor-props.d.ts +11 -1
  326. package/dist/types/types/feature-flags.d.ts +13 -0
  327. package/dist/types/types/index.d.ts +1 -1
  328. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  329. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
  330. package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
  331. package/dist/types/ui/ColorPalette/index.d.ts +1 -0
  332. package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
  333. package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
  334. package/dist/types/ui/Resizer/index.d.ts +1 -0
  335. package/package.json +35 -31
  336. package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
  337. package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  338. package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  339. package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,117 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 152.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`3a2a5e14fdc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a2a5e14fdc) - As we are moving to full schema, merged the customPanel nodeSpec with panel nodeSpec
8
+ - [`0cf5fa82add`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0cf5fa82add) - CETI-20 Rename custom panel FF from `UNSAFE_allowCustomPanel` to `allowCustomPanel`
9
+ - [`fd675db8754`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd675db8754) - [ux] ED-13100: added GroupedField.hasGroupedValues and enable parameter flattening for expand/tab-group/tab fields in config panels. The default value of `GroupedField.hasGroupedValues` is `False`, which will flatten data structures. Set `GroupedField.hasGroupedValues` to `True` on all tab-group/tab/expand fields if you wish to retain existing behaviour.
10
+
11
+ This change has several parts to ensure the correctness of serialize(), deserialize(), GroupedField.hasGroupedValues and BaseFieldDefinition.allowDuplicates
12
+
13
+ - Introduced GroupedField.hasGroupedValues which allows expand/tabgroup/tab to store the value of its fields by the name of the expand/tabgroup/tab if hasGroupedValues=True (False by default)
14
+ - Fixed a type safety issue with Parameters and ParametersWithDuplicateFields where Typescript would consider the types Parameters = Parameters[] (resolves some inconsistencies in the editor code and extensions)
15
+ - Restrict allowDuplicates so it only works within Fieldset as originally intended
16
+ - serialize() now populates `Field.defaultValue` as expected
17
+
18
+ - [`01a41e75803`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01a41e75803) - Removes `allowMediaInline` media prop and replaces with Inline Files feature flag for editor and mobile bridge
19
+
20
+ ### Minor Changes
21
+
22
+ - [`65a541166fe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65a541166fe) - ED-13766 fix pm node spec for media single with caption
23
+ - [`d32688fd0aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d32688fd0aa) - [ux] CETI-138 Colour picker border size is not consistent with table colour picker
24
+ - [`42ecbc9358e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42ecbc9358e) - [ux] CERN-1124 When feature flag `twoLineEditorToolbar` is on, show editor toolbar in two lines when viewport is small.
25
+ - [`7ad1c5a4243`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7ad1c5a4243) - CETI-131 Enabled remove emoji button for standard panels
26
+ - [`23514411f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/23514411f27) - CETI-134 added support to render dark colors for the custom panels in the dark mode
27
+ - [`42c7ac64c39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42c7ac64c39) - AK-654 Set a status link label with input
28
+ - [`e81dd06a8a0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e81dd06a8a0) - CETI-158 Use large productivity icons when changing standard panel background colour
29
+ - [`8581ed429dd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8581ed429dd) - ED-13688: Add reliability edit sessions to UFO analytics
30
+ - [`bb59175355d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bb59175355d) - [ux] CETI-150: Colour picker border size is not consistent with table colour picker
31
+ - [`71bf4ef83f4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71bf4ef83f4) - CETI-130 change default custom panel color
32
+ - [`229177bb85d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/229177bb85d) - CETI-16 added remove emoji icon so that it appears in mobilekit too
33
+ - [`b230f366971`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b230f366971) - [ED-14008] Bump prosemirror-view from 1.20.2 to 1.23.1
34
+ - [`47c349601b2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47c349601b2) - ED-13869 Added the option to automatically select ADF content inserted via the `insertAfter()` extension API. We've modified our extension API and introduced a new parameter in `insertAfter()`. The function has now a third parameter, ie `options`, which is an object and has a property flag called `allowSelectionToNewNode` that lets you focus on the ADF added when set to `true`.
35
+ - [`287e8cd3bd2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/287e8cd3bd2) - CETI-135 handle the focus of cursor when user selects an emoji from emoji picker
36
+ - [`8bbb96540ea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8bbb96540ea) - Add "fragment" mark to stage0 ADF schema
37
+ - [`a3737a9b3aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a3737a9b3aa) - CETI-64 Updating the dark mode colors for the standard panels
38
+ - [`35b575a601c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/35b575a601c) - CETI-148 Emoji picker vertical alignment
39
+ - [`398bbc9f353`](https://bitbucket.org/atlassian/atlassian-frontend/commits/398bbc9f353) - [ux] AK-649 Change color of count of found items
40
+ - [`87d66ea4618`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87d66ea4618) - [ux] ED-13183 allow creating annotations from selections with trailing new line
41
+ - [`62a91dbe7d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/62a91dbe7d9) - [ux] CERN-896 Update primaryToolbarComponents to accept before and after react components.
42
+ - [`ad0c44e802a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad0c44e802a) - pass singleLayout to mobile editor element"
43
+ - [`d21da111ec2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d21da111ec2) - CETI-95 Predefined icon sizes are different from existing icons
44
+
45
+ ### Patch Changes
46
+
47
+ - [`97479886f9e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/97479886f9e) - ED-13534 Fixed issue with right shadow not hiding with overflow shadows optimisation
48
+ - [`47fc9ae7b2a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47fc9ae7b2a) - [ux] ED-11481 Fix bug preventing tables and extensions from being selected with Shift + ArrowDown or ArrowUp
49
+ - [`7f85f712286`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f85f712286) - Ticket: https://a11y-internal.atlassian.net/browse/AK-747, when activating the MoreColors button inside the ColorPalette component, set focus to the first color of the updated content.
50
+ - [`34ffcf18914`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ffcf18914) - [ux] Added a floating toolbar to the new mediaInline component
51
+ - [`e26ff629f3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e26ff629f3d) - [ux] Update warning message when deleting a table that's linked to a chart.
52
+ - [`1c2e00c6e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1c2e00c6e65) - ED-10827: Fixed a UI bug where undoing a tabbed task list item would not show any change in the UI.
53
+ - [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) - ED-11632: Bump prosemirror packages;
54
+
55
+ - prosmirror-commands 1.1.4 -> 1.1.11,
56
+ - prosemirror-model 1.11.0 -> 1.14.3,
57
+ - prosemirror-state 1.3.3 -> 1.3.4,
58
+ - prosemirror-transform 1.2.8 -> 1.3.2,
59
+ - prosemirror-view 1.15.4 + 1.18.8 -> 1.20.2.
60
+
61
+ - [`2f791df708a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2f791df708a) - Changed link search list item description color to meet minimum contrast requirements
62
+ - [`fc70978492a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc70978492a) - Using type for SSR prop to reduce dependency on media-common
63
+ - [`132e841431b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/132e841431b) - [ux][ed-10831] Refactor part of conversions.ts in the lists plugin to solve for cases where the selection covers multiple lists with paragraphs in between.
64
+ - [`2136e4844f0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2136e4844f0) - [ux] ED-13286 Fixes 'wide' and 'full-width' extensions breaking styling when pasted into bodiedExtensions.
65
+ - [`aa6b3a474ff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aa6b3a474ff) - ED-13286 extensions inside a bodied extension shouldn't overflow width
66
+ - [`50f99428aab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/50f99428aab) - [ux] ED-11088- FIxed bug that prevented block components containing a hardbreak followed by list markdown from being pasted
67
+ - [`365e507451e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/365e507451e) - [ux] This reworks the changes triggered by a user inserting a new column.
68
+ Previously the table cells would always be resized based on a max table
69
+ size which did not overflow.
70
+ This changes that logic to only resize table cells if the table did not
71
+ overflow prior to the insertion.
72
+ - [`16ab2a61721`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16ab2a61721) - fix copy paste emoji wrapped in a span
73
+ - [`e741804b52a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e741804b52a) - Fixed media nodes not being built synchronously on SSR
74
+ - [`57b4778a620`](https://bitbucket.org/atlassian/atlassian-frontend/commits/57b4778a620) - [ux] AK-244 Accessibility fix. Color of borders have minimum contrast of 3:1
75
+ - [`7b91aee9c39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7b91aee9c39) - Add File Preview tooltip to media card/media inline floating toolbar
76
+ - [`ea3a31eda5a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea3a31eda5a) - AK-745: ColorPalette -> Color add aria attributes in order to announce state of color buttons for screen reader users
77
+ - [`add1e51d5a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/add1e51d5a9) - EDM-2510: Fix media inline insertion behaviour when inside empty list item
78
+ - [`529d612d6e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/529d612d6e5) - ED-11474 fixed incorrect table header heights caused by empty column width, and sticky header flicker effect
79
+ - [`320ad93b5b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/320ad93b5b0) - [ux] ED-13305: Fix bug where clear formatting button incorrectly appeared to be disabled (despite clear formatting action being valid operation).
80
+ - [`39faad06953`](https://bitbucket.org/atlassian/atlassian-frontend/commits/39faad06953) - ED-10312 adds analytics event for tables with negative colspans or rowspans
81
+ - [`fe8e5ca9a92`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe8e5ca9a92) - [ux] MediaInline package now correctly shows a border around it upon being selected
82
+ - [`8f0577e0eb1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f0577e0eb1) - [ux] Promoted captions to full schema and better support of wikimarkup, email and slack renderer
83
+ - [`22b53432054`](https://bitbucket.org/atlassian/atlassian-frontend/commits/22b53432054) - AK-560 Update color of the clear link button
84
+ - [`f391c63f5d5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f391c63f5d5) - AK-704: AltText - changes for better screen reader announcing
85
+ - [`f461edcfd05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f461edcfd05) - Update CardLoader to use react-loadable
86
+ Add SSR feature prop to be passed in renderer and media card
87
+ - [`4264bd36d32`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4264bd36d32) - Update mobile bridge media inline feature flag and add tests
88
+ - [`5abd27cbb9c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5abd27cbb9c) - AK-246: Table --> Cell options: provide an aria-label attr for the CellOptions button, provide role=menu for the CellOption menu and role=menuitems for its items
89
+ - [`9d43feb1f6a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d43feb1f6a) - CETI-167 Remove opacity for panels in dark mode.
90
+ - [`61c17fa38a5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61c17fa38a5) - move waitForFloatingControl to VR package
91
+ - Updated dependencies
92
+
93
+ ## 151.3.0
94
+
95
+ ### Minor Changes
96
+
97
+ - [`08348b6692c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/08348b6692c) - Update CodeBlockOptions to have appearance prop optional
98
+
99
+ ## 151.2.1
100
+
101
+ ### Patch Changes
102
+
103
+ - [`69fc91803d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/69fc91803d4) - [ux] Find and replace tooltip now icons are now correctly aligned and does not have a scrollbar showing up.
104
+
105
+ ## 151.2.0
106
+
107
+ ### Minor Changes
108
+
109
+ - [`db3477abb18`](https://bitbucket.org/atlassian/atlassian-frontend/commits/db3477abb18) - [ux] ED-13938 disabled code-bidi warning tooltip for mobile, reworked TextWrapper to fix bidi mitigation, and fixed issue where bidi warnings were not presented when renderer used with an annotation provider with draftMode set to true
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies
114
+
3
115
  ## 151.1.2
4
116
 
5
117
  ### Patch Changes
@@ -539,8 +539,30 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
539
539
  transformer: _this.contentTransformer
540
540
  });
541
541
 
542
+ if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
543
+ _this.focusTimeoutId = handleEditorFocus(view);
544
+ }
545
+
542
546
  if (_this.featureFlags.ufo) {
547
+ _this.experienceStore = _ufo.ExperienceStore.getInstance(view);
548
+
549
+ _this.experienceStore.start(_ufo.EditorExperience.editSession);
550
+
551
+ _this.experienceStore.addMetadata(_ufo.EditorExperience.editSession, {
552
+ reliabilityInterval: _ufo.RELIABILITY_INTERVAL
553
+ });
554
+
543
555
  _this.reliabilityInterval = window.setInterval(function () {
556
+ var _this$experienceStore11, _this$experienceStore12;
557
+
558
+ (_this$experienceStore11 = _this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : (_this$experienceStore12 = _this$experienceStore11.success(_ufo.EditorExperience.editSession)) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.finally(function () {
559
+ var _this$experienceStore13, _this$experienceStore14;
560
+
561
+ (_this$experienceStore13 = _this.experienceStore) === null || _this$experienceStore13 === void 0 ? void 0 : _this$experienceStore13.start(_ufo.EditorExperience.editSession);
562
+ (_this$experienceStore14 = _this.experienceStore) === null || _this$experienceStore14 === void 0 ? void 0 : _this$experienceStore14.addMetadata(_ufo.EditorExperience.editSession, {
563
+ reliabilityInterval: _ufo.RELIABILITY_INTERVAL
564
+ });
565
+ });
544
566
  var reliabilityEvent = {
545
567
  action: _analytics.ACTION.UFO_SESSION_COMPLETE,
546
568
  actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
@@ -552,14 +574,6 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
552
574
 
553
575
  _this.dispatchAnalyticsEvent(reliabilityEvent);
554
576
  }, _ufo.RELIABILITY_INTERVAL);
555
- }
556
-
557
- if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
558
- _this.focusTimeoutId = handleEditorFocus(view);
559
- }
560
-
561
- if (_this.featureFlags.ufo) {
562
- _this.experienceStore = _ufo.ExperienceStore.getInstance(view);
563
577
  } // Force React to re-render so consumers get a reference to the editor view
564
578
 
565
579
 
@@ -115,7 +115,8 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
115
115
  },
116
116
  cardOptions: props.smartLinks || props.UNSAFE_cards,
117
117
  codeBlock: _objectSpread(_objectSpread({}, props.codeBlock), {}, {
118
- useLongPressSelection: false
118
+ useLongPressSelection: false,
119
+ appearance: props.appearance
119
120
  })
120
121
  };
121
122
  }
@@ -128,8 +129,6 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
128
129
 
129
130
 
130
131
  function createPluginsList(props, prevProps, createAnalyticsEvent) {
131
- var _props$featureFlags;
132
-
133
132
  var appearance = props.appearance;
134
133
  var isMobile = appearance === 'mobile';
135
134
  var isComment = appearance === 'comment';
@@ -297,8 +296,8 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
297
296
  if (props.allowPanel) {
298
297
  preset.add([_plugins.panelPlugin, {
299
298
  useLongPressSelection: false,
300
- UNSAFE_allowCustomPanel: props.allowPanel.UNSAFE_allowCustomPanel,
301
- UNSAFE_allowCustomPanelEdit: props.allowPanel.UNSAFE_allowCustomPanelEdit
299
+ allowCustomPanel: props.allowPanel.allowCustomPanel,
300
+ allowCustomPanelEdit: props.allowPanel.allowCustomPanelEdit
302
301
  }]);
303
302
  }
304
303
 
@@ -395,26 +394,46 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
395
394
  replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
396
395
  }]);
397
396
 
398
- if (((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.showAvatarGroupAsPlugin) === true) {
397
+ var hasBeforePrimaryToolbar = function hasBeforePrimaryToolbar(components) {
398
+ if (components && 'before' in components) {
399
+ return !!components.before;
400
+ }
401
+
402
+ return false;
403
+ };
404
+
405
+ if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
406
+ preset.add([_plugins.beforePrimaryToolbarPlugin, {
407
+ beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
408
+ }]);
409
+ }
410
+
411
+ if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
399
412
  preset.add([_plugins.avatarGroupPlugin, {
400
- collabEdit: props.collabEdit
413
+ collabEdit: props.collabEdit,
414
+ takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
401
415
  }]);
402
416
  }
403
417
 
404
418
  if (props.allowFindReplace) {
405
- var _props$featureFlags2;
406
-
407
419
  preset.add([_plugins.findReplacePlugin, {
408
- takeFullWidth: !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.showAvatarGroupAsPlugin) === false
420
+ takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
421
+ twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
409
422
  }]);
410
423
  }
411
424
 
425
+ if (props.UNSAFE_allowFragmentMark) {
426
+ preset.add(_plugins.fragmentMarkPlugin);
427
+ }
428
+
412
429
  if (featureFlags.enableViewUpdateSubscription) {
413
430
  preset.add([_plugins.viewUpdateSubscriptionPlugin]);
414
431
  }
415
432
 
416
433
  if (featureFlags.codeBidiWarnings) {
417
- preset.add(_plugins.codeBidiWarningPlugin);
434
+ preset.add([_plugins.codeBidiWarningPlugin, {
435
+ appearance: props.appearance
436
+ }]);
418
437
  }
419
438
 
420
439
  var excludes = new Set();
@@ -46,8 +46,7 @@ function useCXHTMLPreset(_ref) {
46
46
  }
47
47
  }]);
48
48
  preset.add([_plugins.panelPlugin, {
49
- UNSAFE_allowCustomPanel: true,
50
- UNSAFE_allowCustomPanelEdit: true
49
+ allowCustomPanel: true
51
50
  }]);
52
51
  preset.add(_plugins.listPlugin);
53
52
  preset.add(_plugins.textColorPlugin);
@@ -99,7 +99,9 @@ function createDefaultPreset(options) {
99
99
  preset.add(_floatingToolbar.default);
100
100
  preset.add([_featureFlagsContext.default, options.featureFlags || {}]);
101
101
  preset.add([_selection.default, options.selection]);
102
- preset.add([_codeBlock.default, options.codeBlock]);
102
+ preset.add([_codeBlock.default, options.codeBlock || {
103
+ appearance: 'full-page'
104
+ }]);
103
105
  return preset;
104
106
  }
105
107
 
@@ -191,10 +191,10 @@ var ReactNodeView = /*#__PURE__*/function () {
191
191
  }
192
192
  }, {
193
193
  key: "update",
194
- value: function update(node, _decorations) {
194
+ value: function update(node, _decorations, _innerDecorations) {
195
195
  var _this4 = this;
196
196
 
197
- var validUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {
197
+ var validUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
198
198
  return true;
199
199
  };
200
200
  // @see https://github.com/ProseMirror/prosemirror/issues/648
@@ -108,6 +108,12 @@ var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
108
108
  to = _this$view$state$sele2.to;
109
109
  return _this.isSelectedNode(_this.view.state.selection) || _this.isSelectionInsideNode(from, to);
110
110
  });
111
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "nodeInsideSelection", function () {
112
+ var selection = _this.view.state.selection;
113
+ var from = selection.from,
114
+ to = selection.to;
115
+ return _this.isSelectedNode(selection) || _this.isNodeInsideSelection(from, to);
116
+ });
111
117
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSelectionChange", function () {
112
118
  _this.update(_this.node, []);
113
119
  });
@@ -63,6 +63,7 @@ exports.ACTION = ACTION;
63
63
  ACTION["INITIALISED"] = "initialised";
64
64
  ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
65
65
  ACTION["INSERTED"] = "inserted";
66
+ ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
66
67
  ACTION["INVOKED"] = "invoked";
67
68
  ACTION["LANGUAGE_SELECTED"] = "languageSelected";
68
69
  ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getSelectionPositions = getSelectionPositions;
7
- exports.hasWhitespaceNode = hasWhitespaceNode;
7
+ exports.hasInvalidWhitespaceNode = hasInvalidWhitespaceNode;
8
8
  exports.hasAnnotationMark = hasAnnotationMark;
9
9
  exports.annotationExists = annotationExists;
10
10
  exports.containsAnyAnnotations = containsAnyAnnotations;
@@ -316,7 +316,7 @@ var isSelectionValid = function isSelectionValid(state) {
316
316
  return _types.AnnotationSelectionType.DISABLED;
317
317
  }
318
318
 
319
- if (disallowOnWhitespace && hasWhitespaceNode(selection)) {
319
+ if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
320
320
  return _types.AnnotationSelectionType.INVALID;
321
321
  }
322
322
 
@@ -372,16 +372,27 @@ function isEmptyTextSelection(selection, schema) {
372
372
  */
373
373
 
374
374
 
375
- function hasWhitespaceNode(selection) {
376
- var foundWhitespace = false;
377
- selection.content().content.descendants(function (node) {
375
+ function hasInvalidWhitespaceNode(selection) {
376
+ var foundInvalidWhitespace = false;
377
+ var content = selection.content().content;
378
+ content.descendants(function (node) {
378
379
  if (node.textContent.trim() === '') {
379
- foundWhitespace = true;
380
+ // Trailing new lines do not result in the annotation spanning into
381
+ // the trailing new line so can be ignored when looking for invalid
382
+ // whitespace nodes.
383
+ var nodeIsTrailingNewLine = // it is the final node
384
+ node.eq(content.lastChild) && // and there are multiple nodes
385
+ !node.eq(content.firstChild) && // and it is a paragraph node
386
+ node.type.name === 'paragraph';
387
+
388
+ if (!nodeIsTrailingNewLine) {
389
+ foundInvalidWhitespace = true;
390
+ }
380
391
  }
381
392
 
382
- return !foundWhitespace;
393
+ return !foundInvalidWhitespace;
383
394
  });
384
- return foundWhitespace;
395
+ return foundInvalidWhitespace;
385
396
  }
386
397
  /*
387
398
  * verifies if node contains annotation mark
@@ -27,7 +27,8 @@ var avatarGroup = function avatarGroup(props) {
27
27
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
28
28
  editorView: editorView,
29
29
  eventDispatcher: eventDispatcher,
30
- collabEdit: props.collabEdit
30
+ collabEdit: props.collabEdit,
31
+ takeFullWidth: props.takeFullWidth
31
32
  });
32
33
  }
33
34
  };
@@ -25,7 +25,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
- var ToolbarButtonWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])));
28
+ var ToolbarButtonWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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) {
29
+ return props.takeFullWidth ? 1 : 0;
30
+ });
29
31
 
30
32
  var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
31
33
  var dispatchAnalyticsEvent = props.dispatchAnalyticsEvent;
@@ -43,7 +45,8 @@ var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
43
45
  }, [dispatchAnalyticsEvent]);
44
46
  return /*#__PURE__*/_react.default.createElement(ToolbarButtonWrapper, {
45
47
  "aria-label": "Editors",
46
- "data-testid": 'avatar-group-in-plugin'
48
+ "data-testid": 'avatar-group-in-plugin',
49
+ takeFullWidth: props.takeFullWidth
47
50
  }, /*#__PURE__*/_react.default.createElement(_avatarsWithPluginState.default, {
48
51
  editorView: props.editorView,
49
52
  eventDispatcher: props.eventDispatcher,
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _BeforePrimaryToolbarWrapper = require("./ui/BeforePrimaryToolbarWrapper");
13
+
14
+ var beforePrimaryToolbar = function beforePrimaryToolbar(props) {
15
+ return {
16
+ name: 'beforePrimaryToolbar',
17
+ primaryToolbarComponent: function primaryToolbarComponent() {
18
+ return /*#__PURE__*/_react.default.createElement(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
19
+ beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
20
+ });
21
+ }
22
+ };
23
+ };
24
+
25
+ var _default = beforePrimaryToolbar;
26
+ exports.default = _default;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.BeforePrimaryToolbarWrapper = exports.BeforePrimaryToolbarPluginWrapper = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
+
16
+ var _templateObject;
17
+
18
+ var BeforePrimaryToolbarPluginWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-right: 8px;\n flex-grow: 1;\n justify-content: flex-end;\n align-items: center;\n"])));
19
+
20
+ exports.BeforePrimaryToolbarPluginWrapper = BeforePrimaryToolbarPluginWrapper;
21
+
22
+ var BeforePrimaryToolbarWrapper = function BeforePrimaryToolbarWrapper(props) {
23
+ return /*#__PURE__*/_react.default.createElement(BeforePrimaryToolbarPluginWrapper, {
24
+ "data-testid": 'before-primary-toolbar-components-plugin'
25
+ }, props.beforePrimaryToolbarComponents);
26
+ };
27
+
28
+ exports.BeforePrimaryToolbarWrapper = BeforePrimaryToolbarWrapper;
@@ -7,14 +7,17 @@ exports.default = void 0;
7
7
 
8
8
  var _main = require("./pm-plugins/main");
9
9
 
10
- var codeBidiWarning = function codeBidiWarning() {
10
+ var codeBidiWarning = function codeBidiWarning(_ref) {
11
+ var appearance = _ref.appearance;
11
12
  return {
12
13
  name: 'codeBidiWarning',
13
14
  pmPlugins: function pmPlugins() {
14
15
  return [{
15
16
  name: 'codeBidiWarning',
16
17
  plugin: function plugin(options) {
17
- return (0, _main.createPlugin)(options);
18
+ return (0, _main.createPlugin)(options, {
19
+ appearance: appearance
20
+ });
18
21
  }
19
22
  }];
20
23
  }
@@ -13,20 +13,29 @@ var _pluginKey = require("../plugin-key");
13
13
 
14
14
  var _pluginFactory = require("./plugin-factory");
15
15
 
16
- var createPlugin = function createPlugin(_ref) {
16
+ var createPlugin = function createPlugin(_ref, _ref2) {
17
17
  var dispatch = _ref.dispatch,
18
18
  reactContext = _ref.reactContext;
19
+ var appearance = _ref2.appearance;
19
20
  var intl = reactContext().intl;
20
21
  var codeBidiWarningLabel = intl.formatMessage(_messages.codeBidiWarningMessages.label);
21
22
  return new _prosemirrorState.Plugin({
22
23
  key: _pluginKey.codeBidiWarningPluginKey,
23
24
  state: (0, _pluginFactory.createPluginState)(dispatch, function (state) {
25
+ // The appearance being mobile indicates we are in an editor being
26
+ // rendered by mobile bridge in a web view.
27
+ // The tooltip is likely to have unexpected behaviour there, with being cut
28
+ // off, so we disable it. This is also to keep the behaviour consistent with
29
+ // the rendering in the mobile Native Renderer.
30
+ var tooltipEnabled = appearance !== 'mobile';
24
31
  return {
25
32
  decorationSet: (0, _pluginFactory.createBidiWarningsDecorationSetFromDoc)({
26
33
  doc: state.doc,
27
- codeBidiWarningLabel: codeBidiWarningLabel
34
+ codeBidiWarningLabel: codeBidiWarningLabel,
35
+ tooltipEnabled: tooltipEnabled
28
36
  }),
29
- codeBidiWarningLabel: codeBidiWarningLabel
37
+ codeBidiWarningLabel: codeBidiWarningLabel,
38
+ tooltipEnabled: tooltipEnabled
30
39
  };
31
40
  }),
32
41
  props: {
@@ -40,7 +40,8 @@ var _pluginFactory = (0, _pluginStateFactory.pluginFactory)(_pluginKey.codeBidiW
40
40
 
41
41
  var newBidiWarningsDecorationSet = createBidiWarningsDecorationSetFromDoc({
42
42
  doc: tr.doc,
43
- codeBidiWarningLabel: pluginState.codeBidiWarningLabel
43
+ codeBidiWarningLabel: pluginState.codeBidiWarningLabel,
44
+ tooltipEnabled: pluginState.tooltipEnabled
44
45
  });
45
46
  return _objectSpread(_objectSpread({}, pluginState), {}, {
46
47
  decorationSet: newBidiWarningsDecorationSet
@@ -55,7 +56,8 @@ exports.createPluginState = createPluginState;
55
56
 
56
57
  function createBidiWarningsDecorationSetFromDoc(_ref) {
57
58
  var doc = _ref.doc,
58
- codeBidiWarningLabel = _ref.codeBidiWarningLabel;
59
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel,
60
+ tooltipEnabled = _ref.tooltipEnabled;
59
61
  var bidiCharactersAndTheirPositions = [];
60
62
  doc.descendants(function (node, pos) {
61
63
  var isTextWithCodeMark = node.type.name === 'text' && node.marks && node.marks.some(function (mark) {
@@ -97,21 +99,29 @@ function createBidiWarningsDecorationSetFromDoc(_ref) {
97
99
  var position = _ref4.position,
98
100
  bidiCharacter = _ref4.bidiCharacter;
99
101
  return _prosemirrorView.Decoration.widget(position, function () {
100
- return renderDOM(bidiCharacter, codeBidiWarningLabel);
102
+ return renderDOM({
103
+ bidiCharacter: bidiCharacter,
104
+ codeBidiWarningLabel: codeBidiWarningLabel,
105
+ tooltipEnabled: tooltipEnabled
106
+ });
101
107
  });
102
108
  }));
103
109
 
104
110
  return newBidiWarningsDecorationSet;
105
111
  }
106
112
 
107
- function renderDOM(bidiCharacter, codeBidiWarningLabel) {
113
+ function renderDOM(_ref5) {
114
+ var bidiCharacter = _ref5.bidiCharacter,
115
+ codeBidiWarningLabel = _ref5.codeBidiWarningLabel,
116
+ tooltipEnabled = _ref5.tooltipEnabled;
108
117
  var element = document.createElement('span'); // Note: we use this pattern elsewhere (see highlighting code block, and drop cursor widget decoration)
109
118
  // we should investigate if there is a memory leak with such usage.
110
119
 
111
120
  _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_bidiWarning.default, {
112
121
  bidiCharacter: bidiCharacter,
113
122
  skipChildren: true,
114
- label: codeBidiWarningLabel
123
+ label: codeBidiWarningLabel,
124
+ tooltipEnabled: tooltipEnabled
115
125
  }), element);
116
126
 
117
127
  return element;
@@ -27,8 +27,7 @@ var _messages = require("../block-type/messages");
27
27
 
28
28
  var _refreshBrowserSelection = _interopRequireDefault(require("./refresh-browser-selection"));
29
29
 
30
- var codeBlockPlugin = function codeBlockPlugin() {
31
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
30
+ var codeBlockPlugin = function codeBlockPlugin(options) {
32
31
  return {
33
32
  name: 'codeBlock',
34
33
  nodes: function nodes() {
@@ -44,7 +43,8 @@ var codeBlockPlugin = function codeBlockPlugin() {
44
43
  var reactContext = _ref.reactContext;
45
44
  return (0, _main.createPlugin)({
46
45
  useLongPressSelection: options.useLongPressSelection,
47
- reactContext: reactContext
46
+ reactContext: reactContext,
47
+ appearance: options.appearance
48
48
  });
49
49
  }
50
50
  }, {
@@ -133,7 +133,8 @@ var CodeBlockView = /*#__PURE__*/function () {
133
133
  language: node.attrs.language,
134
134
  showLineNumbers: false,
135
135
  codeBidiWarnings: this.codeBidiWarningOptions.enabled,
136
- codeBidiWarningLabel: this.codeBidiWarningOptions.label
136
+ codeBidiWarningLabel: this.codeBidiWarningOptions.label,
137
+ codeBidiWarningTooltipEnabled: this.codeBidiWarningOptions.tooltipEnabled
137
138
  }), highlighting);
138
139
 
139
140
  this.measure(performance.now() - start);
@@ -180,11 +181,13 @@ exports.CodeBlockView = CodeBlockView;
180
181
 
181
182
  var highlightingCodeBlockNodeView = function highlightingCodeBlockNodeView(_ref) {
182
183
  var codeBidiWarnings = _ref.codeBidiWarnings,
183
- codeBidiWarningLabel = _ref.codeBidiWarningLabel;
184
+ codeBidiWarningLabel = _ref.codeBidiWarningLabel,
185
+ codeBidiWarningTooltipEnabled = _ref.codeBidiWarningTooltipEnabled;
184
186
  return function (node, view, getPos) {
185
187
  return new CodeBlockView(node, view, getPos, {
188
+ label: codeBidiWarningLabel,
186
189
  enabled: codeBidiWarnings,
187
- label: codeBidiWarningLabel
190
+ tooltipEnabled: codeBidiWarningTooltipEnabled
188
191
  });
189
192
  };
190
193
  };
@@ -36,7 +36,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
36
36
  var createPlugin = function createPlugin(_ref) {
37
37
  var _ref$useLongPressSele = _ref.useLongPressSelection,
38
38
  useLongPressSelection = _ref$useLongPressSele === void 0 ? false : _ref$useLongPressSele,
39
- reactContext = _ref.reactContext;
39
+ reactContext = _ref.reactContext,
40
+ appearance = _ref.appearance;
40
41
  var intl = reactContext().intl;
41
42
  var codeBidiWarningLabel = intl.formatMessage(_messages.codeBidiWarningMessages.label);
42
43
  return new _prosemirrorState.Plugin({
@@ -76,10 +77,17 @@ var createPlugin = function createPlugin(_ref) {
76
77
  props: {
77
78
  nodeViews: {
78
79
  codeBlock: function codeBlock(node, view, getPos) {
79
- var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(view.state);
80
+ var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(view.state); // The appearance being mobile indicates we are in an editor being
81
+ // rendered by mobile bridge in a web view.
82
+ // The tooltip is likely to have unexpected behaviour there, with being cut
83
+ // off, so we disable it. This is also to keep the behaviour consistent with
84
+ // the rendering in the mobile Native Renderer.
85
+
86
+ var codeBidiWarningTooltipEnabled = appearance !== 'mobile';
80
87
  var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? (0, _highlightingCodeBlock.highlightingCodeBlockNodeView)({
81
88
  codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
82
- codeBidiWarningLabel: codeBidiWarningLabel
89
+ codeBidiWarningLabel: codeBidiWarningLabel,
90
+ codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
83
91
  }) : (0, _codeBlock.codeBlockNodeView)();
84
92
  return createCodeBlockNodeView(node, view, getPos);
85
93
  }