@atlaskit/editor-core 166.0.3 → 167.0.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 (554) hide show
  1. package/.eslintrc.js +46 -1
  2. package/CHANGELOG.md +99 -0
  3. package/dist/cjs/actions/index.js +26 -2
  4. package/dist/cjs/create-editor/ReactEditorView.js +2 -0
  5. package/dist/cjs/create-editor/create-plugins-list.js +1 -2
  6. package/dist/cjs/editor.js +5 -2
  7. package/dist/cjs/keymaps/index.js +5 -1
  8. package/dist/cjs/labs/next/ContentComponents.js +8 -4
  9. package/dist/cjs/labs/next/full-page.js +14 -8
  10. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +7 -3
  11. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +3 -1
  12. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -1
  13. package/dist/cjs/plugins/analytics/types/enums.js +3 -0
  14. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
  15. package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +0 -1
  16. package/dist/cjs/plugins/base/index.js +8 -17
  17. package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
  18. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
  19. package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
  20. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
  21. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
  22. package/dist/cjs/plugins/card/styles.js +1 -1
  23. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  24. package/dist/cjs/plugins/code-block/actions.js +36 -2
  25. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
  26. package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
  27. package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
  28. package/dist/cjs/plugins/code-block/styles.js +28 -24
  29. package/dist/cjs/plugins/collab-edit/index.js +2 -2
  30. package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
  31. package/dist/cjs/plugins/collab-edit/styles.js +4 -2
  32. package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
  33. package/dist/cjs/plugins/collab-edit/utils.js +1 -0
  34. package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
  35. package/dist/cjs/plugins/expand/ui/styles.js +16 -14
  36. package/dist/cjs/plugins/extension/commands.js +3 -2
  37. package/dist/cjs/plugins/extension/context-panel.js +23 -9
  38. package/dist/cjs/plugins/extension/plugin-factory.js +1 -4
  39. package/dist/cjs/plugins/extension/pm-plugins/main.js +13 -36
  40. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
  41. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
  42. package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
  43. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
  44. package/dist/cjs/plugins/extension/utils.js +12 -57
  45. package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
  46. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  47. package/dist/cjs/plugins/feedback-dialog/index.js +0 -1
  48. package/dist/cjs/plugins/find-replace/styles.js +2 -6
  49. package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
  50. package/dist/cjs/plugins/find-replace/utils/batch-decorations.js +0 -1
  51. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
  52. package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
  53. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
  54. package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
  55. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
  56. package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
  57. package/dist/cjs/plugins/grid/styles.js +3 -1
  58. package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
  59. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
  60. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
  61. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -5
  62. package/dist/cjs/plugins/hyperlink/utils.js +53 -2
  63. package/dist/cjs/plugins/insert-block/index.js +1 -1
  64. package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
  65. package/dist/cjs/plugins/layout/styles.js +1 -1
  66. package/dist/cjs/plugins/macro/actions.js +2 -2
  67. package/dist/cjs/plugins/media/commands/helpers.js +10 -9
  68. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +25 -6
  69. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
  70. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  71. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
  72. package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
  73. package/dist/cjs/plugins/media/styles.js +1 -1
  74. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
  75. package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
  76. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
  77. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  78. package/dist/cjs/plugins/mentions/styles.js +3 -1
  79. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
  80. package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
  81. package/dist/cjs/plugins/panel/index.js +1 -0
  82. package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
  83. package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
  84. package/dist/cjs/plugins/paste/handlers.js +23 -0
  85. package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
  86. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
  87. package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
  88. package/dist/cjs/plugins/placeholder/index.js +15 -3
  89. package/dist/cjs/plugins/placeholder/styles.js +3 -1
  90. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  91. package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
  92. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  93. package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
  94. package/dist/cjs/plugins/table/index.js +14 -4
  95. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
  96. package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
  97. package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
  98. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
  99. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  100. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  101. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  102. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  103. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  104. package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
  105. package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
  106. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
  107. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
  108. package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
  109. package/dist/cjs/plugins/table/ui/consts.js +14 -11
  110. package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
  111. package/dist/cjs/plugins/table/utils/decoration.js +3 -4
  112. package/dist/cjs/plugins/table/utils/paste.js +9 -9
  113. package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  114. package/dist/cjs/plugins/type-ahead/index.js +4 -3
  115. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
  116. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  117. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
  118. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
  119. package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
  120. package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
  121. package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
  122. package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
  123. package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
  124. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
  125. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
  126. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  127. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  128. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
  129. package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
  130. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +23 -16
  131. package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  132. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
  133. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
  134. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
  135. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
  136. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
  137. package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
  138. package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
  139. package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
  140. package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
  141. package/dist/cjs/ui/ContentStyles/index.js +4 -2
  142. package/dist/cjs/ui/ContextPanel/index.js +3 -1
  143. package/dist/cjs/ui/DropdownMenu/index.js +5 -0
  144. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
  145. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
  146. package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
  147. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  148. package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
  149. package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
  150. package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
  151. package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
  152. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
  153. package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
  154. package/dist/cjs/ui/PluginSlot/index.js +7 -4
  155. package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
  156. package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
  157. package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
  158. package/dist/cjs/ui/WithFlash/index.js +4 -2
  159. package/dist/cjs/ui/styles.js +6 -4
  160. package/dist/cjs/utils/document.js +62 -6
  161. package/dist/cjs/utils/filter/privacy-filter.js +2 -2
  162. package/dist/cjs/utils/step.js +17 -1
  163. package/dist/cjs/version-wrapper.js +1 -1
  164. package/dist/cjs/version.json +1 -1
  165. package/dist/es2019/actions/index.js +25 -1
  166. package/dist/es2019/create-editor/ReactEditorView.js +2 -0
  167. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  168. package/dist/es2019/editor.js +5 -2
  169. package/dist/es2019/keymaps/index.js +5 -1
  170. package/dist/es2019/labs/next/ContentComponents.js +7 -2
  171. package/dist/es2019/labs/next/full-page.js +11 -8
  172. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
  173. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
  174. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  175. package/dist/es2019/plugins/analytics/types/enums.js +3 -0
  176. package/dist/es2019/plugins/base/index.js +6 -15
  177. package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
  178. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  179. package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
  180. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  181. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
  182. package/dist/es2019/plugins/card/styles.js +1 -1
  183. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  184. package/dist/es2019/plugins/code-block/actions.js +32 -0
  185. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
  186. package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
  187. package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
  188. package/dist/es2019/plugins/code-block/styles.js +30 -27
  189. package/dist/es2019/plugins/collab-edit/styles.js +3 -2
  190. package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
  191. package/dist/es2019/plugins/collab-edit/utils.js +1 -0
  192. package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
  193. package/dist/es2019/plugins/expand/ui/styles.js +15 -14
  194. package/dist/es2019/plugins/extension/commands.js +3 -2
  195. package/dist/es2019/plugins/extension/context-panel.js +11 -3
  196. package/dist/es2019/plugins/extension/plugin-factory.js +1 -3
  197. package/dist/es2019/plugins/extension/pm-plugins/main.js +12 -38
  198. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  199. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  200. package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
  201. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
  202. package/dist/es2019/plugins/extension/utils.js +2 -37
  203. package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
  204. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  205. package/dist/es2019/plugins/find-replace/styles.js +4 -4
  206. package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
  207. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  208. package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  209. package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
  210. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
  211. package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
  212. package/dist/es2019/plugins/grid/styles.js +4 -2
  213. package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
  214. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  215. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  216. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
  217. package/dist/es2019/plugins/hyperlink/utils.js +43 -2
  218. package/dist/es2019/plugins/insert-block/index.js +1 -1
  219. package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
  220. package/dist/es2019/plugins/layout/styles.js +10 -7
  221. package/dist/es2019/plugins/media/commands/helpers.js +6 -8
  222. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
  223. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
  224. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
  225. package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
  226. package/dist/es2019/plugins/media/styles.js +3 -3
  227. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  228. package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
  229. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  230. package/dist/es2019/plugins/mentions/styles.js +5 -4
  231. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
  232. package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
  233. package/dist/es2019/plugins/panel/index.js +1 -0
  234. package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
  235. package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
  236. package/dist/es2019/plugins/paste/handlers.js +23 -0
  237. package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
  238. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
  239. package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
  240. package/dist/es2019/plugins/placeholder/index.js +12 -1
  241. package/dist/es2019/plugins/placeholder/styles.js +3 -1
  242. package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
  243. package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
  244. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  245. package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
  246. package/dist/es2019/plugins/table/index.js +13 -4
  247. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
  248. package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
  249. package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
  250. package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
  251. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  252. package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
  253. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
  254. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  255. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  256. package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
  257. package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
  258. package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
  259. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
  260. package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
  261. package/dist/es2019/plugins/table/ui/consts.js +15 -12
  262. package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
  263. package/dist/es2019/plugins/table/utils/decoration.js +1 -4
  264. package/dist/es2019/plugins/table/utils/paste.js +9 -9
  265. package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  266. package/dist/es2019/plugins/type-ahead/index.js +4 -3
  267. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  268. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  269. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  270. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
  271. package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
  272. package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
  273. package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
  274. package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
  275. package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
  276. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
  277. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
  278. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  279. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  280. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
  281. package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
  282. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
  283. package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  284. package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  285. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  286. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
  287. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  288. package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  289. package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
  290. package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
  291. package/dist/es2019/ui/ContentStyles/index.js +3 -2
  292. package/dist/es2019/ui/ContextPanel/index.js +2 -1
  293. package/dist/es2019/ui/DropdownMenu/index.js +5 -0
  294. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
  295. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  296. package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
  297. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  298. package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  299. package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  300. package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
  301. package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
  302. package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
  303. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
  304. package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
  305. package/dist/es2019/ui/PluginSlot/index.js +7 -4
  306. package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
  307. package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  308. package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
  309. package/dist/es2019/ui/WithFlash/index.js +4 -3
  310. package/dist/es2019/ui/styles.js +10 -9
  311. package/dist/es2019/utils/document.js +58 -5
  312. package/dist/es2019/utils/filter/privacy-filter.js +1 -1
  313. package/dist/es2019/utils/step.js +12 -1
  314. package/dist/es2019/version-wrapper.js +1 -1
  315. package/dist/es2019/version.json +1 -1
  316. package/dist/esm/actions/index.js +27 -2
  317. package/dist/esm/create-editor/ErrorBoundary.js +1 -1
  318. package/dist/esm/create-editor/ReactEditorView.js +2 -0
  319. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  320. package/dist/esm/editor.js +6 -4
  321. package/dist/esm/keymaps/index.js +5 -1
  322. package/dist/esm/labs/next/ContentComponents.js +8 -4
  323. package/dist/esm/labs/next/full-page.js +11 -8
  324. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
  325. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
  326. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  327. package/dist/esm/plugins/analytics/types/enums.js +3 -0
  328. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  329. package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +0 -1
  330. package/dist/esm/plugins/base/index.js +8 -17
  331. package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
  332. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  333. package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
  334. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  335. package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
  336. package/dist/esm/plugins/card/styles.js +1 -1
  337. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  338. package/dist/esm/plugins/code-block/actions.js +28 -0
  339. package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
  340. package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
  341. package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
  342. package/dist/esm/plugins/code-block/styles.js +27 -23
  343. package/dist/esm/plugins/collab-edit/index.js +1 -1
  344. package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
  345. package/dist/esm/plugins/collab-edit/styles.js +3 -2
  346. package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
  347. package/dist/esm/plugins/collab-edit/utils.js +2 -0
  348. package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
  349. package/dist/esm/plugins/custom-autoformat/index.js +1 -1
  350. package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
  351. package/dist/esm/plugins/expand/ui/styles.js +15 -14
  352. package/dist/esm/plugins/extension/actions.js +1 -1
  353. package/dist/esm/plugins/extension/commands.js +3 -2
  354. package/dist/esm/plugins/extension/context-panel.js +22 -8
  355. package/dist/esm/plugins/extension/plugin-factory.js +1 -3
  356. package/dist/esm/plugins/extension/pm-plugins/main.js +12 -35
  357. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  358. package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
  359. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  360. package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
  361. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
  362. package/dist/esm/plugins/extension/utils.js +9 -51
  363. package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
  364. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  365. package/dist/esm/plugins/feedback-dialog/index.js +1 -2
  366. package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
  367. package/dist/esm/plugins/find-replace/styles.js +3 -3
  368. package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
  369. package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -2
  370. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  371. package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  372. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
  373. package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
  374. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
  375. package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
  376. package/dist/esm/plugins/grid/styles.js +2 -1
  377. package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
  378. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  379. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  380. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  381. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -5
  382. package/dist/esm/plugins/hyperlink/utils.js +44 -2
  383. package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
  384. package/dist/esm/plugins/insert-block/index.js +1 -1
  385. package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
  386. package/dist/esm/plugins/layout/styles.js +1 -1
  387. package/dist/esm/plugins/macro/actions.js +1 -1
  388. package/dist/esm/plugins/media/commands/helpers.js +6 -8
  389. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
  390. package/dist/esm/plugins/media/nodeviews/mediaInline.js +23 -6
  391. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
  392. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +8 -1
  393. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  394. package/dist/esm/plugins/media/picker-facade.js +1 -1
  395. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
  396. package/dist/esm/plugins/media/pm-plugins/main.js +3 -1
  397. package/dist/esm/plugins/media/styles.js +1 -1
  398. package/dist/esm/plugins/media/toolbar/utils.js +1 -1
  399. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  400. package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
  401. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  402. package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
  403. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
  404. package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
  405. package/dist/esm/plugins/mentions/styles.js +2 -1
  406. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
  407. package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
  408. package/dist/esm/plugins/panel/index.js +1 -0
  409. package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
  410. package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
  411. package/dist/esm/plugins/paste/handlers.js +22 -1
  412. package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
  413. package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
  414. package/dist/esm/plugins/paste/pm-plugins/main.js +28 -3
  415. package/dist/esm/plugins/placeholder/index.js +12 -1
  416. package/dist/esm/plugins/placeholder/styles.js +2 -1
  417. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  418. package/dist/esm/plugins/quick-insert/index.js +1 -1
  419. package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
  420. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  421. package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
  422. package/dist/esm/plugins/table/index.js +13 -4
  423. package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
  424. package/dist/esm/plugins/table/nodeviews/table.js +6 -2
  425. package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
  426. package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
  427. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  428. package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  429. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  430. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  431. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  432. package/dist/esm/plugins/table/transforms/column-width.js +1 -2
  433. package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
  434. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
  435. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
  436. package/dist/esm/plugins/table/ui/common-styles.js +4 -2
  437. package/dist/esm/plugins/table/ui/consts.js +15 -12
  438. package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
  439. package/dist/esm/plugins/table/utils/decoration.js +3 -4
  440. package/dist/esm/plugins/table/utils/paste.js +9 -9
  441. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
  442. package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  443. package/dist/esm/plugins/type-ahead/index.js +4 -3
  444. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  445. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  446. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  447. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
  448. package/dist/esm/plugins/unsupported-content/styles.js +1 -1
  449. package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
  450. package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
  451. package/dist/esm/ui/Appearance/Chromeless.js +2 -1
  452. package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
  453. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
  454. package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
  455. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  456. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  457. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
  458. package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
  459. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +22 -15
  460. package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  461. package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  462. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  463. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
  464. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
  465. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  466. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
  467. package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  468. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
  469. package/dist/esm/ui/ConfigPanel/Header.js +3 -2
  470. package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
  471. package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
  472. package/dist/esm/ui/ContentStyles/index.js +3 -2
  473. package/dist/esm/ui/ContextPanel/index.js +2 -1
  474. package/dist/esm/ui/DropdownMenu/index.js +5 -0
  475. package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
  476. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  477. package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
  478. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
  479. package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  480. package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  481. package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
  482. package/dist/esm/ui/ElementBrowser/constants.js +3 -1
  483. package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
  484. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
  485. package/dist/esm/ui/LinkSearch/index.js +1 -1
  486. package/dist/esm/ui/PanelTextInput/styles.js +4 -3
  487. package/dist/esm/ui/PluginSlot/index.js +7 -4
  488. package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
  489. package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  490. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  491. package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
  492. package/dist/esm/ui/WithFlash/index.js +3 -2
  493. package/dist/esm/ui/styles.js +5 -4
  494. package/dist/esm/utils/action.js +1 -1
  495. package/dist/esm/utils/clipboard.js +1 -1
  496. package/dist/esm/utils/document.js +59 -5
  497. package/dist/esm/utils/extensions.js +1 -1
  498. package/dist/esm/utils/filter/privacy-filter.js +1 -1
  499. package/dist/esm/utils/step.js +12 -1
  500. package/dist/esm/version-wrapper.js +1 -1
  501. package/dist/esm/version.json +1 -1
  502. package/dist/types/actions/index.d.ts +6 -0
  503. package/dist/types/labs/next/ContentComponents.d.ts +7 -1
  504. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
  505. package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
  506. package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
  507. package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
  508. package/dist/types/plugins/code-block/actions.d.ts +2 -0
  509. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
  510. package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
  511. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
  512. package/dist/types/plugins/extension/commands.d.ts +1 -1
  513. package/dist/types/plugins/extension/pm-plugins/main.d.ts +1 -2
  514. package/dist/types/plugins/extension/types.d.ts +1 -1
  515. package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
  516. package/dist/types/plugins/extension/utils.d.ts +1 -3
  517. package/dist/types/plugins/find-replace/styles.d.ts +0 -2
  518. package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
  519. package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
  520. package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
  521. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
  522. package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
  523. package/dist/types/plugins/paste/handlers.d.ts +1 -0
  524. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
  525. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  526. package/dist/types/plugins/table/index.d.ts +0 -1
  527. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
  528. package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
  529. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  530. package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  531. package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  532. package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
  533. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
  534. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  535. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
  536. package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
  537. package/dist/types/plugins/table/types.d.ts +0 -1
  538. package/dist/types/plugins/table/ui/consts.d.ts +9 -9
  539. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
  540. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
  541. package/dist/types/types/editor-appearance-component.d.ts +0 -1
  542. package/dist/types/types/editor-props.d.ts +4 -0
  543. package/dist/types/types/feature-flags.d.ts +8 -0
  544. package/dist/types/types/ui-components.d.ts +1 -0
  545. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
  546. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
  547. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
  548. package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
  549. package/dist/types/ui/PluginSlot/index.d.ts +1 -0
  550. package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
  551. package/dist/types/utils/document.d.ts +1 -0
  552. package/dist/types/utils/step.d.ts +1 -0
  553. package/docs/0-intro.tsx +12 -4
  554. package/package.json +22 -22
