@atlaskit/editor-core 166.0.4 → 167.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/.eslintrc.js +46 -1
  2. package/CHANGELOG.md +87 -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/base/index.js +8 -17
  15. package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
  16. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
  17. package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
  18. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
  19. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
  20. package/dist/cjs/plugins/card/styles.js +1 -1
  21. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  22. package/dist/cjs/plugins/code-block/actions.js +36 -2
  23. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
  24. package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
  25. package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
  26. package/dist/cjs/plugins/code-block/styles.js +28 -24
  27. package/dist/cjs/plugins/collab-edit/styles.js +4 -2
  28. package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
  29. package/dist/cjs/plugins/collab-edit/utils.js +1 -0
  30. package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
  31. package/dist/cjs/plugins/expand/ui/styles.js +16 -14
  32. package/dist/cjs/plugins/extension/commands.js +3 -2
  33. package/dist/cjs/plugins/extension/context-panel.js +21 -7
  34. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
  35. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
  36. package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
  37. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
  38. package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
  39. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  40. package/dist/cjs/plugins/find-replace/styles.js +2 -6
  41. package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
  42. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
  43. package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
  44. package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
  45. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
  46. package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
  47. package/dist/cjs/plugins/grid/styles.js +3 -1
  48. package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
  49. package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
  50. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
  51. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -3
  52. package/dist/cjs/plugins/hyperlink/utils.js +53 -2
  53. package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
  54. package/dist/cjs/plugins/layout/styles.js +1 -1
  55. package/dist/cjs/plugins/media/commands/helpers.js +10 -9
  56. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +23 -4
  57. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
  58. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
  59. package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
  60. package/dist/cjs/plugins/media/styles.js +1 -1
  61. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
  62. package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
  63. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
  64. package/dist/cjs/plugins/mentions/styles.js +3 -1
  65. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
  66. package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
  67. package/dist/cjs/plugins/panel/index.js +1 -0
  68. package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
  69. package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
  70. package/dist/cjs/plugins/paste/handlers.js +23 -0
  71. package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
  72. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
  73. package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
  74. package/dist/cjs/plugins/placeholder/index.js +15 -3
  75. package/dist/cjs/plugins/placeholder/styles.js +3 -1
  76. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  77. package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
  78. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  79. package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
  80. package/dist/cjs/plugins/table/index.js +14 -4
  81. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
  82. package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
  83. package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
  84. package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
  85. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  86. package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  87. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  88. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  89. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  90. package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
  91. package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
  92. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
  93. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
  94. package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
  95. package/dist/cjs/plugins/table/ui/consts.js +14 -11
  96. package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
  97. package/dist/cjs/plugins/table/utils/decoration.js +3 -4
  98. package/dist/cjs/plugins/table/utils/paste.js +9 -9
  99. package/dist/cjs/plugins/type-ahead/index.js +4 -3
  100. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
  101. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  102. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
  103. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
  104. package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
  105. package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
  106. package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
  107. package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
  108. package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
  109. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
  110. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
  111. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  112. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  113. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
  114. package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
  115. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +21 -14
  116. package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  117. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
  118. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
  119. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
  120. package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
  121. package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
  122. package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
  123. package/dist/cjs/ui/ContentStyles/index.js +4 -2
  124. package/dist/cjs/ui/ContextPanel/index.js +3 -1
  125. package/dist/cjs/ui/DropdownMenu/index.js +5 -0
  126. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
  127. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
  128. package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
  129. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  130. package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
  131. package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
  132. package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
  133. package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
  134. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
  135. package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
  136. package/dist/cjs/ui/PluginSlot/index.js +7 -4
  137. package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
  138. package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
  139. package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
  140. package/dist/cjs/ui/WithFlash/index.js +4 -2
  141. package/dist/cjs/ui/styles.js +6 -4
  142. package/dist/cjs/utils/document.js +62 -6
  143. package/dist/cjs/utils/filter/privacy-filter.js +2 -2
  144. package/dist/cjs/utils/step.js +17 -1
  145. package/dist/cjs/version-wrapper.js +1 -1
  146. package/dist/cjs/version.json +1 -1
  147. package/dist/es2019/actions/index.js +25 -1
  148. package/dist/es2019/create-editor/ReactEditorView.js +2 -0
  149. package/dist/es2019/create-editor/create-plugins-list.js +1 -2
  150. package/dist/es2019/editor.js +5 -2
  151. package/dist/es2019/keymaps/index.js +5 -1
  152. package/dist/es2019/labs/next/ContentComponents.js +7 -2
  153. package/dist/es2019/labs/next/full-page.js +11 -8
  154. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
  155. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
  156. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  157. package/dist/es2019/plugins/analytics/types/enums.js +3 -0
  158. package/dist/es2019/plugins/base/index.js +6 -15
  159. package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
  160. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  161. package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
  162. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  163. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
  164. package/dist/es2019/plugins/card/styles.js +1 -1
  165. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  166. package/dist/es2019/plugins/code-block/actions.js +32 -0
  167. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
  168. package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
  169. package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
  170. package/dist/es2019/plugins/code-block/styles.js +30 -27
  171. package/dist/es2019/plugins/collab-edit/styles.js +3 -2
  172. package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
  173. package/dist/es2019/plugins/collab-edit/utils.js +1 -0
  174. package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
  175. package/dist/es2019/plugins/expand/ui/styles.js +15 -14
  176. package/dist/es2019/plugins/extension/commands.js +3 -2
  177. package/dist/es2019/plugins/extension/context-panel.js +11 -3
  178. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  179. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  180. package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
  181. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
  182. package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
  183. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  184. package/dist/es2019/plugins/find-replace/styles.js +4 -4
  185. package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
  186. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  187. package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  188. package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
  189. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
  190. package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
  191. package/dist/es2019/plugins/grid/styles.js +4 -2
  192. package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
  193. package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  194. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  195. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
  196. package/dist/es2019/plugins/hyperlink/utils.js +43 -2
  197. package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
  198. package/dist/es2019/plugins/layout/styles.js +10 -7
  199. package/dist/es2019/plugins/media/commands/helpers.js +6 -8
  200. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
  201. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
  202. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
  203. package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
  204. package/dist/es2019/plugins/media/styles.js +3 -3
  205. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  206. package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
  207. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  208. package/dist/es2019/plugins/mentions/styles.js +5 -4
  209. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
  210. package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
  211. package/dist/es2019/plugins/panel/index.js +1 -0
  212. package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
  213. package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
  214. package/dist/es2019/plugins/paste/handlers.js +23 -0
  215. package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
  216. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
  217. package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
  218. package/dist/es2019/plugins/placeholder/index.js +12 -1
  219. package/dist/es2019/plugins/placeholder/styles.js +3 -1
  220. package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
  221. package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
  222. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  223. package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
  224. package/dist/es2019/plugins/table/index.js +13 -4
  225. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
  226. package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
  227. package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
  228. package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
  229. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  230. package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
  231. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
  232. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  233. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  234. package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
  235. package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
  236. package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
  237. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
  238. package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
  239. package/dist/es2019/plugins/table/ui/consts.js +15 -12
  240. package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
  241. package/dist/es2019/plugins/table/utils/decoration.js +1 -4
  242. package/dist/es2019/plugins/table/utils/paste.js +9 -9
  243. package/dist/es2019/plugins/type-ahead/index.js +4 -3
  244. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  245. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  246. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  247. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
  248. package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
  249. package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
  250. package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
  251. package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
  252. package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
  253. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
  254. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
  255. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  256. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  257. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
  258. package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
  259. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
  260. package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  261. package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  262. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  263. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
  264. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  265. package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  266. package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
  267. package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
  268. package/dist/es2019/ui/ContentStyles/index.js +3 -2
  269. package/dist/es2019/ui/ContextPanel/index.js +2 -1
  270. package/dist/es2019/ui/DropdownMenu/index.js +5 -0
  271. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
  272. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  273. package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
  274. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
  275. package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  276. package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  277. package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
  278. package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
  279. package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
  280. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
  281. package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
  282. package/dist/es2019/ui/PluginSlot/index.js +7 -4
  283. package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
  284. package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  285. package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
  286. package/dist/es2019/ui/WithFlash/index.js +4 -3
  287. package/dist/es2019/ui/styles.js +10 -9
  288. package/dist/es2019/utils/document.js +58 -5
  289. package/dist/es2019/utils/filter/privacy-filter.js +1 -1
  290. package/dist/es2019/utils/step.js +12 -1
  291. package/dist/es2019/version-wrapper.js +1 -1
  292. package/dist/es2019/version.json +1 -1
  293. package/dist/esm/actions/index.js +26 -1
  294. package/dist/esm/create-editor/ReactEditorView.js +2 -0
  295. package/dist/esm/create-editor/create-plugins-list.js +1 -2
  296. package/dist/esm/editor.js +5 -2
  297. package/dist/esm/keymaps/index.js +5 -1
  298. package/dist/esm/labs/next/ContentComponents.js +8 -4
  299. package/dist/esm/labs/next/full-page.js +11 -8
  300. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
  301. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
  302. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
  303. package/dist/esm/plugins/analytics/types/enums.js +3 -0
  304. package/dist/esm/plugins/base/index.js +8 -17
  305. package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
  306. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
  307. package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
  308. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
  309. package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
  310. package/dist/esm/plugins/card/styles.js +1 -1
  311. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
  312. package/dist/esm/plugins/code-block/actions.js +28 -0
  313. package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
  314. package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
  315. package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
  316. package/dist/esm/plugins/code-block/styles.js +27 -23
  317. package/dist/esm/plugins/collab-edit/styles.js +3 -2
  318. package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
  319. package/dist/esm/plugins/collab-edit/utils.js +2 -0
  320. package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
  321. package/dist/esm/plugins/expand/ui/styles.js +15 -14
  322. package/dist/esm/plugins/extension/commands.js +3 -2
  323. package/dist/esm/plugins/extension/context-panel.js +21 -7
  324. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
  325. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
  326. package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
  327. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
  328. package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
  329. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
  330. package/dist/esm/plugins/find-replace/styles.js +3 -3
  331. package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
  332. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  333. package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
  334. package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
  335. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
  336. package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
  337. package/dist/esm/plugins/grid/styles.js +2 -1
  338. package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
  339. package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
  340. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
  341. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +4 -3
  342. package/dist/esm/plugins/hyperlink/utils.js +44 -2
  343. package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
  344. package/dist/esm/plugins/layout/styles.js +1 -1
  345. package/dist/esm/plugins/media/commands/helpers.js +6 -8
  346. package/dist/esm/plugins/media/nodeviews/mediaInline.js +22 -4
  347. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
  348. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
  349. package/dist/esm/plugins/media/pm-plugins/main.js +2 -0
  350. package/dist/esm/plugins/media/styles.js +1 -1
  351. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
  352. package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
  353. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
  354. package/dist/esm/plugins/mentions/styles.js +2 -1
  355. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
  356. package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
  357. package/dist/esm/plugins/panel/index.js +1 -0
  358. package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
  359. package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
  360. package/dist/esm/plugins/paste/handlers.js +21 -0
  361. package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
  362. package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
  363. package/dist/esm/plugins/paste/pm-plugins/main.js +27 -2
  364. package/dist/esm/plugins/placeholder/index.js +12 -1
  365. package/dist/esm/plugins/placeholder/styles.js +2 -1
  366. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  367. package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
  368. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
  369. package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
  370. package/dist/esm/plugins/table/index.js +13 -4
  371. package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
  372. package/dist/esm/plugins/table/nodeviews/table.js +6 -2
  373. package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
  374. package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
  375. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
  376. package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
  377. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
  378. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
  379. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
  380. package/dist/esm/plugins/table/transforms/column-width.js +1 -2
  381. package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
  382. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
  383. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
  384. package/dist/esm/plugins/table/ui/common-styles.js +4 -2
  385. package/dist/esm/plugins/table/ui/consts.js +15 -12
  386. package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
  387. package/dist/esm/plugins/table/utils/decoration.js +3 -4
  388. package/dist/esm/plugins/table/utils/paste.js +9 -9
  389. package/dist/esm/plugins/type-ahead/index.js +4 -3
  390. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
  391. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
  392. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
  393. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
  394. package/dist/esm/plugins/unsupported-content/styles.js +1 -1
  395. package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
  396. package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
  397. package/dist/esm/ui/Appearance/Chromeless.js +2 -1
  398. package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
  399. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
  400. package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
  401. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
  402. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
  403. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
  404. package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
  405. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +21 -14
  406. package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
  407. package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
  408. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
  409. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
  410. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  411. package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
  412. package/dist/esm/ui/ConfigPanel/Header.js +3 -2
  413. package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
  414. package/dist/esm/ui/ContentStyles/index.js +3 -2
  415. package/dist/esm/ui/ContextPanel/index.js +2 -1
  416. package/dist/esm/ui/DropdownMenu/index.js +5 -0
  417. package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
  418. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
  419. package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
  420. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
  421. package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
  422. package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
  423. package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
  424. package/dist/esm/ui/ElementBrowser/constants.js +3 -1
  425. package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
  426. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
  427. package/dist/esm/ui/PanelTextInput/styles.js +4 -3
  428. package/dist/esm/ui/PluginSlot/index.js +7 -4
  429. package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
  430. package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
  431. package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
  432. package/dist/esm/ui/WithFlash/index.js +3 -2
  433. package/dist/esm/ui/styles.js +5 -4
  434. package/dist/esm/utils/document.js +59 -5
  435. package/dist/esm/utils/filter/privacy-filter.js +1 -1
  436. package/dist/esm/utils/step.js +12 -1
  437. package/dist/esm/version-wrapper.js +1 -1
  438. package/dist/esm/version.json +1 -1
  439. package/dist/types/actions/index.d.ts +6 -0
  440. package/dist/types/labs/next/ContentComponents.d.ts +7 -1
  441. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
  442. package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
  443. package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
  444. package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
  445. package/dist/types/plugins/code-block/actions.d.ts +2 -0
  446. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
  447. package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
  448. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
  449. package/dist/types/plugins/extension/commands.d.ts +1 -1
  450. package/dist/types/plugins/extension/types.d.ts +1 -0
  451. package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
  452. package/dist/types/plugins/find-replace/styles.d.ts +0 -2
  453. package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
  454. package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
  455. package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
  456. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
  457. package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
  458. package/dist/types/plugins/paste/handlers.d.ts +1 -0
  459. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
  460. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  461. package/dist/types/plugins/table/index.d.ts +0 -1
  462. package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
  463. package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
  464. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  465. package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
  466. package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
  467. package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
  468. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
  469. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  470. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
  471. package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
  472. package/dist/types/plugins/table/types.d.ts +0 -1
  473. package/dist/types/plugins/table/ui/consts.d.ts +9 -9
  474. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
  475. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
  476. package/dist/types/types/editor-appearance-component.d.ts +0 -1
  477. package/dist/types/types/editor-props.d.ts +4 -0
  478. package/dist/types/types/feature-flags.d.ts +8 -0
  479. package/dist/types/types/ui-components.d.ts +1 -0
  480. package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
  481. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
  482. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
  483. package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
  484. package/dist/types/ui/PluginSlot/index.d.ts +1 -0
  485. package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
  486. package/dist/types/utils/document.d.ts +1 -0
  487. package/dist/types/utils/step.d.ts +1 -0
  488. package/docs/0-intro.tsx +12 -4
  489. package/package.json +20 -20
