@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
@@ -5,6 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
8
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
8
9
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
9
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
11
 
@@ -12,8 +13,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
12
13
 
13
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
15
 
15
- import _regeneratorRuntime from "@babel/runtime/regenerator";
16
-
17
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
17
 
19
18
  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) { _defineProperty(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; }
@@ -26,12 +25,14 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
26
25
  import { MediaInlineNodeSelector } from './styles';
27
26
  import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
28
27
  import { MediaNodeUpdater } from './mediaNodeUpdater';
28
+ import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
29
29
  export var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
30
- var node = props.node.firstChild;
30
+ var node = props.node;
31
31
  return new MediaNodeUpdater(_objectSpread(_objectSpread({}, props), {}, {
32
32
  isMediaSingle: true,
33
33
  node: node ? node : props.node,
34
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
34
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
35
+ contextIdentifierProvider: props.contextIdentifierProvider
35
36
  }));
36
37
  };
37
38
  /**
@@ -98,6 +99,10 @@ export var updateMediaNodeAttributes = /*#__PURE__*/function () {
98
99
  return _context.abrupt("return");
99
100
 
100
101
  case 23:
102
+ _context.next = 25;
103
+ return mediaNodeUpdater.updateFileAttrs();
104
+
105
+ case 25:
101
106
  case "end":
102
107
  return _context.stop();
103
108
  }
@@ -118,7 +123,7 @@ export var handleNewNode = function handleNewNode(props) {
118
123
  });
119
124
  };
120
125
  export var MediaInline = function MediaInline(props) {
121
- var _useState = useState({}),
126
+ var _useState = useState(),
122
127
  _useState2 = _slicedToArray(_useState, 2),
123
128
  viewMediaClientConfig = _useState2[0],
124
129
  setViewMediaClientConfig = _useState2[1];
@@ -173,6 +178,18 @@ export var MediaInline = function MediaInline(props) {
173
178
  mediaItemType: 'file',
174
179
  collectionName: collection
175
180
  };
181
+ /*
182
+ * Only show the loading view if the media provider is not ready
183
+ * prevents calling the media API before the provider is ready
184
+ */
185
+
186
+ if (!viewMediaClientConfig) {
187
+ return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
188
+ message: "",
189
+ isSelected: false
190
+ });
191
+ }
192
+
176
193
  return /*#__PURE__*/React.createElement(MediaInlineCard, {
177
194
  isSelected: props.isSelected,
178
195
  identifier: identifier,
@@ -195,13 +212,13 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
195
212
  value: function createDomRef() {
196
213
  var domRef = document.createElement('span');
197
214
  domRef.contentEditable = 'false';
198
- domRef.classList.add(MediaInlineNodeSelector);
199
215
  return domRef;
200
216
  }
201
217
  }, {
202
218
  key: "getContentDOM",
203
219
  value: function getContentDOM() {
204
220
  var dom = document.createElement('span');
221
+ dom.classList.add(MediaInlineNodeSelector);
205
222
  return {
206
223
  dom: dom
207
224
  };
@@ -1,8 +1,8 @@
1
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
4
5
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import uuidV4 from 'uuid/v4';
7
7
  import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
8
8
  import { getMediaClient, isMediaBlobUrl as _isMediaBlobUrl, getAttrsFromUrl, isImageRepresentationReady } from '@atlaskit/media-client';
@@ -1,3 +1,4 @@
1
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -6,7 +7,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
 
@@ -92,6 +92,12 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
92
92
  }
93
93
  });
94
94
 
