@atlaskit/editor-core 161.0.0 → 162.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 (295) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/cjs/actions/index.js +76 -48
  3. package/dist/cjs/extensibility.js +2 -2
  4. package/dist/cjs/labs/next/full-page.js +1 -1
  5. package/dist/cjs/plugins/block-type/styles.js +5 -2
  6. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
  7. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
  8. package/dist/cjs/plugins/card/messages.js +4 -4
  9. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
  10. package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
  11. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
  12. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
  13. package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
  14. package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
  15. package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
  16. package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
  17. package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
  18. package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
  19. package/dist/cjs/plugins/card/ui/styled.js +5 -13
  20. package/dist/cjs/plugins/card/ui/types.js +5 -0
  21. package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
  22. package/dist/cjs/plugins/code-block/styles.js +45 -38
  23. package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
  24. package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
  25. package/dist/cjs/plugins/extension/utils.js +57 -12
  26. package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
  27. package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
  28. package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
  29. package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
  30. package/dist/cjs/plugins/layout/styles.js +2 -2
  31. package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
  32. package/dist/cjs/plugins/list/commands/index.js +35 -38
  33. package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
  34. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  35. package/dist/cjs/plugins/media/styles.js +2 -2
  36. package/dist/cjs/plugins/media/utils/media-single.js +15 -2
  37. package/dist/cjs/plugins/paste/handlers.js +19 -5
  38. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
  39. package/dist/cjs/plugins/placeholder-text/index.js +45 -1
  40. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
  41. package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
  42. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  43. package/dist/cjs/plugins/table/commands/index.js +0 -6
  44. package/dist/cjs/plugins/table/commands/insert.js +1 -1
  45. package/dist/cjs/plugins/table/commands/misc.js +5 -18
  46. package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
  47. package/dist/cjs/plugins/table/handlers.js +6 -2
  48. package/dist/cjs/plugins/table/index.js +7 -13
  49. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
  50. package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
  51. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
  52. package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
  53. package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
  54. package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
  55. package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  56. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
  57. package/dist/cjs/plugins/table/reducer.js +0 -7
  58. package/dist/cjs/plugins/table/toolbar.js +5 -15
  59. package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
  60. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +3 -1
  61. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  62. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
  63. package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
  64. package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
  65. package/dist/cjs/plugins/table/utils/nodes.js +15 -15
  66. package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
  67. package/dist/cjs/plugins/text-formatting/styles.js +5 -2
  68. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
  69. package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  70. package/dist/cjs/plugins/text-formatting/utils.js +30 -2
  71. package/dist/cjs/plugins/type-ahead/api.js +32 -1
  72. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
  73. package/dist/cjs/plugins/type-ahead/utils.js +22 -4
  74. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  75. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
  76. package/dist/cjs/ui/ContentStyles/index.js +32 -9
  77. package/dist/cjs/utils/index.js +1 -8
  78. package/dist/cjs/utils/insert.js +1 -9
  79. package/dist/cjs/utils/selection.js +2 -9
  80. package/dist/cjs/version-wrapper.js +1 -1
  81. package/dist/cjs/version.json +1 -1
  82. package/dist/es2019/actions/index.js +20 -23
  83. package/dist/es2019/extensibility.js +1 -1
  84. package/dist/es2019/labs/next/full-page.js +2 -2
  85. package/dist/es2019/plugins/block-type/styles.js +3 -3
  86. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
  87. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
  88. package/dist/es2019/plugins/card/messages.js +4 -4
  89. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
  90. package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
  91. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
  92. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
  93. package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
  94. package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
  95. package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
  96. package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
  97. package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  98. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  99. package/dist/es2019/plugins/card/ui/styled.js +2 -2
  100. package/dist/es2019/plugins/card/ui/types.js +1 -0
  101. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
  102. package/dist/es2019/plugins/code-block/styles.js +14 -14
  103. package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
  104. package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
  105. package/dist/es2019/plugins/extension/utils.js +37 -2
  106. package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
  107. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
  108. package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
  109. package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
  110. package/dist/es2019/plugins/layout/styles.js +5 -1
  111. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
  112. package/dist/es2019/plugins/list/commands/index.js +29 -28
  113. package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
  114. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  115. package/dist/es2019/plugins/media/styles.js +1 -1
  116. package/dist/es2019/plugins/media/utils/media-single.js +14 -1
  117. package/dist/es2019/plugins/paste/handlers.js +19 -5
  118. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  119. package/dist/es2019/plugins/placeholder-text/index.js +46 -1
  120. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
  121. package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
  122. package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
  123. package/dist/es2019/plugins/table/commands/index.js +1 -1
  124. package/dist/es2019/plugins/table/commands/insert.js +1 -1
  125. package/dist/es2019/plugins/table/commands/misc.js +5 -11
  126. package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
  127. package/dist/es2019/plugins/table/handlers.js +6 -2
  128. package/dist/es2019/plugins/table/index.js +4 -8
  129. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
  130. package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
  131. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  132. package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
  133. package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
  134. package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
  135. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  136. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  137. package/dist/es2019/plugins/table/reducer.js +0 -9
  138. package/dist/es2019/plugins/table/toolbar.js +1 -4
  139. package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
  140. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
  141. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  142. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
  143. package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
  144. package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
  145. package/dist/es2019/plugins/table/utils/nodes.js +11 -11
  146. package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
  147. package/dist/es2019/plugins/text-formatting/styles.js +3 -3
  148. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
  149. package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  150. package/dist/es2019/plugins/text-formatting/utils.js +13 -1
  151. package/dist/es2019/plugins/type-ahead/api.js +31 -2
  152. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
  153. package/dist/es2019/plugins/type-ahead/utils.js +15 -0
  154. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  155. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  156. package/dist/es2019/ui/ContentStyles/index.js +45 -23
  157. package/dist/es2019/utils/index.js +1 -1
  158. package/dist/es2019/utils/insert.js +2 -10
  159. package/dist/es2019/utils/selection.js +1 -6
  160. package/dist/es2019/version-wrapper.js +1 -1
  161. package/dist/es2019/version.json +1 -1
  162. package/dist/esm/actions/index.js +76 -48
  163. package/dist/esm/extensibility.js +1 -1
  164. package/dist/esm/labs/next/full-page.js +2 -2
  165. package/dist/esm/plugins/block-type/styles.js +4 -2
  166. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
  167. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
  168. package/dist/esm/plugins/card/messages.js +4 -4
  169. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
  170. package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
  171. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
  172. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
  173. package/dist/esm/plugins/card/ui/assets/card.js +1 -1
  174. package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
  175. package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
  176. package/dist/esm/plugins/card/ui/assets/url.js +1 -1
  177. package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  178. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  179. package/dist/esm/plugins/card/ui/styled.js +2 -2
  180. package/dist/esm/plugins/card/ui/types.js +1 -0
  181. package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
  182. package/dist/esm/plugins/code-block/styles.js +42 -38
  183. package/dist/esm/plugins/extension/plugin-factory.js +3 -1
  184. package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
  185. package/dist/esm/plugins/extension/utils.js +51 -9
  186. package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
  187. package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
  188. package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
  189. package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
  190. package/dist/esm/plugins/layout/styles.js +2 -2
  191. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
  192. package/dist/esm/plugins/list/commands/index.js +33 -34
  193. package/dist/esm/plugins/list/utils/replace-content.js +21 -0
  194. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  195. package/dist/esm/plugins/media/styles.js +1 -1
  196. package/dist/esm/plugins/media/utils/media-single.js +12 -1
  197. package/dist/esm/plugins/paste/handlers.js +19 -5
  198. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  199. package/dist/esm/plugins/placeholder-text/index.js +44 -1
  200. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
  201. package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
  202. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  203. package/dist/esm/plugins/table/commands/index.js +1 -1
  204. package/dist/esm/plugins/table/commands/insert.js +1 -1
  205. package/dist/esm/plugins/table/commands/misc.js +5 -15
  206. package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
  207. package/dist/esm/plugins/table/handlers.js +6 -2
  208. package/dist/esm/plugins/table/index.js +6 -11
  209. package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
  210. package/dist/esm/plugins/table/nodeviews/table.js +6 -37
  211. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  212. package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
  213. package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
  214. package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
  215. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  216. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  217. package/dist/esm/plugins/table/reducer.js +0 -7
  218. package/dist/esm/plugins/table/toolbar.js +1 -10
  219. package/dist/esm/plugins/table/transforms/metadata.js +1 -1
  220. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
  221. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  222. package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
  223. package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
  224. package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
  225. package/dist/esm/plugins/table/utils/nodes.js +14 -14
  226. package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
  227. package/dist/esm/plugins/text-formatting/styles.js +4 -2
  228. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
  229. package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  230. package/dist/esm/plugins/text-formatting/utils.js +18 -0
  231. package/dist/esm/plugins/type-ahead/api.js +30 -2
  232. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
  233. package/dist/esm/plugins/type-ahead/utils.js +17 -3
  234. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  235. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  236. package/dist/esm/ui/ContentStyles/index.js +27 -9
  237. package/dist/esm/utils/index.js +1 -1
  238. package/dist/esm/utils/insert.js +2 -10
  239. package/dist/esm/utils/selection.js +1 -6
  240. package/dist/esm/version-wrapper.js +1 -1
  241. package/dist/esm/version.json +1 -1
  242. package/dist/types/actions/index.d.ts +2 -2
  243. package/dist/types/extensibility.d.ts +1 -1
  244. package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
  245. package/dist/types/plugins/block-type/styles.d.ts +2 -1
  246. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
  247. package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
  248. package/dist/types/plugins/card/messages.d.ts +2 -2
  249. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
  250. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
  251. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
  252. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
  253. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
  254. package/dist/types/plugins/card/ui/styled.d.ts +2 -3
  255. package/dist/types/plugins/card/ui/types.d.ts +12 -0
  256. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
  257. package/dist/types/plugins/code-block/styles.d.ts +3 -2
  258. package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
  259. package/dist/types/plugins/extension/types.d.ts +1 -0
  260. package/dist/types/plugins/extension/utils.d.ts +3 -1
  261. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
  262. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
  263. package/dist/types/plugins/layout/styles.d.ts +1 -1
  264. package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
  265. package/dist/types/plugins/list/commands/index.d.ts +0 -1
  266. package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
  267. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  268. package/dist/types/plugins/media/styles.d.ts +1 -1
  269. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  270. package/dist/types/plugins/panel/styles.d.ts +1 -1
  271. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  272. package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
  273. package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
  274. package/dist/types/plugins/rule/styles.d.ts +1 -1
  275. package/dist/types/plugins/table/commands/index.d.ts +1 -1
  276. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  277. package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
  278. package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
  279. package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  280. package/dist/types/plugins/table/types.d.ts +1 -8
  281. package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
  282. package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
  283. package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
  284. package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
  285. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  286. package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
  287. package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
  288. package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
  289. package/dist/types/plugins/type-ahead/api.d.ts +11 -1
  290. package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
  291. package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
  292. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  293. package/dist/types/utils/index.d.ts +1 -1
  294. package/dist/types/utils/selection.d.ts +0 -1
  295. package/package.json +28 -26