@@ -31,6 +31,8 @@ var _utils = require("../../../utils");
31
31
 
32
32
  var _adfSchema = require("@atlaskit/adf-schema");
33
33
 
34
+ var _editorTables = require("@atlaskit/editor-tables");
35
+
34
36
  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; } } }; }
35
37
 
36
38
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -75,14 +77,18 @@ function setBlockTypeWithAnalytics(name, inputMethod) {
75
77
 
76
78
  function setNormalText() {
77
79
  return function (state, dispatch) {
78
- var tr = state.tr,
79
- _state$selection = state.selection,
80
- $from = _state$selection.$from,
81
- $to = _state$selection.$to,
82
- schema = state.schema;
80
+ var selection = state.selection,
81
+ schema = state.schema,
82
+ tr = state.tr;
83
+ var ranges = selection instanceof _editorTables.CellSelection ? selection.ranges : [selection];
84
+ ranges.forEach(function (_ref) {
85
+ var $from = _ref.$from,
86
+ $to = _ref.$to;
87
+ tr.setBlockType($from.pos, $to.pos, schema.nodes.paragraph);
88
+ });
83
89
 
84
90
  if (dispatch) {
85
- dispatch(tr.setBlockType($from.pos, $to.pos, schema.nodes.paragraph));
91
+ dispatch(tr);
86
92
  }
87
93
 
88
94
  return true;
@@ -145,16 +151,20 @@ function setNormalTextWithAnalytics(inputMethod) {
145
151
 
146
152
  function setHeading(level) {
147
153
  return function (state, dispatch) {
148
- var tr = state.tr,
149
- _state$selection2 = state.selection,
150
- $from = _state$selection2.$from,
151
- $to = _state$selection2.$to,
152
- schema = state.schema;
154
+ var selection = state.selection,
155
+ schema = state.schema,
156
+ tr = state.tr;
157
+ var ranges = selection instanceof _editorTables.CellSelection ? selection.ranges : [selection];
158
+ ranges.forEach(function (_ref2) {
159
+ var $from = _ref2.$from,
160
+ $to = _ref2.$to;
161
+ tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
162
+ level: level
163
+ });
164
+ });
153
165
 
154
166
  if (dispatch) {
155
- dispatch(tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
156
- level: level
157
- }));
167
+ dispatch(tr);
158
168
  }
159
169
 
160
170
  return true;
@@ -264,9 +274,9 @@ exports.insertBlockTypesWithAnalytics = insertBlockTypesWithAnalytics;
264
274
  function wrapSelectionIn(type) {
265
275
  return function (state, dispatch) {
266
276
  var tr = state.tr;
267
- var _state$selection3 = state.selection,
268
- $from = _state$selection3.$from,
269
- $to = _state$selection3.$to;
277
+ var _state$selection = state.selection,
278
+ $from = _state$selection.$from,
279
+ $to = _state$selection.$to;
270
280
  var _state$schema$marks = state.schema.marks,
271
281
  alignment = _state$schema$marks.alignment,
272
282
  indentation = _state$schema$marks.indentation;
@@ -301,9 +311,9 @@ function insertCodeBlock() {
301
311
  var _state$selection$$fro;
302
312
 
303
313
  var tr = state.tr;
304
- var _state$selection4 = state.selection,
305
- $to = _state$selection4.$to,
306
- $from = _state$selection4.$from;
314
+ var _state$selection2 = state.selection,
315
+ $to = _state$selection2.$to,
316
+ $from = _state$selection2.$from;
307
317
  var codeBlock = state.schema.nodes.codeBlock;
308
318
  var grandParentType = (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type;
309
319
  var parentType = state.selection.$from.parent.type;
@@ -327,8 +337,8 @@ function insertCodeBlock() {
327
337
  }
328
338
 
329
339
  var cleanUpAtTheStartOfDocument = function cleanUpAtTheStartOfDocument(state, dispatch) {
330
- var _ref = state.selection,
331
- $cursor = _ref.$cursor;
340
+ var _ref3 = state.selection,
341
+ $cursor = _ref3.$cursor;
332
342
 
333
343
  if ($cursor && !$cursor.nodeBefore && !$cursor.nodeAfter && $cursor.pos === 1) {
334
344
  var tr = state.tr,
@@ -17,11 +17,13 @@ var _styles = require("@atlaskit/editor-common/styles");
17
17
 
18
18
  var _styles2 = require("../../../../ui/styles");
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _templateObject, _templateObject2, _templateObject3;
21
23
 
22
24
  var blockTypeMenuItemStyle = function blockTypeMenuItemStyle(tagName, selected) {
23
25
  // TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
24
- var selectedStyle = selected ? "".concat(tagName, " { color: white !important; }") : '';
26
+ var selectedStyle = selected ? "".concat(tagName, " { color: ").concat((0, _tokens.token)('color.text.inverse', 'white'), " !important; }") : '';
25
27
  return function (themeProps) {
26
28
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-top: 0;\n }\n }\n ", ";\n "])), (0, _styles.headingsSharedStyles)(themeProps), selectedStyle);
27
29
  };
@@ -30,5 +32,5 @@ var blockTypeMenuItemStyle = function blockTypeMenuItemStyle(tagName, selected)
30
32
  exports.blockTypeMenuItemStyle = blockTypeMenuItemStyle;
31
33
  var keyboardShortcut = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n margin-left: 16px;\n"])), _styles2.shortcutStyle);
32
34
  exports.keyboardShortcut = keyboardShortcut;
33
- var keyboardShortcutSelect = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.N400);
35
+ var keyboardShortcutSelect = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _tokens.token)('color.icon', _colors.N400));
34
36
  exports.keyboardShortcutSelect = keyboardShortcutSelect;
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -29,7 +27,7 @@ var _react = _interopRequireDefault(require("react"));
29
27
 
30
28
  var _react2 = require("@emotion/react");
31
29
 
32
- var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
30
+ var _colors = require("@atlaskit/theme/colors");
33
31
 
34
32
  var _reactIntlNext = require("react-intl-next");
35
33
 
@@ -61,20 +59,15 @@ var _prosemirrorState = require("prosemirror-state");
61
59
 
62
60
  var _isSupportedNode = require("../utils/is-supported-node");
63
61
 
64
- var _templateObject;
65
-
66
- 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); }
62
+ var _tokens = require("@atlaskit/tokens");
67
63
 
68
- 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; }
64
+ var _templateObject;
69
65
 
70
66
  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); }; }