95
+ _defineProperty(_assertThisInitialized(_this), "onFullscreenChange", function (fullscreen) {
96
+ _this.mediaPluginState.updateAndDispatch({
97
+ isFullscreen: fullscreen
98
+ });
99
+ });
100
+
95
101
  _defineProperty(_assertThisInitialized(_this), "handleNewNode", function (props) {
96
102
  var node = props.node;
97
103
 
@@ -230,6 +236,7 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
230
236
  selectable: true,
231
237
  selected: selected,
232
238
  disableOverlay: true,
239
+ onFullscreenChange: this.onFullscreenChange,
233
240
  onClick: this.selectMediaSingleFromCard,
234
241
  useInlinePlayer: mediaOptions && mediaOptions.allowLazyLoading,
235
242
  isLazy: mediaOptions && mediaOptions.allowLazyLoading,
@@ -1,5 +1,6 @@
1
1
  import _get from "@babel/runtime/helpers/get";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
4
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
5
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
6
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -8,7 +9,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
9
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
10
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
11
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
- import _regeneratorRuntime from "@babel/runtime/regenerator";
12
12
 
13
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
14
 
@@ -1,8 +1,8 @@
1
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
4
5
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import { isImagePreview } from '@atlaskit/media-picker';
7
7
 
8
8
  var PickerFacade = /*#__PURE__*/function () {
@@ -31,15 +31,16 @@ import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, ACTI
31
31
  import { RECENT_SEARCH_WIDTH_IN_PX } from '../../../../../ui/LinkSearch/ToolbarComponents';
32
32
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
33
33
  import { ErrorMessage } from '@atlaskit/editor-common/ui';
34
+ import { token } from '@atlaskit/tokens';
34
35
  export var CONTAINER_WIDTH_IN_PX = RECENT_SEARCH_WIDTH_IN_PX;
35
36
  export var MAX_ALT_TEXT_LENGTH = 510; // double tweet length
36
37
 
37
- var supportText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), N100, relativeFontSizeToBase16(12), N30);
38
+ var supportText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), token('color.text.subtlest', N100), relativeFontSizeToBase16(12), token('color.border', N30));
38
39
  var container = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n line-height: 2;\n"])), CONTAINER_WIDTH_IN_PX);
39
40
  var inputWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 5px 0;\n align-items: center;\n"])));
40
- var validationWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 12px 0 40px;\n border-top: 1px solid ", ";\n align-items: start;\n flex-direction: column;\n"])), R400);
41
+ var validationWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 12px 0 40px;\n border-top: 1px solid ", ";\n align-items: start;\n flex-direction: column;\n"])), token('color.border.danger', R400));
41
42
  var buttonWrapper = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n padding: 4px 8px;\n"])));
42
- var clearText = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), N80);
43
+ var clearText = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), token('color.icon.subtle', N80));
43
44
  export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
44
45
  _inherits(AltTextEditComponent, _React$Component);
45
46
 
@@ -1,3 +1,4 @@
1
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -13,7 +14,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
13
14
 
