@atlaskit/editor-core 161.0.0 → 162.0.2

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 (315) hide show
  1. package/CHANGELOG.md +50 -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 +2 -2
  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/FloatingContextualButton/index.js +1 -1
  61. package/dist/cjs/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
  62. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +4 -2
  63. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
  64. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  65. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
  66. package/dist/cjs/plugins/table/ui/common-styles.js +53 -0
  67. package/dist/cjs/plugins/table/ui/ui-styles.js +109 -0
  68. package/dist/cjs/plugins/table/utils/nodes.js +15 -15
  69. package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
  70. package/dist/cjs/plugins/text-formatting/styles.js +5 -2
  71. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
  72. package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  73. package/dist/cjs/plugins/text-formatting/utils.js +30 -2
  74. package/dist/cjs/plugins/type-ahead/api.js +32 -1
  75. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
  76. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +12 -0
  77. package/dist/cjs/plugins/type-ahead/utils.js +22 -4
  78. package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
  79. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
  80. package/dist/cjs/ui/ContentStyles/index.js +33 -10
  81. package/dist/cjs/utils/index.js +1 -8
  82. package/dist/cjs/utils/insert.js +1 -9
  83. package/dist/cjs/utils/selection.js +2 -9
  84. package/dist/cjs/version-wrapper.js +1 -1
  85. package/dist/cjs/version.json +1 -1
  86. package/dist/es2019/actions/index.js +20 -23
  87. package/dist/es2019/extensibility.js +1 -1
  88. package/dist/es2019/labs/next/full-page.js +2 -2
  89. package/dist/es2019/plugins/block-type/styles.js +3 -3
  90. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
  91. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
  92. package/dist/es2019/plugins/card/messages.js +4 -4
  93. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
  94. package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
  95. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
  96. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
  97. package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
  98. package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
  99. package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
  100. package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
  101. package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  102. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  103. package/dist/es2019/plugins/card/ui/styled.js +2 -2
  104. package/dist/es2019/plugins/card/ui/types.js +1 -0
  105. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
  106. package/dist/es2019/plugins/code-block/styles.js +14 -14
  107. package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
  108. package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
  109. package/dist/es2019/plugins/extension/utils.js +37 -2
  110. package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
  111. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
  112. package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
  113. package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
  114. package/dist/es2019/plugins/layout/styles.js +5 -1
  115. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
  116. package/dist/es2019/plugins/list/commands/index.js +29 -28
  117. package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
  118. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  119. package/dist/es2019/plugins/media/styles.js +1 -1
  120. package/dist/es2019/plugins/media/utils/media-single.js +14 -1
  121. package/dist/es2019/plugins/paste/handlers.js +19 -5
  122. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  123. package/dist/es2019/plugins/placeholder-text/index.js +46 -1
  124. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
  125. package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
  126. package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
  127. package/dist/es2019/plugins/table/commands/index.js +1 -1
  128. package/dist/es2019/plugins/table/commands/insert.js +1 -1
  129. package/dist/es2019/plugins/table/commands/misc.js +5 -11
  130. package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
  131. package/dist/es2019/plugins/table/handlers.js +6 -2
  132. package/dist/es2019/plugins/table/index.js +4 -8
  133. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
  134. package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
  135. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  136. package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
  137. package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
  138. package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
  139. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  140. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  141. package/dist/es2019/plugins/table/reducer.js +0 -9
  142. package/dist/es2019/plugins/table/toolbar.js +1 -4
  143. package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
  144. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -1
  145. package/dist/es2019/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
  146. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
  147. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
  148. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  149. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
  150. package/dist/es2019/plugins/table/ui/{common-styles.css.js → common-styles.js} +57 -27
  151. package/dist/es2019/plugins/table/ui/{ui-styles.css.js → ui-styles.js} +99 -78
  152. package/dist/es2019/plugins/table/utils/nodes.js +11 -11
  153. package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
  154. package/dist/es2019/plugins/text-formatting/styles.js +3 -3
  155. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
  156. package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  157. package/dist/es2019/plugins/text-formatting/utils.js +13 -1
  158. package/dist/es2019/plugins/type-ahead/api.js +31 -2
  159. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
  160. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +12 -0
  161. package/dist/es2019/plugins/type-ahead/utils.js +15 -0
  162. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  163. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  164. package/dist/es2019/ui/ContentStyles/index.js +46 -24
  165. package/dist/es2019/utils/index.js +1 -1
  166. package/dist/es2019/utils/insert.js +2 -10
  167. package/dist/es2019/utils/selection.js +1 -6
  168. package/dist/es2019/version-wrapper.js +1 -1
  169. package/dist/es2019/version.json +1 -1
  170. package/dist/esm/actions/index.js +76 -48
  171. package/dist/esm/extensibility.js +1 -1
  172. package/dist/esm/labs/next/full-page.js +2 -2
  173. package/dist/esm/plugins/block-type/styles.js +4 -2
  174. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
  175. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
  176. package/dist/esm/plugins/card/messages.js +4 -4
  177. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
  178. package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
  179. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
  180. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
  181. package/dist/esm/plugins/card/ui/assets/card.js +1 -1
  182. package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
  183. package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
  184. package/dist/esm/plugins/card/ui/assets/url.js +1 -1
  185. package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  186. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  187. package/dist/esm/plugins/card/ui/styled.js +2 -2
  188. package/dist/esm/plugins/card/ui/types.js +1 -0
  189. package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
  190. package/dist/esm/plugins/code-block/styles.js +42 -38
  191. package/dist/esm/plugins/extension/plugin-factory.js +3 -1
  192. package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
  193. package/dist/esm/plugins/extension/utils.js +51 -9
  194. package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
  195. package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
  196. package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
  197. package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
  198. package/dist/esm/plugins/layout/styles.js +2 -2
  199. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
  200. package/dist/esm/plugins/list/commands/index.js +33 -34
  201. package/dist/esm/plugins/list/utils/replace-content.js +21 -0
  202. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  203. package/dist/esm/plugins/media/styles.js +1 -1
  204. package/dist/esm/plugins/media/utils/media-single.js +12 -1
  205. package/dist/esm/plugins/paste/handlers.js +19 -5
  206. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  207. package/dist/esm/plugins/placeholder-text/index.js +44 -1
  208. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
  209. package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
  210. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  211. package/dist/esm/plugins/table/commands/index.js +1 -1
  212. package/dist/esm/plugins/table/commands/insert.js +1 -1
  213. package/dist/esm/plugins/table/commands/misc.js +5 -15
  214. package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
  215. package/dist/esm/plugins/table/handlers.js +6 -2
  216. package/dist/esm/plugins/table/index.js +6 -11
  217. package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
  218. package/dist/esm/plugins/table/nodeviews/table.js +6 -37
  219. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  220. package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
  221. package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
  222. package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
  223. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  224. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  225. package/dist/esm/plugins/table/reducer.js +0 -7
  226. package/dist/esm/plugins/table/toolbar.js +1 -10
  227. package/dist/esm/plugins/table/transforms/metadata.js +1 -1
  228. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -1
  229. package/dist/esm/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
  230. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
  231. package/dist/esm/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
  232. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  233. package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
  234. package/dist/esm/plugins/table/ui/common-styles.js +27 -0
  235. package/dist/esm/plugins/table/ui/ui-styles.js +68 -0
  236. package/dist/esm/plugins/table/utils/nodes.js +14 -14
  237. package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
  238. package/dist/esm/plugins/text-formatting/styles.js +4 -2
  239. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
  240. package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  241. package/dist/esm/plugins/text-formatting/utils.js +18 -0
  242. package/dist/esm/plugins/type-ahead/api.js +30 -2
  243. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
  244. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +12 -0
  245. package/dist/esm/plugins/type-ahead/utils.js +17 -3
  246. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  247. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  248. package/dist/esm/ui/ContentStyles/index.js +28 -10
  249. package/dist/esm/utils/index.js +1 -1
  250. package/dist/esm/utils/insert.js +2 -10
  251. package/dist/esm/utils/selection.js +1 -6
  252. package/dist/esm/version-wrapper.js +1 -1
  253. package/dist/esm/version.json +1 -1
  254. package/dist/types/actions/index.d.ts +2 -2
  255. package/dist/types/extensibility.d.ts +1 -1
  256. package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
  257. package/dist/types/plugins/block-type/styles.d.ts +2 -1
  258. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
  259. package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
  260. package/dist/types/plugins/card/messages.d.ts +2 -2
  261. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
  262. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
  263. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
  264. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
  265. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
  266. package/dist/types/plugins/card/ui/styled.d.ts +2 -3
  267. package/dist/types/plugins/card/ui/types.d.ts +12 -0
  268. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
  269. package/dist/types/plugins/code-block/styles.d.ts +3 -2
  270. package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
  271. package/dist/types/plugins/extension/types.d.ts +1 -0
  272. package/dist/types/plugins/extension/utils.d.ts +3 -1
  273. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
  274. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
  275. package/dist/types/plugins/layout/styles.d.ts +1 -1
  276. package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
  277. package/dist/types/plugins/list/commands/index.d.ts +0 -1
  278. package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
  279. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  280. package/dist/types/plugins/media/styles.d.ts +1 -1
  281. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  282. package/dist/types/plugins/panel/styles.d.ts +1 -1
  283. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  284. package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
  285. package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
  286. package/dist/types/plugins/rule/styles.d.ts +1 -1
  287. package/dist/types/plugins/table/commands/index.d.ts +1 -1
  288. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  289. package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
  290. package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
  291. package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  292. package/dist/types/plugins/table/types.d.ts +1 -8
  293. package/dist/types/plugins/table/ui/FloatingContextualButton/{styles.css.d.ts → styles.d.ts} +0 -0
  294. package/dist/types/plugins/table/ui/FloatingContextualMenu/{styles.css.d.ts → styles.d.ts} +0 -0
  295. package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
  296. package/dist/types/plugins/table/ui/common-styles.d.ts +6 -0
  297. package/dist/types/plugins/table/ui/ui-styles.d.ts +15 -0
  298. package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
  299. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  300. package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
  301. package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
  302. package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
  303. package/dist/types/plugins/type-ahead/api.d.ts +11 -1
  304. package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
  305. package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
  306. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  307. package/dist/types/utils/index.d.ts +1 -1
  308. package/dist/types/utils/selection.d.ts +0 -1
  309. package/package.json +28 -26
  310. package/dist/cjs/plugins/table/ui/common-styles.css.js +0 -44
  311. package/dist/cjs/plugins/table/ui/ui-styles.css.js +0 -95
  312. package/dist/esm/plugins/table/ui/common-styles.css.js +0 -23
  313. package/dist/esm/plugins/table/ui/ui-styles.css.js +0 -59
  314. package/dist/types/plugins/table/ui/common-styles.css.d.ts +0 -3
  315. package/dist/types/plugins/table/ui/ui-styles.css.d.ts +0 -14