@@ -21,6 +21,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
21
21
 
22
22
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
23
23
 
24
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
25
+
24
26
  var _react = _interopRequireWildcard(require("react"));
25
27
 
26
28
  var _reactIntlNext = require("react-intl-next");
@@ -41,6 +43,10 @@ var _dropdownMenu = require("./dropdown-menu");
41
43
 
42
44
  var _toolbarMessages = require("./toolbar-messages");
43
45
 
46
+ var _utils = require("../../utils");
47
+
48
+ var _announcer = _interopRequireDefault(require("../../../../utils/announcer/announcer"));
49
+
44
50
  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); }
45
51
 
46
52
  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; }
@@ -62,6 +68,12 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
62
68
  var editorState = (0, _react.useMemo)(function () {
63
69
  return editorView.state;
64
70
  }, [editorView.state]);
71
+
72
+ var _useState = (0, _react.useState)(''),
73
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
74
+ message = _useState2[0],
75
+ setMessage = _useState2[1];
76
+
65
77
  var defaultIcons = (0, _formattingIcons.useFormattingIcons)({
66
78
  editorState: editorState,
67
79
  intl: intl,
@@ -88,6 +100,54 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
88
100
  dropdownItems = _useResponsiveToolbar.dropdownItems,
89
101
  singleItems = _useResponsiveToolbar.singleItems;
90
102
 
103
+ var clearFormattingStatus = intl.formatMessage(_toolbarMessages.toolbarMessages.textFormattingOff);
104
+ var superscriptOffSubscriptOnStatus = intl.formatMessage(_toolbarMessages.toolbarMessages.superscriptOffSubscriptOn);
105
+ var subscriptOffSuperscriptOnStatus = intl.formatMessage(_toolbarMessages.toolbarMessages.subscriptOffSuperscriptOn);
106
+ var activeItems = [].concat((0, _toConsumableArray2.default)(dropdownItems), (0, _toConsumableArray2.default)(singleItems)).filter(function (item) {
107
+ return item.isActive;
108
+ });
109
+ var prevActiveItems = (0, _utils.usePreviousObjectState)(activeItems);
110
+ var fromSuperscriptToSubscript = (0, _utils.isArrayContainsContent)(activeItems, 'Subscript') && (0, _utils.isArrayContainsContent)(prevActiveItems, 'Superscript');
111
+ var fromSubscriptToSuperscript = (0, _utils.isArrayContainsContent)(activeItems, 'Superscript') && (0, _utils.isArrayContainsContent)(prevActiveItems, 'Subscript');
112
+ var comparedItems;
113
+ var screenReaderMessage = '';
114
+
115
+ if (prevActiveItems && activeItems.length > prevActiveItems.length) {
116
+ comparedItems = (0, _utils.compareItemsArrays)(activeItems, prevActiveItems);
117
+ screenReaderMessage = intl.formatMessage(_toolbarMessages.toolbarMessages.on, {
118
+ formattingType: comparedItems[0].content
119
+ });
120
+ } else {
121
+ comparedItems = (0, _utils.compareItemsArrays)(prevActiveItems, activeItems);
122
+
123
+ if (comparedItems && comparedItems.length) {
124
+ var _activeItems$;
125
+
126
+ screenReaderMessage = intl.formatMessage(_toolbarMessages.toolbarMessages.off, {
127
+ formattingType: comparedItems[0].content
128
+ });
129
+
130
+ if (((_activeItems$ = activeItems[0]) === null || _activeItems$ === void 0 ? void 0 : _activeItems$.content) === 'Code') {
131
+ screenReaderMessage = intl.formatMessage(_toolbarMessages.toolbarMessages.codeOn, {
132
+ textFormattingOff: (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1 ? clearFormattingStatus : screenReaderMessage
133
+ });
134
+ }
135
+
136
+ if (fromSuperscriptToSubscript) {
137
+ screenReaderMessage = superscriptOffSubscriptOnStatus;
138
+ }
139
+
140
+ if (fromSubscriptToSuperscript) {
141
+ screenReaderMessage = subscriptOffSuperscriptOnStatus;
142
+ }
143
+ }
144
+ } // handle 'Clear formatting' status for screen readers
145
+
146
+
147
+ if (!(activeItems !== null && activeItems !== void 0 && activeItems.length) && (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1) {
148
+ screenReaderMessage = clearFormattingStatus;
149
+ }
150
+
91
151
  var items = (0, _react.useMemo)(function () {
92
152
  if (!clearIcon) {
93
153
  return dropdownItems;
@@ -96,9 +156,19 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
96
156
  return [].concat((0, _toConsumableArray2.default)(dropdownItems), [clearIcon]);
97
157
  }, [clearIcon, dropdownItems]);
98
158
  var moreFormattingButtonLabel = intl.formatMessage(_toolbarMessages.toolbarMessages.moreFormatting);
159
+ (0, _react.useEffect)(function () {
160
+ if (screenReaderMessage) {
161
+ setMessage(screenReaderMessage);
162
+ }
163
+ }, [screenReaderMessage]);
99
164
  return /*#__PURE__*/_react.default.createElement(_styles.ButtonGroup, {
100
165
  width: isReducedSpacing ? 'small' : 'large'
101
- }, /*#__PURE__*/_react.default.createElement(_singleToolbarButtons.SingleToolbarButtons, {
166
+ }, message && /*#__PURE__*/_react.default.createElement(_announcer.default, {
167
+ ariaLive: "assertive",
168
+ text: message,
169
+ ariaRelevant: "additions",
170
+ delay: 250
171
+ }), /*#__PURE__*/_react.default.createElement(_singleToolbarButtons.SingleToolbarButtons, {
102
172
  items: singleItems,
103
173
  editorView: editorView,
104
174
  isReducedSpacing: isReducedSpacing
@@ -23,16 +23,31 @@ var toolbarMessages = (0, _reactIntlNext.defineMessages)({
23
23
  defaultMessage: 'Code',
24
24
  description: 'Whether the text selection has monospaced/code font'
25
25
  },
26
+ codeOn: {
27
+ id: 'fabric.editor.code.on',
28
+ defaultMessage: '{textFormattingOff}, Code On',
29
+ description: 'Reports that code formatting has been turned on'
30
+ },
26
31
  subscript: {
27
32
  id: 'fabric.editor.subscript',
28
33
  defaultMessage: 'Subscript',
29
34
  description: 'Whether the text selection is written below the line in a slightly smaller size'
30
35
  },
36
+ subscriptOffSuperscriptOn: {
37
+ id: 'fabric.editor.subscript.off.superscript.on',
38
+ defaultMessage: 'Subscript Off, Superscript On',
39
+ description: 'Reports text formatting in case when subscript off and superscript on'
40
+ },
31
41
  superscript: {
32
42
  id: 'fabric.editor.superscript',
33
43
  defaultMessage: 'Superscript',
34
44
  description: 'Whether the text selection is written above the line in a slightly smaller size'
35
45
  },
46
+ superscriptOffSubscriptOn: {
47
+ id: 'fabric.editor.superscript.off.subscript.on',
48
+ defaultMessage: 'Superscript Off, Subscript On',
49
+ description: 'Describe text formatting in case when Superscript Off and Subscript on'
50
+ },
36
51
  clearFormatting: {
37
52
  id: 'fabric.editor.clearFormatting',
38
53
  defaultMessage: 'Clear formatting',
@@ -52,6 +67,21 @@ var toolbarMessages = (0, _reactIntlNext.defineMessages)({
52
67
  id: 'fabric.editor.italic',
53
68
  defaultMessage: 'Italic',
54
69
  description: 'This refers to italics or emphasized formatting.'
70
+ },
71
+ on: {
72
+ id: 'fabric.editor.on',
73
+ defaultMessage: '{formattingType} On',
74
+ description: 'Reports that text formatting has been turned on'
75
+ },
76
+ off: {
77
+ id: 'fabric.editor.off',
78
+ defaultMessage: '{formattingType} Off',
79
+ description: 'Reports that text formatting has been turned off'
80
+ },
81
+ textFormattingOff: {
82
+ id: 'fabric.editor.text.formatting.off',
83
+ defaultMessage: 'Text formatting Off',
84
+ description: 'Reports that text formatting has been turned off'
55
85
  }
56
86
  });
57
87
  exports.toolbarMessages = toolbarMessages;
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.nodeLen = exports.markActive = exports.isIgnorable = exports.isBlockNode = exports.hasCode = exports.domIndex = exports.checkFormattingIsPresent = exports.anyMarkActive = void 0;
6
+ exports.usePreviousObjectState = exports.nodeLen = exports.markActive = exports.isIgnorable = exports.isBlockNode = exports.isArrayContainsContent = exports.hasCode = exports.domIndex = exports.compareItemsArrays = exports.checkFormattingIsPresent = exports.anyMarkActive = void 0;
7
+
8
+ var _react = require("react");
7
9
 
8
10
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
9
11
 
@@ -159,4 +161,30 @@ var checkFormattingIsPresent = function checkFormattingIsPresent(state) {
159
161
  return marksArePresent(state) || blockStylingIsPresent(state);
160
162
  };
161
163
 
162
- exports.checkFormattingIsPresent = checkFormattingIsPresent;
164
+ exports.checkFormattingIsPresent = checkFormattingIsPresent;
165
+
166
+ var usePreviousObjectState = function usePreviousObjectState(value) {
167
+ var ref = (0, _react.useRef)();
168
+ (0, _react.useEffect)(function () {
169
+ ref.current = value;
170
+ });
171
+ return ref.current;
172
+ };
173
+
174
+ exports.usePreviousObjectState = usePreviousObjectState;
175
+
176
+ var compareItemsArrays = function compareItemsArrays(items, prevItems) {
177
+ return items && items.filter(function (item) {
178
+ return !prevItems.includes(item);
179
+ });
180
+ };
181
+
182
+ exports.compareItemsArrays = compareItemsArrays;
183
+
184
+ var isArrayContainsContent = function isArrayContainsContent(items, content) {
185
+ return items.filter(function (item) {
186
+ return item.content === content;
187
+ }).length > 0;
188
+ };
189
+
190
+ exports.isArrayContainsContent = isArrayContainsContent;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createTypeAheadTools = void 0;
6
+ exports.createTypeAheadTools = exports.createInternalTypeAheadTools = void 0;
7
7
 
8
8
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
9
9
 
@@ -220,6 +220,37 @@ var currentQuery = function currentQuery(_ref8) {
220
220
  };
221
221
  };
222
222
 
223
+ var find = function find(_ref9) {
224
+ var editorView = _ref9.editorView;
225
+ return function (trigger) {
226
+ var editorState = editorView.state;
227
+ var handler = (0, _utils.findHandlerByTrigger)({
228
+ trigger: trigger,
229
+ editorState: editorState
230
+ });
231
+
232
+ if (!handler) {
233
+ return null;
234
+ }
235
+
236
+ return handler;
237
+ };
238
+ }; // This is an internal tool to be used inside of others Editor Plugins
239
+ // We shouldn't public export this method.
240
+
241
+
242
+ var createInternalTypeAheadTools = function createInternalTypeAheadTools(editorView) {
243
+ var props = {
244
+ editorView: editorView
245
+ };
246
+ return {
247
+ findTypeAheadHandler: find(props),
248
+ openTypeAheadHandler: _openTypeaheadAtCursor.openTypeAhead
249
+ };
250
+ };
251
+
252
+ exports.createInternalTypeAheadTools = createInternalTypeAheadTools;
253
+
223
254
  var createTypeAheadTools = function createTypeAheadTools(editorView) {
224
255
  var props = {
225
256
  editorView: editorView
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.openTypeAheadAtCursor = void 0;
6
+ exports.openTypeAheadAtCursor = exports.openTypeAhead = void 0;
7
7
 
8
8
  var _prosemirrorState = require("prosemirror-state");
9
9
 
@@ -11,11 +11,11 @@ var _key = require("../pm-plugins/key");
11
11
 
12
12
  var _actions = require("../pm-plugins/actions");
13
13
 
14
- var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
15
- var triggerHandler = _ref.triggerHandler,
16
- inputMethod = _ref.inputMethod,
17
- query = _ref.query;
14
+ var openTypeAhead = function openTypeAhead(props) {
18
15
  return function (tr) {
16
+ var triggerHandler = props.triggerHandler,
17
+ inputMethod = props.inputMethod,
18
+ query = props.query;
19
19
  tr.setMeta(_key.pluginKey, {
20
20
  action: _actions.ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR,
21
21
  params: {
@@ -24,6 +24,21 @@ var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
24
24
  query: query
25
25
  }
26
26
  });
27
+ };
28
+ };
29
+
30
+ exports.openTypeAhead = openTypeAhead;
31
+
32
+ var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
33
+ var triggerHandler = _ref.triggerHandler,
34
+ inputMethod = _ref.inputMethod,
35
+ query = _ref.query;
36
+ return function (tr) {
37
+ openTypeAhead({
38
+ triggerHandler: triggerHandler,
39
+ inputMethod: inputMethod,
40
+ query: query
41
+ })(tr);
27
42
  var selection = tr.selection;
28
43
 
29
44
  if (!(selection instanceof _prosemirrorState.TextSelection)) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadHandler = exports.getPluginState = exports.findTypeAheadDecorations = exports.findHandler = void 0;
6
+ exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadHandler = exports.getPluginState = exports.findTypeAheadDecorations = exports.findHandlerByTrigger = exports.findHandler = void 0;
7
7
 
8
8
  var _prosemirrorState = require("prosemirror-state");
9
9
 
@@ -97,9 +97,27 @@ var findHandler = function findHandler(id, state) {
97
97
 
98
98
  exports.findHandler = findHandler;
99
99
 
100
- var moveSelectedIndex = function moveSelectedIndex(_ref) {
101
- var editorView = _ref.editorView,
102
- direction = _ref.direction;
100
+ var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
101
+ var trigger = _ref.trigger,
102
+ editorState = _ref.editorState;
103
+
104
+ var pluginState = _key.pluginKey.getState(editorState);
105
+
106
+ if (!pluginState || !pluginState.typeAheadHandlers || pluginState.typeAheadHandlers.length === 0) {
107
+ return null;
108
+ }
109
+
110
+ var typeAheadHandlers = pluginState.typeAheadHandlers;
111
+ return typeAheadHandlers.find(function (h) {
112
+ return h.trigger === trigger;
113
+ }) || null;
114
+ };
115
+
116
+ exports.findHandlerByTrigger = findHandlerByTrigger;
117
+
118
+ var moveSelectedIndex = function moveSelectedIndex(_ref2) {
119
+ var editorView = _ref2.editorView,
120
+ direction = _ref2.direction;
103
121
  return function () {
104
122
  var typeAheadState = getPluginState(editorView.state);
105
123
 
@@ -83,7 +83,7 @@ var CommentEditor = _styledComponents.default.div(_templateObject || (_templateO
83
83
  CommentEditor.displayName = 'CommentEditor';
84
84
  var ContentArea = (0, _styledComponents.default)(_ContentStyles.default)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n ", ";\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), function (props) {
85
85
  return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
86
- }, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, _Toolbar2.TableControlsPadding, _commonStyles.tableCommentEditorStyles);
86
+ }, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, _Toolbar2.TableControlsPadding, _commonStyles.deprecatedTableCommentEditorStyles);
87
87
  ContentArea.displayName = 'ContentArea';
88
88
 
89
89
  var SecondaryToolbar = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
@@ -54,7 +54,7 @@ var EditorContentArea = _styledComponents.default.div(_templateObject5 || (_temp
54
54
  var theme = _ref.theme,
55
55
  fullWidthMode = _ref.fullWidthMode;
56
56
  return (fullWidthMode ? _editorSharedStyles.akEditorFullWidthLayoutWidth : theme.layoutMaxWidth) + TOTAL_PADDING;
57
- }, SWOOP_ANIMATION, _adfSchema.taskListSelector, _adfSchema.decisionListSelector, _commonStyles.tableFullPageEditorStyles, function (_ref2) {
57
+ }, SWOOP_ANIMATION, _adfSchema.taskListSelector, _adfSchema.decisionListSelector, _commonStyles.deprecatedTableFullPageEditorStyles, function (_ref2) {
58
58
  var containerWidth = _ref2.containerWidth;
59
59
 
60
60
  if (!containerWidth) {
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
@@ -11,7 +13,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
13
 
12
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
15
 
14
- var _react = _interopRequireDefault(require("react"));
16
+ var _react = _interopRequireWildcard(require("react"));
17
+
18
+ var _react2 = require("@emotion/react");
15
19
 
16
20
  var _styledComponents = _interopRequireDefault(require("styled-components"));
17
21
 
@@ -77,21 +81,40 @@ var _styled = require("../../plugins/card/ui/styled");
77
81
 
78
82
  var _featureFlagsContext = require("../../plugins/feature-flags-context");
79
83
 
80
- var _templateObject;
84
+ var _templateObject, _templateObject2;
85
+
86
+ 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); }
87
+
88
+ 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; }
89
+
90
+ var contentStyles = function contentStyles(props) {
91
+ var _props$featureFlags;
92
+
93
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
94
+ theme: props.theme
95
+ }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, (0, _commonStyles.tableStyles)(props), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? (0, _styles7.highlightingCodeBlockStyles)(props) : (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles16.textFormattingStyles)(props), _styles.textColorStyles, _styles10.mediaStyles, _styles11.layoutStyles, _styles.tasksAndDecisionsStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, (0, _styles.annotationSharedStyles)(props), _styled.embedCardStyles);
96
+ };
81
97
 
82
- var ContentStyles = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid #8cf;\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-child {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), _editorSharedStyles.editorFontSize, _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _styles6.blocktypeStyles, _styles16.textFormattingStyles, _styles17.placeholderTextStyles, _styles5.placeholderStyles, function (_ref) {
98
+ var DeprecatedContentStyles = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid #8cf;\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-child {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), _styles17.placeholderTextStyles, _styles5.placeholderStyles, _styles8.listsStyles, _styles9.ruleStyles, _styles3.telepointerStyle, _styles4.gapCursorStyles, _styles12.panelStyles, _styles13.fakeCursorStyles, _styles14.mentionsStyles, function (_ref) {
83
99
  var featureFlags = _ref.featureFlags;
84
- return featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? _styles7.highlightingCodeBlockStyles : _styles7.codeBlockStyles;
85
- }, _styles.textColorStyles, _styles8.listsStyles, _styles9.ruleStyles, _styles10.mediaStyles, _styles11.layoutStyles, _styles3.telepointerStyle, _styles4.gapCursorStyles, _commonStyles.tableStyles, _styles12.panelStyles, _styles13.fakeCursorStyles, _styles14.mentionsStyles, function (_ref2) {
86
- var featureFlags = _ref2.featureFlags;
87
100
  return featureFlags !== null && featureFlags !== void 0 && featureFlags.nextEmojiNodeView ? _styles15.emojiStylesNext : _styles15.emojiStyles;
88
- }, _styles.tasksAndDecisionsStyles, _styles18.gridStyles, _styles19.linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles20.extensionStyles, _styles21.expandStyles, _styles22.findReplaceStyles, _styles23.taskDecisionStyles, _styles24.statusStyles, _styles.annotationSharedStyles, _styles25.smartCardStyles, _styles.smartCardSharedStyles, _styles26.dateStyles, _styled.embedCardStyles, _styles2.unsupportedStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
101
+ }, _styles18.gridStyles, _styles19.linkStyles, _styles20.extensionStyles, _styles21.expandStyles, _styles22.findReplaceStyles, _styles23.taskDecisionStyles, _styles24.statusStyles, _styles25.smartCardStyles, _styles.smartCardSharedStyles, _styles26.dateStyles, _styles2.unsupportedStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
89
102
 
90
103
  var _default = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
91
104
  var featureFlags = (0, _featureFlagsContext.useFeatureFlags)();
92
- return /*#__PURE__*/_react.default.createElement(ContentStyles, (0, _extends2.default)({}, props, {
105
+ var allowAnnotation = props.allowAnnotation;
106
+ var theme = (0, _react2.useTheme)();
107
+ var memoizedStyle = (0, _react.useMemo)(function () {
108
+ return contentStyles({
109
+ theme: theme,
110
+ allowAnnotation: allowAnnotation,
111
+ featureFlags: featureFlags
112
+ });
113
+ }, [theme, featureFlags, allowAnnotation]);
114
+ return (0, _react2.jsx)(DeprecatedContentStyles, (0, _extends2.default)({}, props, {
93
115
  innerRef: ref,
94
- featureFlags: featureFlags
116
+ featureFlags: featureFlags,
117
+ css: memoizedStyle
95
118
  }));
96
119
  });
97
120
 
@@ -69,14 +69,7 @@ Object.defineProperty(exports, "hasVisibleContent", {
69
69
  return _document.hasVisibleContent;
70
70
  }
71
71
  });
72
- exports.insideTableCell = exports.insideTable = void 0;
73
- Object.defineProperty(exports, "isChromeWithSelectionBug", {
74
- enumerable: true,
75
- get: function get() {
76
- return _selection.isChromeWithSelectionBug;
77
- }
78
- });
79
- exports.isElementInTableCell = void 0;
72
+ exports.isElementInTableCell = exports.insideTableCell = exports.insideTable = void 0;
80
73
  Object.defineProperty(exports, "isEmptyDocument", {
81
74
  enumerable: true,
82
75
  get: function get() {
@@ -184,15 +184,7 @@ var insertSelectedItem = function insertSelectedItem(maybeNode) {
184
184
  */
185
185
  } else if (node.isInline || isInputFragment) {
186
186
  var fragment = isInputFragment ? node : _prosemirrorModel.Fragment.fromArray([node, state.schema.text(' ')]);
187
- tr = tr.replaceWith(start, start, fragment); // This problem affects Chrome v58+. See: https://github.com/ProseMirror/prosemirror/issues/710
188
-
189
- if (_selection.isChromeWithSelectionBug) {
190
- var selection = document.getSelection();
191
-
192
- if (selection) {
193
- selection.empty();
194
- }
195
- }
187
+ tr = tr.replaceWith(start, start, fragment);
196
188
 
197
189
  if (opts.selectInlineNode) {
198
190
  // Select inserted node
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.normaliseNestedLayout = exports.isValidPosition = exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = exports.isChromeWithSelectionBug = exports.duplicateSelection = void 0;
8
+ exports.normaliseNestedLayout = exports.isValidPosition = exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = exports.duplicateSelection = void 0;
9
9
  exports.setAllSelection = setAllSelection;
10
10
  exports.setCellSelection = setCellSelection;
11
11
  exports.setGapCursorSelection = setGapCursorSelection;
@@ -18,8 +18,6 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
18
18
 
19
19
  var _prosemirrorState = require("prosemirror-state");
20
20
 
21
- var _utils = require("@atlaskit/editor-common/utils");
22
-
23
21
  var _selection = require("../plugins/selection/gap-cursor/selection");
24
22
 
25
23
  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; }
@@ -87,14 +85,9 @@ var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
87
85
  }
88
86
 
89
87
  return node;
90
- }; // @see: https://github.com/ProseMirror/prosemirror/issues/710
91
- // @see: https://bugs.chromium.org/p/chromium/issues/detail?id=740085
92
- // Chrome >= 58 (desktop only)
93
-
88
+ };
94
89
 
95
90
  exports.normaliseNestedLayout = normaliseNestedLayout;
96
- var isChromeWithSelectionBug = _utils.browser.chrome && !_utils.browser.android && _utils.browser.chrome_version >= 58;
97
- exports.isChromeWithSelectionBug = isChromeWithSelectionBug;
98
91
 
99
92
  var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
100
93
  if (!parentNode) {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "161.0.0";
9
+ var version = "162.0.0";
10
10
  exports.version = version;
11
11
 
12
12
  var nextMajorVersion = function nextMajorVersion() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "161.0.0",
3
+ "version": "162.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -23,35 +23,32 @@ export default class EditorActions {
23
23
  }
24
24
  });
25
25
 
26
- _defineProperty(this, "getResolvedEditorState", () => {
27
- return new Promise((resolver, reject) => {
28
- var _getCollabProvider;
26
+ _defineProperty(this, "getResolvedEditorState", async () => {
27
+ var _getCollabProvider;
29
28
 
30
- if (!this.editorView) {
31
- reject();
32
- return;
33
- }
29
+ if (!this.editorView) {
30
+ throw new Error('Called getResolvedEditorState before editorView is ready');
31
+ }
34
32
 
35
- const featureFlags = getFeatureFlags(this.editorView.state);
33
+ const featureFlags = getFeatureFlags(this.editorView.state);
36
34
 
37
- if (!featureFlags.useNativeCollabPlugin) {
38
- var _this$getValue;
35
+ if (!featureFlags.useNativeCollabPlugin) {
36
+ const editorValue = await this.getValue();
39
37
 
40
- return (_this$getValue = this.getValue()) === null || _this$getValue === void 0 ? void 0 : _this$getValue.then(content => {
41
- resolver({
42
- content: content,
43
- title: null,
44
- stepVersion: -1
45
- });
46
- });
38
+ if (!editorValue) {
39
+ throw new Error('editorValue is undefined');
47
40
  }
48
41
 
49
- (_getCollabProvider = getCollabProvider(this.editorView.state)) === null || _getCollabProvider === void 0 ? void 0 : _getCollabProvider.getFinalAcknowledgedState().then(resolvedEditorState => {
50
- resolver(resolvedEditorState);
51
- }).catch(error => {
52
- reject(error);
53
- });
54
- });
42
+ return {
43
+ content: editorValue,
44
+ title: null,
45
+ stepVersion: -1
46
+ };
47
+ }
48
+
49
+ const editorView = this.editorView;
50
+ await getEditorValueWithMedia(editorView);
51
+ return (_getCollabProvider = getCollabProvider(editorView.state)) === null || _getCollabProvider === void 0 ? void 0 : _getCollabProvider.getFinalAcknowledgedState();
55
52
  });
56
53
  }
57
54
 
@@ -4,7 +4,7 @@ export { toJSON } from './utils';
4
4
  export { default as Extension } from './plugins/extension/ui/Extension';
5
5
  export { default as ExtensionNodeWrapper } from './plugins/extension/ui/Extension/ExtensionNodeWrapper';
6
6
  export { ExtensionNode } from './plugins/extension/nodeviews/extension';
7
- export { pluginKey as tablePluginKey } from './plugins/table/pm-plugins/plugin-factory';
7
+ export { pluginKey as tablePluginKey } from './plugins/table/pm-plugins/plugin-key';
8
8
  export const EmitterEvents = {
9
9
  TABLE_DELETED: 'TABLE_DELETED'
10
10
  };
@@ -10,7 +10,7 @@ import ContentStyles from '../../ui/ContentStyles';
10
10
  import WidthEmitter from '../../ui/WidthEmitter';
11
11
  import { ClickAreaBlock } from '../../ui/Addon';
12
12
  import { scrollbarStyles } from '../../ui/styles';
13
- import { tableFullPageEditorStyles } from '../../plugins/table/ui/common-styles.css';
13
+ import { deprecatedTableFullPageEditorStyles } from '../../plugins/table/ui/common-styles.css';
14
14
  import AvatarsWithPluginState from '../../plugins/collab-edit/ui';
15
15
  import { Editor, EditorContent, useEditorSharedConfig } from './Editor';
16
16
  import { Toolbar } from './Toolbar';
@@ -81,7 +81,7 @@ const EditorContentArea = styled.div`
81
81
  clear: none;
82
82
  }
83
83
  }
84
- ${tableFullPageEditorStyles};
84
+ ${deprecatedTableFullPageEditorStyles};
85
85
  `;
86
86
  EditorContentArea.displayName = 'EditorContentArea';
87
87
  const MainToolbar = styled.div`
@@ -1,8 +1,8 @@
1
- import { css } from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  import { blockquoteSharedStyles, headingsSharedStyles } from '@atlaskit/editor-common/styles';
3
- export const blocktypeStyles = css`
3
+ export const blocktypeStyles = props => css`
4
4
  .ProseMirror {
5
5
  ${blockquoteSharedStyles};
6
- ${headingsSharedStyles};
6
+ ${headingsSharedStyles(props)};
7
7
  }
8
8
  `;