14
15
  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) { _defineProperty(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; }
15
16
 
16
- import _regeneratorRuntime from "@babel/runtime/regenerator";
17
17
  import React from 'react';
18
18
  import ReactDOM from 'react-dom';
19
19
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
@@ -76,6 +76,8 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
76
76
 
77
77
  _defineProperty(this, "showDropzone", false);
78
78
 
79
+ _defineProperty(this, "isFullscreen", false);
80
+
79
81
  _defineProperty(this, "layout", 'center');
80
82
 
81
83
  _defineProperty(this, "mediaNodes", []);
@@ -8,7 +8,7 @@ import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderB
8
8
  import { N60, B200 } from '@atlaskit/theme/colors';
9
9
  import { fileCardImageViewSelector, fileCardImageViewSelectedSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
10
10
  import { token } from '@atlaskit/tokens';
11
- export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: rgb(255, 189, 173, 0.5); /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n"])), mediaSingleSharedStyle, richMediaClassName, richMediaClassName, richMediaClassName, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPadding, richMediaClassName, richMediaClassName, N60, akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, B200, token('color.background.danger', akEditorDeleteBackground), akEditorSelectedBorderBoldSize, token('color.border.danger', akEditorDeleteBorder), fileCardImageViewSelectedSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, fileCardImageViewSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, inlinePlayerClassName, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, newFileExperienceClassName, token('color.border.danger', akEditorDeleteIconColor), token('color.icon.danger', akEditorDeleteIconColor));
11
+ export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: ", "; /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n"])), mediaSingleSharedStyle, richMediaClassName, richMediaClassName, richMediaClassName, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPadding, richMediaClassName, richMediaClassName, token('color.border', N60), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, token('color.border.focused', B200), token('color.background.danger', akEditorDeleteBackground), akEditorSelectedBorderBoldSize, token('color.border.danger', akEditorDeleteBorder), fileCardImageViewSelectedSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, fileCardImageViewSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, inlinePlayerClassName, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, newFileExperienceClassName, token('color.border.danger', akEditorDeleteIconColor), token('color.icon.danger', akEditorDeleteIconColor), token('color.blanket.danger', 'rgb(255, 189, 173, 0.5)'));
12
12
  /* `left: unset` above is to work around Chrome bug where rendering a div with
13
13
  * that style applied inside a container that has a scroll, causes any svgs on
14
14
  * the page, without a border, that are inside a flexbox, to no longer align to
@@ -1,5 +1,5 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
1
  import _regeneratorRuntime from "@babel/runtime/regenerator";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import { getMediaClient } from '@atlaskit/media-client';
4
4
  import { findParentNodeOfType, removeParentNodeOfType, removeSelectedNode } from 'prosemirror-utils';
5
5
  export var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
@@ -6,8 +6,9 @@ var _templateObject;
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { N200 } from '@atlaskit/theme/colors';
9
+ import { token } from '@atlaskit/tokens';
9
10
  import { messages } from './messages';
10
- var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n width: 100%;\n text-align: center;\n margin-top: 8px !important;\n display: block;\n"])), N200);
11
+ var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n width: 100%;\n text-align: center;\n margin-top: 8px !important;\n display: block;\n"])), token('color.text.subtlest', N200));
11
12
  export var CAPTION_PLACEHOLDER_ID = 'caption-placeholder';
12
13
  export default (function (_ref) {
13
14
  var onClick = _ref.onClick;
@@ -10,9 +10,10 @@ import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
10
10
  import { hexToRgba } from '@atlaskit/adf-schema';
11
11
  import { injectIntl } from 'react-intl-next';
12
12
  import { dropPlaceholderMessages } from './drop-placeholder-messages';
13
+ import { token } from '@atlaskit/tokens';
13
14
  import { MEDIA_HEIGHT, FILE_WIDTH } from '../../nodeviews/mediaNodeView/media';
14
- var iconWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n background: ", ";\n border-radius: ", "px;\n margin: 5px 3px 25px;\n width: ", "px;\n min-height: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), hexToRgba(B400, 0.4) || B400, hexToRgba(B300, 0.6) || B300, borderRadius(), FILE_WIDTH, MEDIA_HEIGHT);
15
- var dropLine = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n margin: 2px 0;\n width: 100%;\n height: 2px;\n"])), B200, borderRadius());
15
+ var iconWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n background: ", ";\n border-radius: ", "px;\n margin: 5px 3px 25px;\n width: ", "px;\n min-height: ", "px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), token('color.icon.accent.blue', hexToRgba(B400, 0.4) || B400), token('color.background.accent.blue.subtle', hexToRgba(B300, 0.6) || B300), borderRadius(), FILE_WIDTH, MEDIA_HEIGHT);
16
+ var dropLine = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n margin: 2px 0;\n width: 100%;\n height: 2px;\n"])), token('color.border.focused', B200), borderRadius());
16
17
 
17
18
  var IconWrapperComponent = function IconWrapperComponent(props) {
18
19
  var intl = props.intl;
@@ -30,7 +30,8 @@ import { normalizeUrl } from '../../hyperlink/utils';
30
30
  import { R400 } from '@atlaskit/theme/colors';
31
31
  import { INPUT_METHOD } from '../../analytics/types/enums';
32
32
  import { mediaLinkToolbarMessages } from './media-linking-toolbar-messages';
33
- var validationWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 4px 0 32px;\n border-top: 1px solid ", ";\n align-items: start;\n display: flex;\n flex-direction: column;\n"])), R400);
33
+ import { token } from '@atlaskit/tokens';
34
+ var validationWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 4px 0 32px;\n border-top: 1px solid ", ";\n align-items: start;\n display: flex;\n flex-direction: column;\n"])), token('color.border.danger', R400));
34
35
  var buttonWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 4px 8px 4px 0px;\n"])));
35
36
  export var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
36
37
  _inherits(LinkAddToolbar, _React$PureComponent);
@@ -1,3 +1,4 @@
1
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -6,7 +7,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
 
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
2
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
5
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -7,7 +8,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
 
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
13
 
@@ -1,5 +1,5 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
1
  import _regeneratorRuntime from "@babel/runtime/regenerator";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import { getMediaClient } from '@atlaskit/media-client';
4
4
  export var checkMediaType = /*#__PURE__*/function () {
5
5
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mediaNode, mediaClientConfig) {
@@ -6,4 +6,5 @@ import { css } from '@emotion/react';
6
6
  import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
7
7
  import { SelectionStyle, getSelectionStyles, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
8
8
  import { N500, N30A } from '@atlaskit/theme/colors';
9
- export var mentionsStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n &.", " [data-mention-id] > span {\n ", "\n\n /* need to specify dark text colour because personal mentions\n (in dark blue) have white text by default */\n color: ", ";\n }\n }\n\n .danger {\n .", ".", "\n > span\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n .", " > span > span {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background]), N500, MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackgroundWithOpacity, MentionSharedCssClassName.MENTION_CONTAINER, N30A, N500);
9
+ import { token } from '@atlaskit/tokens';
10
+ export var mentionsStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n &.", " [data-mention-id] > span {\n ", "\n\n /* need to specify dark text colour because personal mentions\n (in dark blue) have white text by default */\n color: ", ";\n }\n }\n\n .danger {\n .", ".", "\n > span\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n .", " > span > span {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background]), token('color.text.subtle', N500), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, akEditorDeleteBorder, token('color.background.danger', akEditorDeleteBackgroundWithOpacity), MentionSharedCssClassName.MENTION_CONTAINER, token('color.background.neutral', N30A), token('color.text.subtle', N500));
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  import { jsx } from '@emotion/react';
5
5
  import AddIcon from '@atlaskit/icon/glyph/add';