@@ -4,12 +4,13 @@ import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
7
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
7
8
 
8
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
10
 
10
11
  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; } }
11
12
 
12
- import React, { useMemo } from 'react';
13
+ import React, { useMemo, useState, useEffect } from 'react';
13
14
  import { injectIntl } from 'react-intl-next';
14
15
  import { Separator, Wrapper, ButtonGroup } from '../../../../ui/styles';
15
16
  import { useFormattingIcons, useHasFormattingActived } from './hooks/formatting-icons';
@@ -19,6 +20,8 @@ import { SingleToolbarButtons } from './single-toolbar-buttons';
19
20
  import { MoreButton } from './more-button';
20
21
  import { FormattingTextDropdownMenu } from './dropdown-menu';
21
22
  import { toolbarMessages } from './toolbar-messages';
23
+ import { usePreviousObjectState, compareItemsArrays, isArrayContainsContent } from '../../utils';
24
+ import Announcer from '../../../../utils/announcer/announcer';
22
25
 
23
26
  var ToolbarFormatting = function ToolbarFormatting(_ref) {
24
27
  var shouldUseResponsiveToolbar = _ref.shouldUseResponsiveToolbar,
@@ -33,6 +36,12 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
33
36
  var editorState = useMemo(function () {
34
37
  return editorView.state;
35
38
  }, [editorView.state]);
39
+
40
+ var _useState = useState(''),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ message = _useState2[0],
43
+ setMessage = _useState2[1];
44
+
36
45
  var defaultIcons = useFormattingIcons({
37
46
  editorState: editorState,
38
47
  intl: intl,
@@ -59,6 +68,54 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
59
68
  dropdownItems = _useResponsiveToolbar.dropdownItems,
60
69
  singleItems = _useResponsiveToolbar.singleItems;
61
70
 
71
+ var clearFormattingStatus = intl.formatMessage(toolbarMessages.textFormattingOff);
72
+ var superscriptOffSubscriptOnStatus = intl.formatMessage(toolbarMessages.superscriptOffSubscriptOn);
73
+ var subscriptOffSuperscriptOnStatus = intl.formatMessage(toolbarMessages.subscriptOffSuperscriptOn);
74
+ var activeItems = [].concat(_toConsumableArray(dropdownItems), _toConsumableArray(singleItems)).filter(function (item) {
75
+ return item.isActive;
76
+ });
77
+ var prevActiveItems = usePreviousObjectState(activeItems);
78
+ var fromSuperscriptToSubscript = isArrayContainsContent(activeItems, 'Subscript') && isArrayContainsContent(prevActiveItems, 'Superscript');
79
+ var fromSubscriptToSuperscript = isArrayContainsContent(activeItems, 'Superscript') && isArrayContainsContent(prevActiveItems, 'Subscript');
80
+ var comparedItems;
81
+ var screenReaderMessage = '';
82
+
83
+ if (prevActiveItems && activeItems.length > prevActiveItems.length) {
84
+ comparedItems = compareItemsArrays(activeItems, prevActiveItems);
85
+ screenReaderMessage = intl.formatMessage(toolbarMessages.on, {
86
+ formattingType: comparedItems[0].content
87
+ });
88
+ } else {
89
+ comparedItems = compareItemsArrays(prevActiveItems, activeItems);
90
+
91
+ if (comparedItems && comparedItems.length) {
92
+ var _activeItems$;
93
+
94
+ screenReaderMessage = intl.formatMessage(toolbarMessages.off, {
95
+ formattingType: comparedItems[0].content
96
+ });
97
+
98
+ if (((_activeItems$ = activeItems[0]) === null || _activeItems$ === void 0 ? void 0 : _activeItems$.content) === 'Code') {
99
+ screenReaderMessage = intl.formatMessage(toolbarMessages.codeOn, {
100
+ textFormattingOff: (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1 ? clearFormattingStatus : screenReaderMessage
101
+ });
102
+ }
103
+
104
+ if (fromSuperscriptToSubscript) {
105
+ screenReaderMessage = superscriptOffSubscriptOnStatus;
106
+ }
107
+
108
+ if (fromSubscriptToSuperscript) {
109
+ screenReaderMessage = subscriptOffSuperscriptOnStatus;
110
+ }
111
+ }
112
+ } // handle 'Clear formatting' status for screen readers
113
+
114
+
115
+ if (!(activeItems !== null && activeItems !== void 0 && activeItems.length) && (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1) {
116
+ screenReaderMessage = clearFormattingStatus;
117
+ }
118
+
62
119
  var items = useMemo(function () {
63
120
  if (!clearIcon) {
64
121
  return dropdownItems;
@@ -67,9 +124,19 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
67
124
  return [].concat(_toConsumableArray(dropdownItems), [clearIcon]);
68
125
  }, [clearIcon, dropdownItems]);
69
126
  var moreFormattingButtonLabel = intl.formatMessage(toolbarMessages.moreFormatting);
127
+ useEffect(function () {
128
+ if (screenReaderMessage) {
129
+ setMessage(screenReaderMessage);
130
+ }
131
+ }, [screenReaderMessage]);
70
132
  return /*#__PURE__*/React.createElement(ButtonGroup, {
71
133
  width: isReducedSpacing ? 'small' : 'large'
72
- }, /*#__PURE__*/React.createElement(SingleToolbarButtons, {
134
+ }, message && /*#__PURE__*/React.createElement(Announcer, {
135
+ ariaLive: "assertive",
136
+ text: message,
137
+ ariaRelevant: "additions",
138
+ delay: 250
139
+ }), /*#__PURE__*/React.createElement(SingleToolbarButtons, {
73
140
  items: singleItems,
74
141
  editorView: editorView,
75
142
  isReducedSpacing: isReducedSpacing
@@ -15,16 +15,31 @@ export var toolbarMessages = defineMessages({
15
15
  defaultMessage: 'Code',
16
16
  description: 'Whether the text selection has monospaced/code font'
17
17
  },
18
+ codeOn: {
19
+ id: 'fabric.editor.code.on',
20
+ defaultMessage: '{textFormattingOff}, Code On',
21
+ description: 'Reports that code formatting has been turned on'
22
+ },
18
23
  subscript: {
19
24
  id: 'fabric.editor.subscript',
20
25
  defaultMessage: 'Subscript',
21
26
  description: 'Whether the text selection is written below the line in a slightly smaller size'
22
27
  },
28
+ subscriptOffSuperscriptOn: {
29
+ id: 'fabric.editor.subscript.off.superscript.on',
30
+ defaultMessage: 'Subscript Off, Superscript On',
31
+ description: 'Reports text formatting in case when subscript off and superscript on'
32
+ },
23
33
  superscript: {
24
34
  id: 'fabric.editor.superscript',
25
35
  defaultMessage: 'Superscript',
26
36
  description: 'Whether the text selection is written above the line in a slightly smaller size'
27
37
  },
38
+ superscriptOffSubscriptOn: {
39
+ id: 'fabric.editor.superscript.off.subscript.on',
40
+ defaultMessage: 'Superscript Off, Subscript On',
41
+ description: 'Describe text formatting in case when Superscript Off and Subscript on'
42
+ },
28
43
  clearFormatting: {
29
44
  id: 'fabric.editor.clearFormatting',
30
45
  defaultMessage: 'Clear formatting',
@@ -44,5 +59,20 @@ export var toolbarMessages = defineMessages({
44
59
  id: 'fabric.editor.italic',
45
60
  defaultMessage: 'Italic',
46
61
  description: 'This refers to italics or emphasized formatting.'
62
+ },
63
+ on: {
64
+ id: 'fabric.editor.on',
65
+ defaultMessage: '{formattingType} On',
66
+ description: 'Reports that text formatting has been turned on'
67
+ },
68
+ off: {
69
+ id: 'fabric.editor.off',
70
+ defaultMessage: '{formattingType} Off',
71
+ description: 'Reports that text formatting has been turned off'
72
+ },
73
+ textFormattingOff: {
74
+ id: 'fabric.editor.text.formatting.off',
75
+ defaultMessage: 'Text formatting Off',
76
+ description: 'Reports that text formatting has been turned off'
47
77
  }
48
78
  });
@@ -1,3 +1,4 @@
1
+ import { useRef, useEffect } from 'react';
1
2
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
2
3
  import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './commands/clear-formatting';
3
4
  export var nodeLen = function nodeLen(node) {
@@ -127,4 +128,21 @@ var marksArePresent = function marksArePresent(state) {
127
128
 
128
129
  export var checkFormattingIsPresent = function checkFormattingIsPresent(state) {
129
130
  return marksArePresent(state) || blockStylingIsPresent(state);
131
+ };
132
+ export var usePreviousObjectState = function usePreviousObjectState(value) {
133
+ var ref = useRef();
134
+ useEffect(function () {
135
+ ref.current = value;
136
+ });
137
+ return ref.current;
138
+ };
139
+ export var compareItemsArrays = function compareItemsArrays(items, prevItems) {
140
+ return items && items.filter(function (item) {
141
+ return !prevItems.includes(item);
142
+ });
143
+ };
144
+ export var isArrayContainsContent = function isArrayContainsContent(items, content) {
145
+ return items.filter(function (item) {
146
+ return item.content === content;
147
+ }).length > 0;
130
148
  };
@@ -1,7 +1,7 @@
1
1
  import { TypeAheadAvailableNodes, SelectItemMode } from '@atlaskit/editor-common/type-ahead';
2
- import { findHandler, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
2
+ import { findHandler, findHandlerByTrigger, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
3
3
  import { INPUT_METHOD } from '../analytics/types/enums';
4
- import { openTypeAheadAtCursor } from './transforms/open-typeahead-at-cursor';
4
+ import { openTypeAheadAtCursor, openTypeAhead } from './transforms/open-typeahead-at-cursor';
5
5
  import { closeTypeAhead } from './transforms/close-type-ahead';
6
6
  import { updateQuery } from './commands/update-query';
7
7
  import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
@@ -207,6 +207,34 @@ var currentQuery = function currentQuery(_ref8) {
207
207
  };
208
208
  };
209
209
 
210
+ var find = function find(_ref9) {
211
+ var editorView = _ref9.editorView;
212
+ return function (trigger) {
213
+ var editorState = editorView.state;
214
+ var handler = findHandlerByTrigger({
215
+ trigger: trigger,
216
+ editorState: editorState
217
+ });
218
+
219
+ if (!handler) {
220
+ return null;
221
+ }
222
+
223
+ return handler;
224
+ };
225
+ }; // This is an internal tool to be used inside of others Editor Plugins
226
+ // We shouldn't public export this method.
227
+
228
+
229
+ export var createInternalTypeAheadTools = function createInternalTypeAheadTools(editorView) {
230
+ var props = {
231
+ editorView: editorView
232
+ };
233
+ return {
234
+ findTypeAheadHandler: find(props),
235
+ openTypeAheadHandler: openTypeAhead
236
+ };
237
+ };
210
238
  export var createTypeAheadTools = function createTypeAheadTools(editorView) {
211
239
  var props = {
212
240
  editorView: editorView
@@ -1,11 +1,11 @@
1
1
  import { TextSelection } from 'prosemirror-state';
2
2
  import { pluginKey } from '../pm-plugins/key';
3
3
  import { ACTIONS } from '../pm-plugins/actions';
4
- export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
5
- var triggerHandler = _ref.triggerHandler,
6
- inputMethod = _ref.inputMethod,
7
- query = _ref.query;
4
+ export var openTypeAhead = function openTypeAhead(props) {
8
5
  return function (tr) {
6
+ var triggerHandler = props.triggerHandler,
7
+ inputMethod = props.inputMethod,
8
+ query = props.query;
9
9
  tr.setMeta(pluginKey, {
10
10
  action: ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR,
11
11
  params: {
@@ -14,6 +14,18 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
14
14
  query: query
15
15
  }
16
16
  });
17
+ };
18
+ };
19
+ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
20
+ var triggerHandler = _ref.triggerHandler,
21
+ inputMethod = _ref.inputMethod,
22
+ query = _ref.query;
23
+ return function (tr) {
24
+ openTypeAhead({
25
+ triggerHandler: triggerHandler,
26
+ inputMethod: inputMethod,
27
+ query: query
28
+ })(tr);
17
29
  var selection = tr.selection;
18
30
 
19
31
  if (!(selection instanceof TextSelection)) {
@@ -180,6 +180,18 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
180
180
  };
181
181
 
182
182
  var onFocusOut = function onFocusOut(event) {
183
+ var _window$getSelection;
184
+
185
+ // See ED-14909: Chrome may emit focusout events where an input
186
+ // device was not directly responsible. (This rears in react v17+ consumers
187
+ // where react-managed node removal now appears to propagate focusout events to
188
+ // our event listener). As this path is strictly for click or other typeahead
189
+ // dismissals that don't involve typeahead item selection, we carve out an
190
+ // exception for Chrome-specific events where an input device was not the initiator.
191
+ if (browser.chrome && !(((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.type) === 'Range') && !(event !== null && event !== void 0 && event.sourceCapabilities)) {
192
+ return;
193
+ }
194
+
183
195
  cancel({
184
196
  addPrefixTrigger: true,
185
197
  text: cleanedInputContent(),
@@ -60,9 +60,23 @@ export var findHandler = function findHandler(id, state) {
60
60
  return h.id === id;
61
61
  }) || null;
62
62
  };
63
- export var moveSelectedIndex = function moveSelectedIndex(_ref) {
64
- var editorView = _ref.editorView,
65
- direction = _ref.direction;
63
+ export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
64
+ var trigger = _ref.trigger,
65
+ editorState = _ref.editorState;
66
+ var pluginState = typeAheadPluginKey.getState(editorState);
67
+
68
+ if (!pluginState || !pluginState.typeAheadHandlers || pluginState.typeAheadHandlers.length === 0) {
69
+ return null;
70
+ }
71
+
72
+ var typeAheadHandlers = pluginState.typeAheadHandlers;
73
+ return typeAheadHandlers.find(function (h) {
74
+ return h.trigger === trigger;
75
+ }) || null;
76
+ };
77
+ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
78
+ var editorView = _ref2.editorView,
79
+ direction = _ref2.direction;
66
80
  return function () {
67
81
  var typeAheadState = getPluginState(editorView.state);
68
82
 
@@ -26,7 +26,7 @@ import ContentStyles from '../../ContentStyles';
26
26
  import { pluginKey as maxContentSizePluginKey } from '../../../plugins/max-content-size';
27
27
  import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
28
28
  import { ClickAreaBlock } from '../../Addon';
29
- import { tableCommentEditorStyles } from '../../../plugins/table/ui/common-styles.css';
29
+ import { deprecatedTableCommentEditorStyles } from '../../../plugins/table/ui/common-styles';
30
30
  import WithFlash from '../../WithFlash';
31
31
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
32
32
  import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
@@ -42,7 +42,7 @@ var CommentEditor = styled.div(_templateObject || (_templateObject = _taggedTemp
42
42
  CommentEditor.displayName = 'CommentEditor';
43
43
  var ContentArea = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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) {
44
44
  return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
45
- }, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, tableCommentEditorStyles);
45
+ }, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, deprecatedTableCommentEditorStyles);
46
46
  ContentArea.displayName = 'ContentArea';
47
47
  var SecondaryToolbar = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
48
48
  SecondaryToolbar.displayName = 'SecondaryToolbar';
@@ -6,7 +6,7 @@ import styled from 'styled-components';
6
6
  import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorSwoopCubicBezier, akLayoutGutterOffset, ATLASSIAN_NAVIGATION_HEIGHT, akEditorContextPanelWidth } from '@atlaskit/editor-shared-styles';
7
7
  import { taskListSelector, decisionListSelector } from '@atlaskit/adf-schema';
8
8
  import ContentStyles from '../../ContentStyles';
9
- import { tableFullPageEditorStyles } from '../../../plugins/table/ui/common-styles.css';
9
+ import { deprecatedTableFullPageEditorStyles } from '../../../plugins/table/ui/common-styles';
10
10
  import { tableMarginFullWidthMode } from '../../../plugins/table/ui/consts';
11
11
  import { scrollbarStyles } from '../../styles';
12
12
  var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
@@ -27,7 +27,7 @@ export var EditorContentArea = styled.div(_templateObject5 || (_templateObject5
27
27
  var theme = _ref.theme,
28
28
  fullWidthMode = _ref.fullWidthMode;
29
29
  return (fullWidthMode ? akEditorFullWidthLayoutWidth : theme.layoutMaxWidth) + TOTAL_PADDING;
30
- }, SWOOP_ANIMATION, taskListSelector, decisionListSelector, tableFullPageEditorStyles, function (_ref2) {
30
+ }, SWOOP_ANIMATION, taskListSelector, decisionListSelector, deprecatedTableFullPageEditorStyles, function (_ref2) {
31
31
  var containerWidth = _ref2.containerWidth;
32
32
 
33
33
  if (!containerWidth) {
@@ -1,16 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
3
 
4
- var _templateObject;
4
+ var _templateObject, _templateObject2;
5
5
 
6
- import React from 'react';
6
+ /** @jsx jsx */
7
+ import React, { useMemo } from 'react';
8
+ import { jsx, css, useTheme } from '@emotion/react';
7
9
  import styled from 'styled-components';
8
10
  import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles } from '@atlaskit/editor-common/styles';
9
11
  import { editorFontSize } from '@atlaskit/editor-shared-styles';
10
12
  import { unsupportedStyles } from '../../plugins/unsupported-content/styles';
11
13
  import { telepointerStyle } from '../../plugins/collab-edit/styles';
12
14
  import { gapCursorStyles } from '../../plugins/selection/gap-cursor/styles';
13
- import { tableStyles } from '../../plugins/table/ui/common-styles.css';
15
+ import { tableStyles } from '../../plugins/table/ui/common-styles';
14
16
  import { placeholderStyles } from '../../plugins/placeholder/styles';
15
17
  import { blocktypeStyles } from '../../plugins/block-type/styles';
16
18
  import { codeBlockStyles, highlightingCodeBlockStyles } from '../../plugins/code-block/styles';
@@ -36,17 +38,33 @@ import { smartCardStyles } from '../../plugins/card/styles';
36
38
  import { dateStyles } from '../../plugins/date/styles';
37
39
  import { embedCardStyles } from '../../plugins/card/ui/styled';
38
40
  import { useFeatureFlags } from '../../plugins/feature-flags-context';
39
- var ContentStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), editorFontSize, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, blocktypeStyles, textFormattingStyles, placeholderTextStyles, placeholderStyles, function (_ref) {
41
+
42
+ var contentStyles = function contentStyles(props) {
43
+ var _props$featureFlags;
44
+
45
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), editorFontSize({
46
+ theme: props.theme
47
+ }), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, tableStyles(props), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles(props) : codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, mediaStyles, layoutStyles, tasksAndDecisionsStyles, blockMarksSharedStyles, dateSharedStyle, annotationSharedStyles(props), embedCardStyles);
48
+ };
49
+
50
+ var DeprecatedContentStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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"])), placeholderTextStyles, placeholderStyles, listsStyles, ruleStyles, telepointerStyle, gapCursorStyles, panelStyles, fakeCursorStyles, mentionsStyles, function (_ref) {
40
51
  var featureFlags = _ref.featureFlags;
41
- return featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles : codeBlockStyles;
42
- }, textColorStyles, listsStyles, ruleStyles, mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles, panelStyles, fakeCursorStyles, mentionsStyles, function (_ref2) {
43
- var featureFlags = _ref2.featureFlags;
44
52
  return featureFlags !== null && featureFlags !== void 0 && featureFlags.nextEmojiNodeView ? emojiStylesNext : emojiStyles;
45
- }, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles, findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles, smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
53
+ }, gridStyles, linkStyles, extensionStyles, expandStyles, findReplaceStyles, taskDecisionStyles, statusStyles, smartCardStyles, smartCardSharedStyles, dateStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
46
54
  export default /*#__PURE__*/React.forwardRef(function (props, ref) {
47
55
  var featureFlags = useFeatureFlags();
48
- return /*#__PURE__*/React.createElement(ContentStyles, _extends({}, props, {
56
+ var allowAnnotation = props.allowAnnotation;
57
+ var theme = useTheme();
58
+ var memoizedStyle = useMemo(function () {
59
+ return contentStyles({
60
+ theme: theme,
61
+ allowAnnotation: allowAnnotation,
62
+ featureFlags: featureFlags
63
+ });
64
+ }, [theme, featureFlags, allowAnnotation]);
65
+ return jsx(DeprecatedContentStyles, _extends({}, props, {
49
66
  innerRef: ref,
50
- featureFlags: featureFlags
67
+ featureFlags: featureFlags,
68
+ css: memoizedStyle
51
69
  }));
52
70
  });
@@ -12,7 +12,7 @@ export { isEmptyParagraph, hasVisibleContent, isNodeEmpty, isEmptyDocument, proc
12
12
  export { cascadeCommands, getEditorValueWithMedia } from './action';
13
13
  export { isMarkAllowedInRange, isMarkExcluded, removeBlockMarks, sanitiseSelectionMarksForWrapping, sanitiseMarksInSelection } from './mark';
14
14
  export { isParagraph, isText, isLinkMark, validateNodes } from './nodes';
15
- export { isChromeWithSelectionBug, normaliseNestedLayout, setNodeSelection, setAllSelection, setGapCursorSelection, setCellSelection, setTextSelection, isValidPosition } from './selection';
15
+ export { normaliseNestedLayout, setNodeSelection, setAllSelection, setGapCursorSelection, setCellSelection, setTextSelection, isValidPosition } from './selection';
16
16
  export { containsClassName } from './dom';
17
17
  export { default as measurements } from './performance/measure-enum';
18
18
 
@@ -4,7 +4,7 @@ import { NodeSelection, Selection } from 'prosemirror-state';
4
4
  import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform';
5
5
  import { isEmptyParagraph } from './document';
6
6
  import { GapCursorSelection, Side } from '../plugins/selection/gap-cursor-selection';
7
- import { isChromeWithSelectionBug, normaliseNestedLayout } from './selection';
7
+ import { normaliseNestedLayout } from './selection';
8
8
  export var LookDirection;
9
9
 
10
10
  (function (LookDirection) {
@@ -167,15 +167,7 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
167
167
  */
168
168
  } else if (node.isInline || isInputFragment) {
169
169
  var fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
170
- tr = tr.replaceWith(start, start, fragment); // This problem affects Chrome v58+. See: https://github.com/ProseMirror/prosemirror/issues/710
171
-
172
- if (isChromeWithSelectionBug) {
173
- var selection = document.getSelection();
174
-
175
- if (selection) {
176
- selection.empty();
177
- }
178
- }
170
+ tr = tr.replaceWith(start, start, fragment);
179
171
 
180
172
  if (opts.selectInlineNode) {
181
173
  // Select inserted node
@@ -6,7 +6,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
 
7
7
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
8
8
  import { NodeSelection, TextSelection, AllSelection } from 'prosemirror-state';
9
- import { browser } from '@atlaskit/editor-common/utils';
10
9
  import { GapCursorSelection } from '../plugins/selection/gap-cursor/selection';
11
10
  export var setNodeSelection = function setNodeSelection(view, pos) {
12
11
  var state = view.state,
@@ -62,11 +61,7 @@ export var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
62
61
  }
63
62
 
64
63
  return node;
65
- }; // @see: https://github.com/ProseMirror/prosemirror/issues/710
66
- // @see: https://bugs.chromium.org/p/chromium/issues/detail?id=740085
67
- // Chrome >= 58 (desktop only)
68
-
69
- export var isChromeWithSelectionBug = browser.chrome && !browser.android && browser.chrome_version >= 58;
64
+ };
70
65
  export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
71
66
  if (!parentNode) {
72
67
  return false;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "161.0.0";
2
+ export var version = "162.0.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "161.0.0",
3
+ "version": "162.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -16,7 +16,7 @@ export interface EditorActionsOptions<T> {
16
16
  replaceSelection(rawValue: Node | Object | string): boolean;
17
17
  appendText(text: string): boolean;
18
18
  isDocumentEmpty(): boolean;
19
- getResolvedEditorState(): Promise<ResolvedEditorState>;
19
+ getResolvedEditorState(): Promise<ResolvedEditorState | undefined>;
20
20
  }
21
21
  export default class EditorActions<T = any> implements EditorActionsOptions<T> {
22
22
  private editorView?;
@@ -50,5 +50,5 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
50
50
  * refers to the latest state of editor with confirmed
51
51
  * steps.
52
52
  */
53
- getResolvedEditorState: () => Promise<ResolvedEditorState>;
53
+ getResolvedEditorState: () => Promise<ResolvedEditorState | undefined>;
54
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 declare const EmitterEvents: {
9
9
  TABLE_DELETED: string;
10
10
  };
@@ -36,7 +36,6 @@ declare type ListConvertedTrackAEP = TrackAEP<ACTION.CONVERTED, ACTION_SUBJECT.L
36
36
  } & CommonListAnalyticsAttributes, undefined>;
37
37
  declare type ListIndentedAEP = TrackAEP<ACTION.INDENTED, ACTION_SUBJECT.LIST, ACTION_SUBJECT_ID.FORMAT_LIST_BULLET | ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER, {
38
38
  inputMethod: INPUT_METHOD;
39
- canSink?: boolean;
40
39
  } & CommonListAnalyticsAttributes, undefined>;
41
40
  declare type ListOutdentedAEP = TrackAEP<ACTION.OUTDENTED, ACTION_SUBJECT.LIST, ACTION_SUBJECT_ID.FORMAT_LIST_BULLET | ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER, {
42
41
  inputMethod: INPUT_METHOD;
@@ -1 +1,2 @@
1
- export declare const blocktypeStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme").AtlaskitThemeProps | import("@atlaskit/theme").CustomThemeProps | import("@atlaskit/theme").NoThemeProps | undefined, any>>[];
1
+ import { ThemeProps } from '@atlaskit/theme/types';
2
+ export declare const blocktypeStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -1,3 +1,4 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
2
3
  import { WrappedComponentProps } from 'react-intl-next';
3
4
  import { BlockTypeState } from '../../pm-plugins/main';
@@ -1,11 +1,6 @@
1
+ import { ThemeProps } from '@atlaskit/theme/types';
1
2
  import { HTMLAttributes, ComponentClass } from 'react';
2
- export declare const BlockTypeMenuItem: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
3
- tagName: string;
4
- selected?: boolean | undefined;
5
- }, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
6
- tagName: string;
7
- selected?: boolean | undefined;
8
- }>;
3
+ export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean | undefined) => (themeProps: ThemeProps) => import("@emotion/react").SerializedStyles;
9
4
  export declare const KeyboardShortcut: ComponentClass<HTMLAttributes<{}> & {
10
5
  selected?: boolean;
11
6
  }>;
@@ -44,7 +44,7 @@ export declare const messages: {
44
44
  defaultMessage: string;
45
45
  description: string;
46
46
  };
47
- cardTitle: {
47
+ blockTitle: {
48
48
  id: string;
49
49
  defaultMessage: string;
50
50
  description: string;
@@ -64,7 +64,7 @@ export declare const messages: {
64
64
  defaultMessage: string;
65
65
  description: string;
66
66
  };
67
- cardDescription: {
67
+ blockDescription: {
68
68
  id: string;
69
69
  defaultMessage: string;
70
70
  description: string;
@@ -1,5 +1,21 @@
1
1
  /// <reference types="react" />
2
+ import type { GlyphProps } from '@atlaskit/icon/types';
3
+ /**
4
+ * Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
5
+ */
6
+ export declare const StyledButton: import("styled-components").StyledComponentClass<import("../../floating-toolbar/ui/Button").Props, any, Pick<import("../../floating-toolbar/ui/Button").Props, "title" | "children" | "className" | "tabIndex" | "onFocus" | "onBlur" | "onClick" | "onMouseEnter" | "onMouseLeave" | "icon" | "appearance" | "disabled" | "target" | "iconAfter" | "selected" | "href" | "tooltipContent" | "testId" | "hideTooltipOnClick" | "ariaHasPopup"> & {
7
+ theme?: any;
8
+ }>;
9
+ export interface ButtonOptionProps {
10
+ title: string;
11
+ selected: boolean;
12
+ testId: string;
13
+ disabled: boolean;
14
+ tooltipContent?: string | null;
15
+ onClick: () => void;
16
+ icon: (props: GlyphProps) => JSX.Element;
17
+ }
2
18
  export interface LinkToolbarButtonGroupProps {
19
+ options: ButtonOptionProps[];
3
20
  }
4
- declare const LinkToolbarButtonGroup: ({}: LinkToolbarButtonGroupProps) => JSX.Element;
5
- export default LinkToolbarButtonGroup;
21
+ export declare const LinkToolbarButtonGroup: ({ options, }: LinkToolbarButtonGroupProps) => JSX.Element;