@@ -74,6 +74,8 @@ var _tinyMCE = require("../util/tinyMCE");
74
74
 
75
75
  var _utils9 = require("@atlaskit/editor-tables/utils");
76
76
 
77
+ var _step = require("../../../utils/step");
78
+
77
79
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
78
80
 
79
81
  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; }
@@ -238,8 +240,25 @@ function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinkificatio
238
240
  // don't add closeHistory call if we're pasting a text inside placeholder text as we want the whole action
239
241
  // to be atomic
240
242
  var placeholder = state.schema.nodes.placeholder;
243
+ var isPastingTextInsidePlaceholderText = ((_state$doc$resolve$no = state.doc.resolve(state.selection.$anchor.pos).nodeAfter) === null || _state$doc$resolve$no === void 0 ? void 0 : _state$doc$resolve$no.type) === placeholder; // don't add closeHistory call if we're pasting a table, as some tables may involve additional
244
+ // appendedTransactions to repair them (if they're partial or incomplete) and we don't want
245
+ // to split those repairing transactions in prosemirror-history when they're being added to the
246
+ // "done" stack
247
+
248
+ var isPastingTable = tr.steps.some(function (step) {
249
+ var _slice$content;
250
+
251
+ var slice = (0, _step.extractSliceFromStep)(step);
252
+ var tableExists = false;
253
+ slice === null || slice === void 0 ? void 0 : (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.forEach(function (node) {
254
+ if (node.type === state.schema.nodes.table) {
255
+ tableExists = true;
256
+ }
257
+ });
258
+ return tableExists;
259
+ });
241
260
 
242
- if (((_state$doc$resolve$no = state.doc.resolve(state.selection.$anchor.pos).nodeAfter) === null || _state$doc$resolve$no === void 0 ? void 0 : _state$doc$resolve$no.type) !== placeholder) {
261
+ if (!isPastingTextInsidePlaceholderText && !isPastingTable) {
243
262
  tr.setMeta(_betterTypeHistory.pluginKey, true);
244
263
  }
245
264
 
@@ -362,6 +381,13 @@ function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinkificatio
362
381
 
363
382
  if (!(0, _utils4.insideTable)(state)) {
364
383
  slice = (0, _utils2.transformSliceNestedExpandToExpand)(slice, state.schema);
384
+ } // Create a custom handler to avoid handling with handleRichText method
385
+ // As SafeInsert is used inside handleRichText which caused some bad UX like this:
386
+ // https://product-fabric.atlassian.net/browse/MEX-1520
387
+
388
+
389
+ if ((0, _analytics.handlePasteIntoCaptionWithAnalytics)(view, event, slice, _analytics2.PasteTypes.richText)(state, dispatch)) {
390
+ return true;
365
391
  }
366
392
 
367
393
  return (0, _analytics.handleRichTextWithAnalytics)(view, event, slice)(state, dispatch);
@@ -9,6 +9,8 @@ exports.pluginKey = exports.default = void 0;
9
9
 
10
10
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
11
11
 
12
+ var _utils = require("@atlaskit/editor-common/utils");
13
+
12
14
  var _prosemirrorState = require("prosemirror-state");
13
15
 
14
16
  var _prosemirrorView = require("prosemirror-view");
@@ -21,7 +23,7 @@ var _styles = require("./styles");
21
23
 
22
24
  var _focusHandler = require("../base/pm-plugins/focus-handler");
23
25
 
24
- var _utils = require("../type-ahead/utils");
26
+ var _utils2 = require("../type-ahead/utils");
25
27
 
26
28
  var pluginKey = new _prosemirrorState.PluginKey('placeholderPlugin');
27
29
  exports.pluginKey = pluginKey;
@@ -46,7 +48,17 @@ function createPlaceholderDecoration(editorState, placeholderText) {
46
48
  placeholderDecoration.className = placeHolderClass;
47
49
  var placeholderNode = document.createElement('span');
48
50
  placeholderNode.textContent = placeholderText;
49
- placeholderDecoration.appendChild(placeholderNode);
51
+ placeholderDecoration.appendChild(placeholderNode); // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
52
+ // Add a editable buff node as the cursor moving forward is inevitable
53
+ // when backspace in GBoard composition
54
+
55
+ if (_utils.browser.android && _utils.browser.chrome) {
56
+ var buffNode = document.createElement('span');
57
+ buffNode.setAttribute('contenteditable', 'true');
58
+ buffNode.textContent = ' ';
59
+ placeholderDecoration.appendChild(buffNode);
60
+ }
61
+
50
62
  return _prosemirrorView.DecorationSet.create(editorState.doc, [_prosemirrorView.Decoration.widget(pos, placeholderDecoration, {
51
63
  side: -1,
52
64
  key: 'placeholder'
@@ -68,7 +80,7 @@ var emptyPlaceholder = {
68
80
  function createPlaceHolderStateFrom(editorState, getPlaceholderHintMessage, defaultPlaceholderText, bracketPlaceholderText) {
69
81
  var isEditorFocused = _focusHandler.focusStateKey.getState(editorState);
70
82
 
71
- if ((0, _utils.isTypeAheadOpen)(editorState)) {
83
+ if ((0, _utils2.isTypeAheadOpen)(editorState)) {
72
84
  return emptyPlaceholder;
73
85
  }
74
86
 
@@ -13,9 +13,11 @@ var _react = require("@emotion/react");
13
13
 
14
14
  var _colors = require("@atlaskit/theme/colors");
15
15
 
16
+ var _tokens = require("@atlaskit/tokens");
17
+
16
18
  var _templateObject;
17
19
 
18
20
  var placeHolderClassName = 'placeholder-decoration';
19
21
  exports.placeHolderClassName = placeHolderClassName;
20
- var placeholderStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, _colors.N200);
22
+ var placeholderStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n outline: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, (0, _tokens.token)('color.text.subtlest', _colors.N200));
21
23
  exports.placeholderStyles = placeholderStyles;
@@ -15,7 +15,9 @@ var _colors = require("@atlaskit/theme/colors");
15
15
 
16
16
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
 
18
+ var _tokens = require("@atlaskit/tokens");
19
+
18
20
  var _templateObject;
19
21
 
20
- var placeholderTextStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror span[data-placeholder] {\n color: ", ";\n display: inline;\n }\n\n .ProseMirror span.pm-placeholder {\n display: inline;\n color: ", ";\n }\n .ProseMirror span.pm-placeholder__text {\n display: inline;\n color: ", ";\n }\n\n .ProseMirror span.pm-placeholder.", " {\n ", "\n }\n\n .ProseMirror span.pm-placeholder__text[data-placeholder]::after {\n color: ", ";\n cursor: text;\n content: attr(data-placeholder);\n display: inline;\n }\n"])), _colors.N300, _colors.N300, _colors.N300, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background]), _colors.N300);
22
+ var placeholderTextStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror span[data-placeholder] {\n color: ", ";\n display: inline;\n }\n\n .ProseMirror span.pm-placeholder {\n display: inline;\n color: ", ";\n }\n .ProseMirror span.pm-placeholder__text {\n display: inline;\n color: ", ";\n }\n\n .ProseMirror span.pm-placeholder.", " {\n ", "\n }\n\n .ProseMirror span.pm-placeholder__text[data-placeholder]::after {\n color: ", ";\n cursor: text;\n content: attr(data-placeholder);\n display: inline;\n }\n"])), (0, _tokens.token)('color.text.subtlest', _colors.N300), (0, _tokens.token)('color.text.subtlest', _colors.N300), (0, _tokens.token)('color.text.subtlest', _colors.N300), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background]), (0, _tokens.token)('color.text.subtlest', _colors.N300));
21
23
  exports.placeholderTextStyles = placeholderTextStyles;
@@ -20,5 +20,5 @@ var gapCursor = '.ProseMirror-gapcursor';
20
20
  var prosemirrorwidget = '.ProseMirror-widget';
21
21
  var wrapLeft = '[layout="wrap-left"]';
22
22
  var wrapRight = '[layout="wrap-right"]';
23
- var gapCursorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* =============== GAP CURSOR ================== */\n .ProseMirror {\n &.", " {\n caret-color: transparent;\n }\n\n ", " {\n display: none;\n pointer-events: none;\n position: relative;\n\n & span {\n caret-color: transparent;\n position: absolute;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n & span::after {\n animation: 1s ", " step-end infinite;\n border-left: 1px solid;\n content: '';\n display: block;\n position: absolute;\n top: 0;\n height: 100%;\n }\n &.-left span::after {\n left: -3px;\n }\n &.-right span::after {\n right: -3px;\n }\n & span[layout='full-width'],\n & span[layout='wide'] {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n &", " {\n float: right;\n }\n\n /* fix vertical alighment of gap cursor */\n &:first-child + ul,\n &:first-child + span + ul,\n &:first-child + ol,\n &:first-child + span + ol,\n &:first-child + pre,\n &:first-child + span + pre,\n &:first-child + blockquote,\n &:first-child + span + blockquote {\n margin-top: 0;\n }\n }\n &.ProseMirror-focused ", " {\n display: block;\n border-color: transparent;\n }\n }\n\n /* This hack below is for two images aligned side by side */\n ", "", " + span + ", ",\n ", "", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " {\n clear: none;\n }\n\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div {\n margin-right: 0;\n margin-left: 0;\n margin-bottom: 0;\n }\n\n ", " + ", ",\n ", " + ", " {\n float: left;\n }\n\n ", " + ", " + span + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after {\n visibility: hidden;\n display: block;\n font-size: 0;\n content: ' ';\n clear: both;\n height: 0;\n }\n\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + *,\n ", " + ", " + span + * {\n margin-top: 0;\n }\n"])), hideCaretModifier, gapCursor, gapCursorBlink, wrapRight, gapCursor, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, wrapLeft, gapCursor, wrapRight, gapCursor, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, prosemirrorwidget, gapCursor, prosemirrorwidget, gapCursor);
23
+ var gapCursorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* =============== GAP CURSOR ================== */\n .ProseMirror {\n &.", " {\n caret-color: transparent;\n }\n\n ", " {\n display: none;\n pointer-events: none;\n position: relative;\n\n & span {\n caret-color: transparent;\n position: absolute;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n & span::after {\n animation: 1s ", " step-end infinite;\n border-left: 1px solid;\n content: '';\n display: block;\n position: absolute;\n top: 0;\n height: 100%;\n }\n &.-left span::after {\n left: -3px;\n }\n &.-right span::after {\n right: -3px;\n }\n & span[layout='full-width'],\n & span[layout='wide'] {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n &", " {\n float: right;\n }\n\n /* fix vertical alignment of gap cursor */\n &:first-of-type + ul,\n &:first-of-type + span + ul,\n &:first-of-type + ol,\n &:first-of-type + span + ol,\n &:first-of-type + pre,\n &:first-of-type + span + pre,\n &:first-of-type + blockquote,\n &:first-of-type + span + blockquote {\n margin-top: 0;\n }\n }\n &.ProseMirror-focused ", " {\n display: block;\n border-color: transparent;\n }\n }\n\n /* This hack below is for two images aligned side by side */\n ", "", " + span + ", ",\n ", "", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " {\n clear: none;\n }\n\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div {\n margin-right: 0;\n margin-left: 0;\n margin-bottom: 0;\n }\n\n ", " + ", ",\n ", " + ", " {\n float: left;\n }\n\n ", " + ", " + span + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after {\n visibility: hidden;\n display: block;\n font-size: 0;\n content: ' ';\n clear: both;\n height: 0;\n }\n\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + *,\n ", " + ", " + span + * {\n margin-top: 0;\n }\n"])), hideCaretModifier, gapCursor, gapCursorBlink, wrapRight, gapCursor, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, wrapLeft, gapCursor, wrapRight, gapCursor, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, prosemirrorwidget, gapCursor, prosemirrorwidget, gapCursor);
24
24
  exports.gapCursorStyles = gapCursorStyles;
@@ -53,8 +53,8 @@ var plugin = new _safePlugin.SafePlugin({
53
53
  }
54
54
 
55
55
  return {
56
- update: function update(view, state) {
57
- var pluginState = _gapCursorPluginKey.gapCursorPluginKey.getState(state);
56
+ update: function update(view) {
57
+ var pluginState = _gapCursorPluginKey.gapCursorPluginKey.getState(view.state);
58
58
  /**
59
59
  * Starting with prosemirror-view 1.19.4, cursor wrapper that previousely was hiding cursor doesn't exist:
60
60
  * https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
@@ -39,14 +39,14 @@ var _constants = require("@atlaskit/theme/constants");
39
39
 
40
40
  var _colors = require("@atlaskit/theme/colors");
41
41
 
42
- var _styles = require("../../../ui/styles");
43
-
44
42
  var _withOuterListeners = _interopRequireDefault(require("../../../ui/with-outer-listeners"));
45
43
 
46
44
  var _actions = require("../actions");
47
45
 
48
46
  var _analytics = require("../analytics");
49
47
 
48
+ var _tokens = require("@atlaskit/tokens");
49
+
50
50
  var _templateObject;
51
51
 
52
52
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -63,7 +63,7 @@ exports.InputMethod = InputMethod;
63
63
  InputMethod["enterKey"] = "enterKey";
64
64
  })(InputMethod || (exports.InputMethod = InputMethod = {}));
65
65
 
66
- var pickerContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n padding: ", "px 0;\n border-radius: ", "px;\n ", ";\n input {\n text-transform: uppercase;\n }\n"])), _colors.N0, (0, _constants.gridSize)(), (0, _constants.borderRadius)(), _styles.dropShadow);
66
+ var pickerContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n padding: ", "px 0;\n border-radius: ", "px;\n box-shadow: ", ";\n input {\n text-transform: uppercase;\n }\n"])), (0, _tokens.token)('elevation.surface.overlay', _colors.N0), (0, _constants.gridSize)(), (0, _constants.borderRadius)(), (0, _tokens.token)('elevation.shadow.overlay', '0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25)'));
67
67
 
68
68
  var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
69
69
  (0, _inherits2.default)(StatusPickerWithoutAnalytcs, _React$Component);
@@ -33,6 +33,8 @@ var _tableLocalId = require("./pm-plugins/table-local-id");
33
33
 
34
34
  var _safariDelayedDomSelectionSyncingWorkaround = require("./pm-plugins/safari-delayed-dom-selection-syncing-workaround");
35
35
 
36
+ var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
37
+
36
38
  var _plugin = require("./pm-plugins/decorations/plugin");
37
39
 
38
40
  var _keymap = require("./pm-plugins/keymap");
@@ -91,13 +93,12 @@ var tablesPlugin = function tablesPlugin(options) {
91
93
  eventDispatcher = _ref.eventDispatcher;
92
94
 
93
95
  var _ref2 = options || {},
94
- dynamicSizingEnabled = _ref2.dynamicSizingEnabled,
95
96
  fullWidthEnabled = _ref2.fullWidthEnabled,
96
97
  wasFullWidthEnabled = _ref2.wasFullWidthEnabled,
97
98
  breakoutEnabled = _ref2.breakoutEnabled,
98
99
  tableOptions = _ref2.tableOptions;
99
100
 
100
- return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), breakoutEnabled && dynamicSizingEnabled, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
101
+ return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
101
102
  }
102
103
  }, {
103
104
  name: 'tablePMColResizing',
@@ -105,7 +106,6 @@ var tablesPlugin = function tablesPlugin(options) {
105
106
  var dispatch = _ref3.dispatch;
106
107
 
107
108
  var _ref4 = options || {},
108
- dynamicSizingEnabled = _ref4.dynamicSizingEnabled,
109
109
  fullWidthEnabled = _ref4.fullWidthEnabled,
110
110
  tableOptions = _ref4.tableOptions;
111
111
 
@@ -113,7 +113,6 @@ var tablesPlugin = function tablesPlugin(options) {
113
113
  allowColumnResizing = _pluginConfig.allowColumnResizing;
114
114
 
115
115
  return allowColumnResizing ? (0, _tableResizing.createPlugin)(dispatch, {
116
- dynamicTextSizing: dynamicSizingEnabled && !fullWidthEnabled,
117
116
  lastColumnResizable: !fullWidthEnabled
118
117
  }) : undefined;
119
118
  }
@@ -165,6 +164,17 @@ var tablesPlugin = function tablesPlugin(options) {
165
164
  return (0, _safariDelayedDomSelectionSyncingWorkaround.createPlugin)();
166
165
  }
167
166
  });
167
+ } // Workaround for table element breaking issue caused by composition event with an inputType of deleteCompositionText.
168
+ // https://github.com/ProseMirror/prosemirror/issues/934
169
+
170
+
171
+ if (_utils.browser.safari) {
172
+ plugins.push({
173
+ name: 'tableSafariDeleteCompositionTextIssueWorkaround',
174
+ plugin: function plugin() {
175
+ return (0, _safariDeleteCompositionTextIssueWorkaround.createPlugin)();
176
+ }
177
+ });
168
178
  }
169
179
 
170
180
  return plugins;
@@ -251,7 +251,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
251
251
  view = _this$props3.view,
252
252
  getNode = _this$props3.getNode,
253
253
  getPos = _this$props3.getPos,
254
- options = _this$props3.options,
255
254
  containerWidth = _this$props3.containerWidth;
256
255
  var node = getNode();
257
256
  var pos = getPos();
@@ -261,7 +260,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
261
260
  }
262
261
 
263
262
  (0, _commands.autoSizeTable)(view, node, _this.table, pos, {
264
- dynamicTextSizing: options && options.dynamicTextSizing || false,
265
263
  containerWidth: containerWidth.width
266
264
  });
267
265
  }
@@ -344,10 +342,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
344
342
  _this.node = _getNode();
345
343
  _this.containerWidth = _containerWidth; // store table size using previous full-width mode so can detect if it has changed
346
344
 
347
- var dynamicTextSizing = _options ? _options.dynamicTextSizing : false;
348
345
  var isFullWidthModeEnabled = _options ? _options.wasFullWidthModeEnabled : false;
349
346
  _this.layoutSize = _this.tableNodeLayoutSize(_this.node, _containerWidth.width, {
350
- dynamicTextSizing: dynamicTextSizing,
351
347
  isFullWidthModeEnabled: isFullWidthModeEnabled
352
348
  }); // Disable inline table editing and resizing controls in Firefox
353
349
  // https://github.com/ProseMirror/prosemirror/issues/432
@@ -432,7 +428,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
432
428
  value: function componentDidUpdate(prevProps) {
433
429
  var _this$props8 = this.props,
434
430
  view = _this$props8.view,
435
- getNode = _this$props8.getNode;
431
+ getNode = _this$props8.getNode,
432
+ isMediaFullscreen = _this$props8.isMediaFullscreen,
433
+ allowColumnResizing = _this$props8.allowColumnResizing;
436
434
 
437
435
  var _ref4 = (0, _featureFlagsContext.getFeatureFlags)(view.state) || {},
438
436
  tableOverflowShadowsOptimization = _ref4.tableOverflowShadowsOptimization;
@@ -458,7 +456,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
458
456
  if (currentTable.attrs.__autoSize) {
459
457
  // Wait for next tick to handle auto sizing, gives the browser time to do layout calc etc.
460
458
  this.handleAutoSizeDebounced();
461
- } else if (this.props.allowColumnResizing && this.table) {
459
+ } // re-drawing will cause media component get unmounted that will exit fullscreen mode if media is in fullscreen mode
460
+ // see https://product-fabric.atlassian.net/browse/MEX-1290
461
+ else if (allowColumnResizing && this.table && !isMediaFullscreen) {
462
462
  // If col widths (e.g. via collab) or number of columns (e.g. delete a column) have changed,
463
463
  // re-draw colgroup.
464
464
  var previousTable = this.node;
@@ -31,6 +31,8 @@ var _react = _interopRequireDefault(require("react"));
31
31
 
32
32
  var _prosemirrorModel = require("prosemirror-model");
33
33
 
34
+ var _pluginKey = require("../../../plugins/media/pm-plugins/plugin-key");
35
+
34
36
  var _ReactNodeView2 = _interopRequireDefault(require("../../../nodeviews/ReactNodeView"));
35
37
 
36
38
  var _WithPluginState = _interopRequireDefault(require("../../../ui/WithPluginState"));
@@ -41,7 +43,7 @@ var _createPluginConfig = require("../create-plugin-config");
41
43
 
42
44
  var _pluginFactory = require("../pm-plugins/plugin-factory");
43
45
 
44
- var _pluginKey = require("../pm-plugins/plugin-key");
46
+ var _pluginKey2 = require("../pm-plugins/plugin-key");
45
47
 
46
48
  var _tableResizing = require("../pm-plugins/table-resizing");
47
49
 
@@ -131,20 +133,23 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
131
133
  return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
132
134
  plugins: {
133
135
  containerWidth: _width.pluginKey,
134
- pluginState: _pluginKey.pluginKey,
135
- tableResizingPluginState: _tableResizing.pluginKey
136
+ pluginState: _pluginKey2.pluginKey,
137
+ tableResizingPluginState: _tableResizing.pluginKey,
138
+ mediaState: _pluginKey.stateKey
136
139
  },
137
140
  editorView: props.view,
138
141
  render: function render(pluginStates) {
139
142
  var tableResizingPluginState = pluginStates.tableResizingPluginState,
140
143
  pluginState = pluginStates.pluginState,
141
- containerWidth = pluginStates.containerWidth;
144
+ containerWidth = pluginStates.containerWidth,
145
+ mediaState = pluginStates.mediaState;
142
146
  var tableActive = props.getPos() === pluginState.tablePos;
143
147
  return /*#__PURE__*/_react.default.createElement(_TableComponent.default, {
144
148
  view: props.view,
145
149
  allowColumnResizing: props.allowColumnResizing,
146
150
  eventDispatcher: props.eventDispatcher,
147
151
  getPos: props.getPos,
152
+ isMediaFullscreen: mediaState === null || mediaState === void 0 ? void 0 : mediaState.isFullscreen,
148
153
  options: props.options,
149
154
  allowControls: pluginState.pluginConfig.allowControls,
150
155
  isHeaderRowEnabled: pluginState.isHeaderRowEnabled,
@@ -60,15 +60,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
60
60
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
61
61
 
62
62
  var isBreakoutEnabled;
63
- var isDynamicTextSizingEnabled;
64
63
  var isFullWidthModeEnabled;
65
64
  var wasFullWidthModeEnabled;
66
65
 
67
- var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, dynamicTextSizing, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
66
+ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
68
67
  var _window;
69
68
 
70
69
  isBreakoutEnabled = breakoutEnabled;
71
- isDynamicTextSizingEnabled = dynamicTextSizing;
72
70
  isFullWidthModeEnabled = fullWidthModeEnabled;
73
71
  wasFullWidthModeEnabled = previousFullWidthModeEnabled;
74
72
  var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread({
@@ -293,7 +291,6 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
293
291
  table: function table(node, view, getPos) {
294
292
  return (0, _table.createTableView)(node, view, getPos, portalProviderAPI, eventDispatcher, {
295
293
  isBreakoutEnabled: isBreakoutEnabled,
296
- dynamicTextSizing: isDynamicTextSizingEnabled,
297
294
  isFullWidthModeEnabled: isFullWidthModeEnabled,
298
295
  wasFullWidthModeEnabled: wasFullWidthModeEnabled
299
296
  });
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = exports.createPlugin = void 0;
7
+
8
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
+
10
+ var _prosemirrorState = require("prosemirror-state");
11
+
12
+ var _prosemirrorView = require("prosemirror-view");
13
+
14
+ /**
15
+ * Fix an issue that composition text replacement in Safari removes empty nodes during text composition text deletion.
16
+ * https://github.com/ProseMirror/prosemirror/issues/934
17
+ * We will remove this plugin when Webkit fix the problem itself.
18
+ */
19
+ var tableSafariDeleteCompositionTextIssueWorkaroundKey = new _prosemirrorState.PluginKey('tableSafariDeleteCompositionTextIssueWorkaround');
20
+ exports.tableSafariDeleteCompositionTextIssueWorkaroundKey = tableSafariDeleteCompositionTextIssueWorkaroundKey;
21
+
22
+ var createPlugin = function createPlugin() {
23
+ return new _safePlugin.SafePlugin({
24
+ key: tableSafariDeleteCompositionTextIssueWorkaroundKey,
25
+ state: {
26
+ init: function init() {
27
+ return {
28
+ renderSpan: false,
29
+ decorations: _prosemirrorView.DecorationSet.empty
30
+ };
31
+ },
32
+ apply: function apply(tr, value) {
33
+ var renderSpan = tr.getMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey);
34
+
35
+ if (typeof renderSpan === 'undefined') {
36
+ return value;
37
+ }
38
+
39
+ var decorations;
40
+
41
+ if (renderSpan) {
42
+ // Find position of the first text node in case it has multiple text nodes created by Japanese IME
43
+ var $from = tr.selection.$from;
44
+ var pos = $from.before($from.depth);
45
+
46
+ var spanDecoration = _prosemirrorView.Decoration.widget(pos, function () {
47
+ var spanElement = document.createElement('span');
48
+ return spanElement;
49
+ });
50
+
51
+ decorations = _prosemirrorView.DecorationSet.create(tr.doc, [spanDecoration]);
52
+ } else {
53
+ decorations = _prosemirrorView.DecorationSet.empty;
54
+ }
55
+
56
+ return {
57
+ renderSpan: renderSpan,
58
+ decorations: decorations
59
+ };
60
+ }
61
+ },
62
+ props: {
63
+ decorations: function decorations(state) {
64
+ return tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state).decorations;
65
+ },
66
+ handleDOMEvents: {
67
+ beforeinput: function beforeinput(view, event) {
68
+ if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
69
+ return false;
70
+ }
71
+
72
+ var selection = window.getSelection();
73
+
74
+ if (!selection || selection.rangeCount <= 0 || selection.type !== 'Range') {
75
+ return false;
76
+ }
77
+
78
+ var range = selection.getRangeAt(0);
79
+ var startContainer = range.startContainer,
80
+ endContainer = range.endContainer,
81
+ endOffset = range.endOffset,
82
+ startOffset = range.startOffset;
83
+ /**
84
+ * On Safari when composition text is deleted, it deletes any empty elements it finds up the dom tree. Prosemirror can sometimes be confused by this
85
+ * and will think that we meant to delete those elements. This fix forces the resulting node to not be empty.
86
+ * The condition here checks to see if the entire text node is about to be swapped inside of an element
87
+ */
88
+
89
+ if (startContainer.nodeType === Node.TEXT_NODE && startContainer === endContainer && startOffset === 0 && endOffset === startContainer.length) {
90
+ var tr = view.state.tr;
91
+ tr.setMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey, true);
92
+ view.dispatch(tr);
93
+ }
94
+
95
+ return false;
96
+ },
97
+ input: function input(view, event) {
98
+ if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
99
+ return false;
100
+ }
101
+
102
+ var selection = window.getSelection();
103
+
104
+ if (!selection) {
105
+ return false;
106
+ }
107
+
108
+ var tr = view.state.tr;
109
+ tr.setMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey, false);
110
+ view.dispatch(tr);
111
+ return false;
112
+ }
113
+ }
114
+ }
115
+ });
116
+ };
117
+
118
+ exports.createPlugin = createPlugin;
@@ -31,7 +31,7 @@ var _utils3 = require("./utils");
31
31
 
32
32
  var _analytics = require("../../../analytics");
33
33
 
34
- var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, dynamicTextSizing) {
34
+ var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos) {
35
35
  var state = view.state,
36
36
  dispatch = view.dispatch;
37
37
 
@@ -59,9 +59,7 @@ var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos
59
59
  var containerWidth = _width.pluginKey.getState(state);
60
60
 
61
61
  var parentWidth = (0, _nodeWidth.getParentNodeWidth)(start, state, containerWidth);
62
- var maxSize = parentWidth || (0, _utils3.getLayoutSize)(dom.getAttribute('data-layout'), containerWidth.width, {
63
- dynamicTextSizing: dynamicTextSizing
64
- });
62
+ var maxSize = parentWidth || (0, _utils3.getLayoutSize)(dom.getAttribute('data-layout'), containerWidth.width, {});
65
63
 
66
64
  if (originalTable.attrs.isNumberColumnEnabled) {
67
65
  maxSize -= _editorSharedStyles.akEditorTableNumberColumnWidth;
@@ -27,14 +27,11 @@ var _utils = require("./utils");
27
27
 
28
28
  function createPlugin(dispatch, _ref) {
29
29
  var _ref$lastColumnResiza = _ref.lastColumnResizable,
30
- lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza,
31
- _ref$dynamicTextSizin = _ref.dynamicTextSizing,
32
- dynamicTextSizing = _ref$dynamicTextSizin === void 0 ? false : _ref$dynamicTextSizin;
30
+ lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
33
31
  return new _safePlugin.SafePlugin({
34
32
  key: _pluginKey.pluginKey,
35
33
  state: (0, _pluginFactory.createPluginState)(dispatch, {
36
34
  lastColumnResizable: lastColumnResizable,
37
- dynamicTextSizing: dynamicTextSizing,
38
35
  resizeHandlePos: null,
39
36
  dragging: null,
40
37
  lastClick: null
@@ -58,7 +55,7 @@ function createPlugin(dispatch, _ref) {
58
55
  dragging = _getPluginState.dragging;
59
56
 
60
57
  if (resizeHandlePos !== null && !dragging) {
61
- if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos, dynamicTextSizing)) {
58
+ if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos)) {
62
59
  var _state = view.state,
63
60
  _dispatch = view.dispatch;
64
61
  return (0, _commands.setResizeHandlePos)(resizeHandlePos)(_state, _dispatch);
@@ -34,8 +34,7 @@ exports.tableLayoutToSize = tableLayoutToSize;
34
34
  function getLayoutSize(tableLayout) {
35
35
  var containerWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
36
36
  var options = arguments.length > 2 ? arguments[2] : undefined;
37
- var dynamicTextSizing = options.dynamicTextSizing,
38
- isFullWidthModeEnabled = options.isFullWidthModeEnabled;
37
+ var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
39
38
 
40
39
  if (isFullWidthModeEnabled) {
41
40
  return containerWidth ? Math.min(containerWidth - _editorSharedStyles.akEditorGutterPadding * 2, _editorSharedStyles.akEditorFullWidthLayoutWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
@@ -47,7 +46,7 @@ function getLayoutSize(tableLayout) {
47
46
  return parseInt(calculatedTableWidth, 10);
48
47
  }
49
48
 
50
- if (dynamicTextSizing && tableLayout === 'default') {
49
+ if (tableLayout === 'default') {
51
50
  return getDefaultLayoutMaxWidth(containerWidth);
52
51
  }
53
52
 
@@ -102,15 +101,12 @@ var getTableMaxWidth = function getTableMaxWidth(_ref2) {
102
101
  var table = _ref2.table,
103
102
  tableStart = _ref2.tableStart,
104
103
  state = _ref2.state,
105
- layout = _ref2.layout,
106
- dynamicTextSizing = _ref2.dynamicTextSizing;
104
+ layout = _ref2.layout;
107
105
 
108
106
  var containerWidth = _width.pluginKey.getState(state);
109
107
 
110
108
  var parentWidth = (0, _nodeWidth.getParentNodeWidth)(tableStart, state, containerWidth);
111
- var maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {
112
- dynamicTextSizing: dynamicTextSizing
113
- });
109
+ var maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
114
110
 
115
111
  if (table.attrs.isNumberColumnEnabled) {
116
112
  maxWidth -= _editorSharedStyles.akEditorTableNumberColumnWidth;
@@ -307,7 +307,7 @@ var normaliseTableLayout = function normaliseTableLayout(input) {
307
307
 
308
308
  exports.normaliseTableLayout = normaliseTableLayout;
309
309
 
310
- var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelectedColumns(rect, state, domAtPos, dynamicTextSizing) {
310
+ var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelectedColumns(rect, state, domAtPos) {
311
311
  var _getSelectedTableInfo = (0, _utils2.getSelectedTableInfo)(state.selection),
312
312
  totalRowCount = _getSelectedTableInfo.totalRowCount,
313
313
  totalColumnCount = _getSelectedTableInfo.totalColumnCount,
@@ -329,8 +329,7 @@ var getNewResizeStateFromSelectedColumns = function getNewResizeStateFromSelecte
329
329
  table: table.node,
330
330
  tableStart: table.start,
331
331
  state: state,
332
- layout: layout,
333
- dynamicTextSizing: dynamicTextSizing
332
+ layout: layout
334
333
  });
335
334
  var resizeState = getResizeState({
336
335
  minWidth: _styles.tableCellMinWidth,
@@ -37,18 +37,15 @@ var scale = function scale(tableRef, options, domAtPos) {
37
37
  var node = options.node,
38
38
  containerWidth = options.containerWidth,
39
39
  previousContainerWidth = options.previousContainerWidth,
40
- dynamicTextSizing = options.dynamicTextSizing,
41
40
  prevNode = options.prevNode,
42
41
  start = options.start,
43
42
  isBreakoutEnabled = options.isBreakoutEnabled,
44
43
  layoutChanged = options.layoutChanged;
45
44
  var maxSize = (0, _misc.getLayoutSize)(node.attrs.layout, containerWidth, {
46
- dynamicTextSizing: dynamicTextSizing,
47
45
  isBreakoutEnabled: isBreakoutEnabled
48
46
  });
49
47
  var prevTableWidth = (0, _utils.getTableWidth)(prevNode);
50
48
  var previousMaxSize = (0, _misc.getLayoutSize)(prevNode.attrs.layout, previousContainerWidth, {
51
- dynamicTextSizing: dynamicTextSizing,
52
49
  isBreakoutEnabled: isBreakoutEnabled
53
50
  });
54
51
  var newWidth = maxSize; // adjust table width if layout is updated
@@ -168,8 +168,7 @@ var rescaleColumns = function rescaleColumns(table, view) {
168
168
  table: table.node,
169
169
  tableStart: table.start,
170
170
  state: state,
171
- layout: layout,
172
- dynamicTextSizing: true
171
+ layout: layout
173
172
  });
174
173
  var resizeState = (0, _resizeState.getResizeState)({
175
174
  minWidth: _styles.tableCellMinWidth,
@@ -146,9 +146,7 @@ var fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, tableRef, ta
146
146
  return acc + current;
147
147
  }, 0);
148
148
  var tableLayout = getLayoutBasedOnWidth(totalContentWidth);
149
- var maxLayoutSize = (0, _utils.getLayoutSize)(tableLayout, opts.containerWidth, {
150
- dynamicTextSizing: opts.dynamicTextSizing
151
- }); // Content width will generally not meet the constraints of the layout
149
+ var maxLayoutSize = (0, _utils.getLayoutSize)(tableLayout, opts.containerWidth, {}); // Content width will generally not meet the constraints of the layout
152
150
  // whether it be below or above, so we scale our columns widths
153
151
  // to meet these requirements
154
152