6
6
  import { N300 } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
7
8
  import React, { useCallback, useEffect } from 'react';
8
9
  import { FormattedMessage, injectIntl } from 'react-intl-next';
9
10
  import { avatarStyle, capitalizedStyle, mentionItemStyle, nameSectionStyle, rowStyle, ROW_SIDE_PADDING, AVATAR_HEIGHT, mentionItemSelectedStyle } from './styles';
@@ -52,7 +53,7 @@ var InviteItem = function InviteItem(_ref) {
52
53
  css: avatarStyle
53
54
  }, jsx(AddIcon, {
54
55
  label: intl.formatMessage(messages.mentionsAddLabel),
55
- primaryColor: N300
56
+ primaryColor: token('color.icon.subtle', N300)
56
57
  })), jsx("div", {
57
58
  css: nameSectionStyle,
58
59
  "data-testid": "name-section"
@@ -4,11 +4,12 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
4
4
 
5
5
  import { css } from '@emotion/react';
6
6
  import { N30, N300 } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
7
8
  export var ROW_SIDE_PADDING = 14;
8
9
  export var rowStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n overflow: hidden;\n padding: 6px ", "px;\n text-overflow: ellipsis;\n vertical-align: middle;\n"])), ROW_SIDE_PADDING);
9
10
  export var AVATAR_HEIGHT = 36;
10
11
  export var avatarStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n flex: initial;\n opacity: inherit;\n width: 36px;\n height: ", "px;\n\n > span {\n width: 24px;\n height: 24px;\n padding: 6px;\n }\n"])), AVATAR_HEIGHT);
11
- export var nameSectionStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n margin-left: 14px;\n color: ", ";\n opacity: inherit;\n"])), N300);
12
+ export var nameSectionStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n margin-left: 14px;\n color: ", ";\n opacity: inherit;\n"])), token('color.text.subtle', N300));
12
13
  export var mentionItemStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: transparent;\n display: block;\n overflow: hidden;\n list-style-type: none;\n cursor: pointer;\n"])));
13
- export var mentionItemSelectedStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), N30);
14
+ export var mentionItemSelectedStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), token('color.background.neutral.subtle.hovered', N30));
14
15
  export var capitalizedStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n text-transform: capitalize;\n"])));