71
67
 
72
68
  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; } }
73
69
 
74
- var B300 = colors.B300,
75
- N300 = colors.N300,
76
- N20A = colors.N20A;
77
- var toolbarButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: white !important;\n }\n }\n"])), N20A, N300, B300);
70
+ var toolbarButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: ", " !important;\n }\n }\n"])), (0, _tokens.token)('color.background.neutral', _colors.N20A), (0, _tokens.token)('color.icon', _colors.N300), (0, _tokens.token)('color.background.neutral.hovered', _colors.B300), (0, _tokens.token)('color.icon', 'white'));
78
71
  var BREAKOUT_MODE = {
79
72
  FULL_WIDTH: 'full-width',
80
73
  CENTER: 'center',
@@ -21,5 +21,5 @@ var _tokens = require("@atlaskit/tokens");
21
21
 
22
22
  var _templateObject;
23
23
 
24
- var smartCardStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n"])), _styles.SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _styles.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _colors.N20, _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _styles.SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), (0, _tokens.token)('color.background.danger', _editorSharedStyles.akEditorDeleteBackground), (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder));
24
+ var smartCardStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n"])), _styles.SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _styles.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _tokens.token)('color.background.neutral.subtle.hovered', _colors.N20), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _styles.SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _styles.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), (0, _tokens.token)('color.background.danger', _editorSharedStyles.akEditorDeleteBackground), (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder));
25
25
  exports.smartCardStyles = smartCardStyles;
@@ -36,7 +36,7 @@ var iconBoxStyles = (0, _react2.css)({
36
36
  width: ICON_HEIGHT,
37
37
  height: ICON_WIDTH,
38
38
  overflow: 'hidden',
39
- border: '1px solid rgba(223, 225, 229, 0.5)'
39
+ border: "1px solid ".concat((0, _tokens.token)('color.border', 'rgba(223, 225, 229, 0.5)'))
40
40
  /* N60 at 50% */
41
41
  ,
42
42
  borderRadius: (0, _constants.borderRadius)(),
@@ -44,7 +44,7 @@ var iconBoxStyles = (0, _react2.css)({
44
44
  display: 'flex',
45
45
  justifyContent: 'center',
46
46
  alignItems: 'center',
47
- backgroundColor: (0, _tokens.token)('color.background.default', 'white')
47
+ backgroundColor: (0, _tokens.token)('elevation.surface', 'white')
48
48
  });
49
49
  var primitiveStyles = (0, _react2.css)({
50
50
  padding: '0.75rem',
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.resetCopiedState = exports.removeCodeBlock = exports.copyContentToClipboard = exports.changeLanguage = void 0;
6
+ exports.resetShouldIgnoreFollowingMutations = exports.resetCopiedState = exports.removeCodeBlock = exports.ignoreFollowingMutations = exports.copyContentToClipboard = exports.changeLanguage = void 0;
7
7
 
8
8
  var _prosemirrorUtils = require("prosemirror-utils");
9
9
 
@@ -119,4 +119,38 @@ var resetCopiedState = function resetCopiedState(state, dispatch) {
119
119
  return true;
120
120
  };
121
121
 
122
- exports.resetCopiedState = resetCopiedState;
122
+ exports.resetCopiedState = resetCopiedState;
123
+
124
+ var ignoreFollowingMutations = function ignoreFollowingMutations(state, dispatch) {
125
+ var tr = state.tr;
126
+ var ignoreFollowingMutationsTr = tr;
127
+ ignoreFollowingMutationsTr.setMeta(_pluginKey.pluginKey, {
128
+ type: _actions.ACTIONS.SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS,
129
+ data: true
130
+ });
131
+
132
+ if (dispatch) {
133
+ dispatch(ignoreFollowingMutationsTr);
134
+ }
135
+
136
+ return true;
137
+ };
138
+
139
+ exports.ignoreFollowingMutations = ignoreFollowingMutations;
140
+
141
+ var resetShouldIgnoreFollowingMutations = function resetShouldIgnoreFollowingMutations(state, dispatch) {
142
+ var tr = state.tr;
143
+ var ignoreFollowingMutationsTr = tr;
144
+ ignoreFollowingMutationsTr.setMeta(_pluginKey.pluginKey, {
145
+ type: _actions.ACTIONS.SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS,
146
+ data: false
147
+ });
148
+
149
+ if (dispatch) {
150
+ dispatch(ignoreFollowingMutationsTr);
151
+ }
152
+
153
+ return true;
154
+ };
155
+
156
+ exports.resetShouldIgnoreFollowingMutations = resetShouldIgnoreFollowingMutations;
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.codeBlockNodeView = exports.CodeBlockView = void 0;
9
9
 
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+
10
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
13
 
12
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -15,10 +17,16 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
15
17
 
16
18
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
17
19
 
20
+ var _utils = require("@atlaskit/editor-common/utils");
21
+
18
22
  var _prosemirrorModel = require("prosemirror-model");
19
23
 
20
24
  var _classNames = require("../ui/class-names");
21
25
 
26
+ var _actions = require("../actions");
27
+
28
+ var _mainState = require("../pm-plugins/main-state");
29
+
22
30
  var MATCH_NEWLINES = new RegExp('\n', 'g');
23
31
 
24
32
  var toDOM = function toDOM(node) {
@@ -75,6 +83,56 @@ var CodeBlockView = /*#__PURE__*/function () {
75
83
  }
76
84
 
77
85
  (0, _createClass2.default)(CodeBlockView, [{
86
+ key: "updateDOMAndSelection",
87
+ value: function updateDOMAndSelection(savedInnerHTML, newCursorPosition) {
88
+ var _this$dom;
89
+
90
+ if ((_this$dom = this.dom) !== null && _this$dom !== void 0 && _this$dom.childNodes && this.dom.childNodes.length > 1) {
91
+ var _contentView$childNod;
92
+
93
+ var contentView = this.dom.childNodes[1];
94
+
95
+ if ((contentView === null || contentView === void 0 ? void 0 : (_contentView$childNod = contentView.childNodes) === null || _contentView$childNod === void 0 ? void 0 : _contentView$childNod.length) > 0) {
96
+ var codeElement = contentView.firstChild;
97
+ codeElement.innerHTML = savedInnerHTML; // We need to set cursor for the DOM update
98
+
99
+ var textElement = (0, _toConsumableArray2.default)(codeElement.childNodes).find(function (child) {
100
+ return child.nodeName === '#text';
101
+ });
102
+ var sel = window.getSelection();
103
+ var range = document.createRange();
104
+ range.setStart(textElement, newCursorPosition);
105
+ range.collapse(true);
106
+ sel === null || sel === void 0 ? void 0 : sel.removeAllRanges();
107
+ sel === null || sel === void 0 ? void 0 : sel.addRange(range);
108
+ }
109
+ }
110
+ }
111
+ }, {
112
+ key: "coalesceDOMElements",
113
+ value: function coalesceDOMElements() {
114
+ var _this$dom2;
115
+
116
+ if ((_this$dom2 = this.dom) !== null && _this$dom2 !== void 0 && _this$dom2.childNodes && this.dom.childNodes.length > 1) {
117
+ var contentView = this.dom.childNodes[1];
118
+
119
+ if (contentView !== null && contentView !== void 0 && contentView.childNodes && contentView.childNodes.length > 1) {
120
+ var savedInnerHTML = '';
121
+
122
+ while (contentView.childNodes.length > 1) {
123
+ var lastChild = contentView.lastChild;
124
+ savedInnerHTML = lastChild.innerHTML + savedInnerHTML;
125
+ contentView.removeChild(lastChild);
126
+ }
127
+
128
+ var firstChild = contentView.firstChild;
129
+ savedInnerHTML = firstChild.innerHTML + '\n' + savedInnerHTML;
130
+ var newCursorPosition = firstChild.innerHTML.length + 1;
131
+ setTimeout(this.updateDOMAndSelection.bind(this, savedInnerHTML, newCursorPosition), 20);
132
+ }
133
+ }
134
+ }
135
+ }, {
78
136
  key: "update",
79
137
  value: function update(node) {
80
138
  if (node.type !== this.node.type) {
@@ -88,6 +146,11 @@ var CodeBlockView = /*#__PURE__*/function () {
88
146
 
89
147
  this.node = node;
90
148
  this.ensureLineNumbers();
149
+
150
+ if (_utils.browser.android) {
151
+ this.coalesceDOMElements();
152
+ (0, _actions.resetShouldIgnoreFollowingMutations)(this.view.state, this.view.dispatch);
153
+ }
91
154
  }
92
155
 
93
156
  return true;
@@ -95,7 +158,13 @@ var CodeBlockView = /*#__PURE__*/function () {
95
158
  }, {
96
159
  key: "ignoreMutation",
97
160
  value: function ignoreMutation(record) {
98
- // Ensure updating the line-number gutter doesn't trigger reparsing the codeblock
161
+ var pluginState = (0, _mainState.getPluginState)(this.view.state);
162
+
163
+ if (pluginState !== null && pluginState !== void 0 && pluginState.shouldIgnoreFollowingMutations) {
164
+ return true;
165
+ } // Ensure updating the line-number gutter doesn't trigger reparsing the codeblock
166
+
167
+
99
168
  return record.target === this.lineNumberGutter || record.target.parentNode === this.lineNumberGutter;
100
169
  }
101
170
  }]);
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ACTIONS = void 0;
7
7
  var ACTIONS = {
8
- SET_COPIED_TO_CLIPBOARD: 'SET_COPIED_TO_CLIPBOARD'
8
+ SET_COPIED_TO_CLIPBOARD: 'SET_COPIED_TO_CLIPBOARD',
9
+ SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS: 'SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS'
9
10
  };
10
11
  exports.ACTIONS = ACTIONS;
@@ -11,6 +11,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
 
12
12
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
13
 
14
+ var _utils = require("@atlaskit/editor-common/utils");
15
+
14
16
  var _prosemirrorState = require("prosemirror-state");
15
17
 
16
18
  var _messages = require("@atlaskit/editor-common/messages");
@@ -19,13 +21,15 @@ var _codeBlock = require("../nodeviews/code-block");
19
21
 
20
22
  var _highlightingCodeBlock = require("../nodeviews/highlighting-code-block");
21
23
 
22
- var _utils = require("../../selection/utils");
24
+ var _utils2 = require("../../selection/utils");
23
25
 
24
26
  var _pluginKey = require("../plugin-key");
25
27
 
26
28
  var _actions = require("./actions");
27
29
 
28
- var _utils2 = require("../utils");
30
+ var _actions2 = require("../actions");
31
+
32
+ var _utils3 = require("../utils");
29
33
 
30
34
  var _classNames = require("../ui/class-names");
31
35
 
@@ -49,10 +53,39 @@ var createPlugin = function createPlugin(_ref) {
49
53
 
50
54
  if (allowCompositionInputOverride) {
51
55
  handleDOMEvents.beforeinput = function (view, event) {
52
- if (event.composed && // insertParagraph will be the input type when the enter key is pressed.
53
- event.inputType === 'insertParagraph' && (0, _utils2.findCodeBlock)(view.state, view.state.selection)) {
56
+ var keyEvent = event;
57
+ var eventInputType = keyEvent.inputType;
58
+ var eventText = keyEvent.data;
59
+
60
+ if (_utils.browser.ios && event.composed && // insertParagraph will be the input type when the enter key is pressed.
61
+ eventInputType === 'insertParagraph' && (0, _utils3.findCodeBlock)(view.state, view.state.selection)) {
54
62
  event.preventDefault();
55
63
  return true;
64
+ } else if (_utils.browser.android && event.composed && eventInputType === 'insertCompositionText' && eventText[(eventText === null || eventText === void 0 ? void 0 : eventText.length) - 1] === '\n' && (0, _utils3.findCodeBlock)(view.state, view.state.selection)) {
65
+ var resultingText = event.target.outerText + '\n';
66
+
67
+ if (resultingText.endsWith(eventText)) {
68
+ // End of paragraph
69
+ setTimeout(function () {
70
+ view.someProp('handleKeyDown', function (f) {
71
+ return f(view, new KeyboardEvent('keydown', {
72
+ bubbles: true,
73
+ cancelable: true,
74
+ key: 'Enter',
75
+ code: 'Enter'
76
+ }));
77
+ });
78
+ }, 0);
79
+ } else {
80
+ // Middle of paragraph, end of line
81
+ (0, _actions2.ignoreFollowingMutations)(view.state, view.dispatch);
82
+ }
83
+
84
+ return true;
85
+ }
86
+
87
+ if (_utils.browser.android) {
88
+ (0, _actions2.resetShouldIgnoreFollowingMutations)(view.state, view.dispatch);
56
89
  }
57
90
 
58
91
  return false;
@@ -62,16 +95,17 @@ var createPlugin = function createPlugin(_ref) {
62
95
  return new _safePlugin.SafePlugin({
63
96
  state: {
64
97
  init: function init(_, state) {
65
- var node = (0, _utils2.findCodeBlock)(state, state.selection);
98
+ var node = (0, _utils3.findCodeBlock)(state, state.selection);
66
99
  return {
67
100
  pos: node ? node.pos : null,
68
101
  contentCopied: false,
69
- isNodeSelected: false
102
+ isNodeSelected: false,
103
+ shouldIgnoreFollowingMutations: false
70
104
  };
71
105
  },
72
106
  apply: function apply(tr, pluginState, _oldState, newState) {
73
107
  if (tr.docChanged || tr.selectionSet) {
74
- var node = (0, _utils2.findCodeBlock)(newState, tr.selection);
108
+ var node = (0, _utils3.findCodeBlock)(newState, tr.selection);
75
109
 
76
110
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
77
111
  pos: node ? node.pos : null,
@@ -87,6 +121,10 @@ var createPlugin = function createPlugin(_ref) {
87
121
  return _objectSpread(_objectSpread({}, pluginState), {}, {
88
122
  contentCopied: meta.data
89
123
  });
124
+ } else if ((meta === null || meta === void 0 ? void 0 : meta.type) === _actions.ACTIONS.SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS) {
125
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
126
+ shouldIgnoreFollowingMutations: meta.data
127
+ });
90
128
  }
91
129
 
92
130
  return pluginState;
@@ -111,7 +149,7 @@ var createPlugin = function createPlugin(_ref) {
111
149
  return createCodeBlockNodeView(node, view, getPos);
112
150
  }
113
151
  },
114
- handleClickOn: (0, _utils.createSelectionClickHandler)(['codeBlock'], function (target) {
152
+ handleClickOn: (0, _utils2.createSelectionClickHandler)(['codeBlock'], function (target) {
115
153
  return !!(target.closest(".".concat(_classNames.codeBlockClassNames.gutter)) || target.classList.contains(_classNames.codeBlockClassNames.content));
116
154
  }, {
117
155
  useLongPressSelection: useLongPressSelection
@@ -19,10 +19,10 @@ var _constants = require("@atlaskit/theme/constants");
19
19
 
20
20
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
21
21
 
22
- var _tokens = require("@atlaskit/tokens");
23
-
24
22
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
25
23
 
24
+ var _tokens = require("@atlaskit/tokens");
25
+
26
26
  var _classNames = require("./ui/class-names");
27
27
 
28
28
  var _templateObject, _templateObject2;
@@ -32,52 +32,56 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
32
32
  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; }
33
33
 
34
34
  var highlightingCodeBlockStyles = function highlightingCodeBlockStyles(props) {
35
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n background-repeat: no-repeat;\n background-color: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n color: ", ";\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n overflow: hidden;\n tab-size: 4;\n\n & [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n\n .", " {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 1;\n\n > code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n\n &[data-debounce='true'] {\n .", " {\n display: none;\n }\n }\n\n &:not([data-debounce='true']) {\n > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {\n color: transparent;\n caret-color: ", ";\n }\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), (0, _editorSharedStyles.overflowShadow)({
35
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n background-repeat: no-repeat;\n background-color: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n color: ", ";\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n overflow: hidden;\n tab-size: 4;\n\n & [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n\n .", " {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 1;\n\n > code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n\n &[data-debounce='true'] {\n .", " {\n display: none;\n }\n }\n\n &:not([data-debounce='true']) {\n > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {\n color: transparent;\n caret-color: ", ";\n }\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), (0, _editorSharedStyles.overflowShadow)({
36
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
37
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
38
  background: (0, _components.themed)({
37
39
  light: colors.N20,
38
40
  dark: colors.DN50
39
41
  })(props),
40
42
  width: '8px'
41
43
  }), (0, _components.themed)({
42
- light: colors.N20,
43
- dark: colors.DN50
44
+ light: (0, _tokens.token)('color.background.neutral', colors.N20),
45
+ dark: (0, _tokens.token)('color.background.neutral', colors.DN50)
44
46
  })(props), _editorSharedStyles.akEditorCodeFontFamily, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorTableCellMinWidth, _classNames.codeBlockClassNames.gutter, (0, _components.themed)({
45
- light: colors.N30,
46
- dark: colors.DN20
47
+ light: (0, _tokens.token)('color.background.neutral', colors.N30),
48
+ dark: (0, _tokens.token)('color.background.neutral', colors.DN20)
47
49
  })(props), (0, _constants.gridSize)(), (0, _components.themed)({
48
- light: colors.N90,
49
- dark: colors.DN90
50
+ light: (0, _tokens.token)('color.text.subtlest', colors.N90),
51
+ dark: (0, _tokens.token)('color.text.subtlest', colors.DN90)
50
52
  })(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
51
- light: colors.N400,
52
- dark: colors.DN400
53
+ light: (0, _tokens.token)('color.text.subtle', colors.N400),
54
+ dark: (0, _tokens.token)('color.text.subtle', colors.DN400)
53
55
  })(props), _classNames.codeBlockClassNames.highlighting, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _classNames.codeBlockClassNames.content, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), _classNames.codeBlockClassNames.highlighting, (0, _components.themed)({
54
- light: colors.N800,
55
- dark: colors.DN500
56
- })(props), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _classNames.codeBlockClassNames.gutter, colors.R75, (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content, (0, _tokens.token)('color.background.danger', _editorSharedStyles.akEditorDeleteBackground), _classNames.codeBlockClassNames.gutter, (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content);
56
+ light: (0, _tokens.token)('color.text', colors.N800),
57
+ dark: (0, _tokens.token)('color.text', colors.DN500)
58
+ })(props), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _classNames.codeBlockClassNames.gutter, (0, _tokens.token)('color.blanket.danger', colors.R75), (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content, (0, _tokens.token)('color.background.danger', _editorSharedStyles.akEditorDeleteBackground), _classNames.codeBlockClassNames.gutter, (0, _tokens.token)('color.blanket.danger', 'rgba(255, 143, 115, 0.5)'), (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content, (0, _tokens.token)('color.background.danger', 'rgba(255, 189, 173, 0.5)'));
57
59
  };
58
60
 
59
61
  exports.highlightingCodeBlockStyles = highlightingCodeBlockStyles;
60
62
 
61
63
  var codeBlockStyles = function codeBlockStyles(props) {
62
- return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-repeat: no-repeat;\n background-color: ", ";\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), (0, _editorSharedStyles.overflowShadow)({
64
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-repeat: no-repeat;\n background-color: ", ";\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), (0, _editorSharedStyles.overflowShadow)({
65
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
66
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
63
67
  background: (0, _components.themed)({
64
68
  light: colors.N20,
65
69
  dark: colors.DN50
66
70
  })(props),
67
71
  width: '8px'
68
72
  }), (0, _components.themed)({
69
- light: colors.N20,
70
- dark: colors.DN50
73
+ light: (0, _tokens.token)('color.background.neutral', colors.N20),
74
+ dark: (0, _tokens.token)('color.background.neutral', colors.DN50)
71
75
  })(props), _editorSharedStyles.akEditorCodeFontFamily, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorTableCellMinWidth, _classNames.codeBlockClassNames.gutter, (0, _components.themed)({
72
- light: colors.N30,
73
- dark: colors.DN20
76
+ light: (0, _tokens.token)('color.background.neutral', colors.N30),
77
+ dark: (0, _tokens.token)('color.background.neutral', colors.DN20)
74
78
  })(props), (0, _constants.gridSize)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
75
- light: colors.N400,
76
- dark: colors.DN400
79
+ light: (0, _tokens.token)('color.text', colors.N400),
80
+ dark: (0, _tokens.token)('color.text', colors.DN400)
77
81
  })(props), _classNames.codeBlockClassNames.content, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
78
- light: colors.N800,
79
- dark: colors.DN800
80
- })(props), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, (0, _tokens.token)('color.border.danger', _editorSharedStyles.akEditorDeleteBorder), _classNames.codeBlockClassNames.gutter, colors.R75, (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content, (0, _tokens.token)('color.background.danger', _editorSharedStyles.akEditorDeleteBackground), _classNames.codeBlockClassNames.gutter, (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content);
82
+ light: (0, _tokens.token)('color.text', colors.N800),
83
+ dark: (0, _tokens.token)('color.text', colors.DN800)
84
+ })(props), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _classNames.codeBlockClassNames.gutter, (0, _tokens.token)('color.blanket.danger', colors.R75), (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content, (0, _tokens.token)('color.background.danger', _editorSharedStyles.akEditorDeleteBackground), _classNames.codeBlockClassNames.gutter, (0, _tokens.token)('color.blanket.danger', 'rgba(255, 143, 115, 0.5)'), (0, _tokens.token)('color.text.danger', _editorSharedStyles.akEditorDeleteIconColor), _classNames.codeBlockClassNames.content, (0, _tokens.token)('color.background.danger', 'rgba(255, 189, 173, 0.5)'));
81
85
  };
82
86
 
83
87
  exports.codeBlockStyles = codeBlockStyles;
@@ -17,13 +17,15 @@ var _utils = require("./utils");
17
17
 
18
18
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _templateObject;
21
23
 
22
24
  var telepointerColorStyle = function telepointerColorStyle(color, index) {
23
- return "\n &.color-".concat(index, " {\n background-color: ").concat(color.selection, ";\n &::after {\n background-color: ").concat(color.solid, ";\n color: #fff;\n border-color: ").concat(color.solid, ";\n }\n }\n");
25
+ return "\n &.color-".concat(index, " {\n background-color: ").concat(color.selection, ";\n &::after {\n background-color: ").concat(color.solid, ";\n color: ").concat((0, _tokens.token)('color.text.inverse', '#fff'), ";\n border-color: ").concat(color.solid, ";\n }\n }\n");
24
26
  };
25
27
 
26
- var telepointerStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .telepointer {\n position: relative;\n transition: opacity 200ms;\n\n &.telepointer-selection {\n line-height: 1.2;\n pointer-events: none;\n user-select: none;\n }\n\n &.telepointer-selection-badge::after {\n content: attr(data-initial);\n position: absolute;\n display: block;\n top: -14px;\n font-size: ", ";\n padding: 2px;\n color: white;\n left: -1px;\n border-radius: 2px 2px 2px 0;\n line-height: initial;\n }\n\n &.", " {\n opacity: 0.2;\n }\n\n ", ";\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)(9), _pluginState.TELEPOINTER_DIM_CLASS, _utils.colors.map(function (color, index) {
28
+ var telepointerStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .telepointer {\n position: relative;\n transition: opacity 200ms;\n\n &.telepointer-selection {\n line-height: 1.2;\n pointer-events: none;\n user-select: none;\n }\n\n &.telepointer-selection-badge::after {\n content: attr(data-initial);\n position: absolute;\n display: block;\n top: -14px;\n font-size: ", ";\n padding: 2px;\n color: ", ";\n left: -1px;\n border-radius: 2px 2px 2px 0;\n line-height: initial;\n }\n\n &.", " {\n opacity: 0.2;\n }\n\n ", ";\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)(9), (0, _tokens.token)('color.text.inverse', 'white'), _pluginState.TELEPOINTER_DIM_CLASS, _utils.colors.map(function (color, index) {
27
29
  return telepointerColorStyle(color, index);
28
30
  }));
29
31
  exports.telepointerStyle = telepointerStyle;