@@ -145,6 +145,7 @@ var panelPlugin = function panelPlugin() {
145
145
  panelIcon: ':rainbow:',
146
146
  panelIconId: '1f308',
147
147
  panelIconText: '🌈',
148
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
148
149
  panelColor: T50
149
150
  }, state, insert);
150
151
  }
@@ -81,7 +81,10 @@ var PanelNodeView = /*#__PURE__*/function () {
81
81
  key: "ignoreMutation",
82
82
  value: function ignoreMutation(mutation) {
83
83
  // ignore mutation if it caused by the icon.
84
- return mutation.target === this.icon || mutation.target.parentNode === this.icon;
84
+ var isIcon = mutation.target === this.icon || mutation.target.parentNode === this.icon; // ignore mutation if it caused by the lazy load emoji inside icon.
85
+
86
+ var isInsideIcon = this.icon.contains(mutation.target);
87
+ return isIcon || isInsideIcon;
85
88
  }
86
89
  }]);
87
90
 
@@ -1,6 +1,23 @@
1
1
  import { keymap } from 'prosemirror-keymap';
2
- import { setTextSelection } from 'prosemirror-utils';
3
- // Somewhat broken and subverted: https://product-fabric.atlassian.net/browse/ED-6504
2
+ import { setTextSelection, findParentNodeOfType } from 'prosemirror-utils';
3
+ import { isEmptyNode } from '../../../utils';
4
+
5
+ function findParentNode(selection, nodeType) {
6
+ var parentPosition = findParentNodeOfType(nodeType)(selection);
7
+
8
+ if (parentPosition) {
9
+ return parentPosition.node;
10
+ }
11
+
12
+ return null;
13
+ }
14
+
15
+ function isInsideAnEmptyNode(selection, nodeType, schema) {
16
+ var parentNode = findParentNode(selection, nodeType);
17
+ return parentNode && isEmptyNode(schema)(parentNode);
18
+ } // Somewhat broken and subverted: https://product-fabric.atlassian.net/browse/ED-6504
19
+
20
+
4
21
  export function keymapPlugin() {
5
22
  var deleteCurrentItem = function deleteCurrentItem($from, tr) {
6
23
  return tr.delete($from.before($from.depth) - 1, $from.end($from.depth) + 1);
@@ -11,7 +28,8 @@ export function keymapPlugin() {
11
28
  var selection = state.selection,
12
29
  nodes = state.schema.nodes,
13
30
  tr = state.tr;
14
- var panel = nodes.panel;
31
+ var panel = nodes.panel,
32
+ blockquote = nodes.blockquote;
15
33
  var $from = selection.$from,
16
34
  $to = selection.$to; // Don't do anything if selection is a range
17
35
 
@@ -30,7 +48,7 @@ export function keymapPlugin() {
30
48
  var isPreviousNodeAPanel = previousNodeType === panel;
31
49
  var isParentNodeAPanel = parentNodeType === panel; // Stops merging panels when deleting empty paragraph in between
32
50
 
33
- if (isPreviousNodeAPanel && !isParentNodeAPanel) {
51
+ if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || isInsideAnEmptyNode(selection, blockquote, state.schema)) {
34
52
  var content = $from.node($from.depth).content;
35
53
  var insertPos = previousPos.pos - 1;
36
54
  deleteCurrentItem($from, tr).insert(insertPos, content);
@@ -1,6 +1,6 @@
1
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
 
5
5
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
6
 
@@ -721,6 +721,27 @@ export function handleRichText(slice) {
721
721
  return true;
722
722
  };
723
723
  }
724
+ export function handlePasteIntoCaption(slice) {
725
+ return function (state, dispatch) {
726
+ var caption = state.schema.nodes.caption;
727
+ var tr = state.tr;
728
+
729
+ if (hasParentNodeOfType(caption)(state.selection)) {
730
+ // We let PM replace the selection and it will insert as text where it can't place the node
731
+ // This is totally fine as caption is just a simple block that only contains inline contents
732
+ // And it is more in line with WYSIWYG expectations
733
+ tr.replaceSelection(slice).scrollIntoView();
734
+
735
+ if (dispatch) {
736
+ dispatch(tr);
737
+ }
738
+
739
+ return true;
740
+ }
741
+
742
+ return false;
743
+ };
744
+ }
724
745
  export var handleSelectedTable = function handleSelectedTable(slice) {
725
746
  return function (state, dispatch) {
726
747
  var tr = replaceSelectedTable(state, slice, INPUT_METHOD.CLIPBOARD);
@@ -1,5 +1,6 @@
1
1
  import { linkifyMatch } from '@atlaskit/adf-schema';
2
- import LinkifyIt from 'linkify-it'; // modified version of the original Linkify plugin
2
+ import LinkifyIt from 'linkify-it';
3
+ import { findFilepaths, isLinkInMatches } from '../hyperlink/utils'; // modified version of the original Linkify plugin
3
4
  // https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js
4
5
 
5
6
  var arrayReplaceAt = function arrayReplaceAt(src, pos, newElements) {
@@ -67,8 +68,13 @@ var linkify = function linkify(state) {
67
68
  var nodes = [];
68
69
  var level = currentToken.level;
69
70
  var lastPos = 0;
71
+ var filepaths = findFilepaths(text);
70
72
 
71
73
  for (var ln = 0; ln < links.length; ln++) {
74
+ if (isLinkInMatches(links[ln].index, filepaths)) {
75
+ continue;
76
+ }
77
+
72
78
  var url = links[ln].url;
73
79
  var fullUrl = state.md.normalizeLink(url);
74
80
 
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
 
8
8
  import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents, withAnalytics } from '../../analytics';
9
9
  import { getPasteSource } from '../util';
10
- import { handlePasteAsPlainText, handlePasteIntoTaskAndDecision, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText } from '../handlers';
10
+ import { handlePasteAsPlainText, handlePasteIntoTaskAndDecision, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption } from '../handlers';
11
11
  import { pipe } from '../../../utils';
12
12
  import { findParentNode } from 'prosemirror-utils';
13
13
  import { mapSlice } from '../../../utils/slice';
@@ -222,6 +222,11 @@ export var handlePasteIntoTaskAndDecisionWithAnalytics = function handlePasteInt
222
222
  type: type
223
223
  }))(slice);
224
224
  };
225
+ export var handlePasteIntoCaptionWithAnalytics = function handlePasteIntoCaptionWithAnalytics(view, event, slice, type) {
226
+ return pipe(handlePasteIntoCaption, pasteCommandWithAnalytics(view, event, slice, {
227
+ type: type
228
+ }))(slice);
229
+ };
225
230
  export var handleCodeBlockWithAnalytics = function handleCodeBlockWithAnalytics(view, event, slice, text) {
226
231
  return pipe(handleCodeBlock, pasteCommandWithAnalytics(view, event, slice, {
227
232
  type: PasteTypes.plain
@@ -1,5 +1,5 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
1
  import _regeneratorRuntime from "@babel/runtime/regenerator";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import { Slice, Fragment } from 'prosemirror-model';
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { PluginKey } from 'prosemirror-state';
@@ -14,7 +14,7 @@ import { linkifyContent } from '../../hyperlink/utils';
14
14
  import { transformSliceNestedExpandToExpand } from '../../expand/utils';
15
15
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
16
16
  import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
17
- import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent } from './analytics';
17
+ import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics } from './analytics';
18
18
  import { analyticsPluginKey, PasteTypes } from '../../analytics';
19
19
  import { insideTable, measurements } from '../../../utils';
20
20
  import { measureRender } from '@atlaskit/editor-common/utils';
@@ -28,6 +28,7 @@ import { pluginKey as betterTypePluginKey } from '../../base/pm-plugins/better-t
28
28
  import { clipboardTextSerializer } from './clipboard-text-serializer';
29
29
  import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
30
30
  import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
31
+ import { extractSliceFromStep } from '../../../utils/step';
31
32
  export var stateKey = new PluginKey('pastePlugin');
32
33
  export { md } from '../md';
33
34
  export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinkification, cardOptions, sanitizePrivateContent, providerFactory) {
@@ -184,8 +185,25 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
184
185
  // don't add closeHistory call if we're pasting a text inside placeholder text as we want the whole action
185
186
  // to be atomic
186
187
  var placeholder = state.schema.nodes.placeholder;
188
+ 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
189
+ // appendedTransactions to repair them (if they're partial or incomplete) and we don't want
190
+ // to split those repairing transactions in prosemirror-history when they're being added to the
191
+ // "done" stack
192
+
193
+ var isPastingTable = tr.steps.some(function (step) {
194
+ var _slice$content;
195
+
196
+ var slice = extractSliceFromStep(step);
197
+ var tableExists = false;
198
+ slice === null || slice === void 0 ? void 0 : (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.forEach(function (node) {
199
+ if (node.type === state.schema.nodes.table) {
200
+ tableExists = true;
201
+ }
202
+ });
203
+ return tableExists;
204
+ });
187
205
 
188
- 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) {
206
+ if (!isPastingTextInsidePlaceholderText && !isPastingTable) {
189
207
  tr.setMeta(betterTypePluginKey, true);
190
208
  }
191
209
 
@@ -308,6 +326,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
308
326
 
309
327
  if (!insideTable(state)) {
310
328
  slice = transformSliceNestedExpandToExpand(slice, state.schema);
329
+ } // Create a custom handler to avoid handling with handleRichText method
330
+ // As SafeInsert is used inside handleRichText which caused some bad UX like this:
331
+ // https://product-fabric.atlassian.net/browse/MEX-1520
332
+
333
+
334
+ if (handlePasteIntoCaptionWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
335
+ return true;
311
336
  }
312
337
 
313
338
  return handleRichTextWithAnalytics(view, event, slice)(state, dispatch);
@@ -1,4 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { browser } from '@atlaskit/editor-common/utils';
2
3
  import { PluginKey } from 'prosemirror-state';
3
4
  import { DecorationSet, Decoration } from 'prosemirror-view';
4
5
  import { isInEmptyLine, isEmptyDocument, bracketTyped } from '../../utils/document';
@@ -27,7 +28,17 @@ export function createPlaceholderDecoration(editorState, placeholderText) {
27
28
  placeholderDecoration.className = placeHolderClass;
28
29
  var placeholderNode = document.createElement('span');
29
30
  placeholderNode.textContent = placeholderText;
30
- placeholderDecoration.appendChild(placeholderNode);
31
+ placeholderDecoration.appendChild(placeholderNode); // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
32
+ // Add a editable buff node as the cursor moving forward is inevitable
33
+ // when backspace in GBoard composition
34
+
35
+ if (browser.android && browser.chrome) {
36
+ var buffNode = document.createElement('span');
37
+ buffNode.setAttribute('contenteditable', 'true');
38
+ buffNode.textContent = ' ';
39
+ placeholderDecoration.appendChild(buffNode);
40
+ }
41
+
31
42
  return DecorationSet.create(editorState.doc, [Decoration.widget(pos, placeholderDecoration, {
32
43
  side: -1,
33
44
  key: 'placeholder'