@atlaskit/editor-core 159.0.1 → 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 +56 -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 +47 -8
  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 +41 -8
  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 +43 -8
  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
@@ -15,7 +15,7 @@ var _prosemirrorUtils = require("prosemirror-utils");
15
15
 
16
16
  var _utils = require("@atlaskit/editor-tables/utils");
17
17
 
18
- var _pluginFactory = require("../pm-plugins/plugin-factory");
18
+ var _pluginKey = require("../pm-plugins/plugin-key");
19
19
 
20
20
  var isIsolating = function isIsolating(node) {
21
21
  return !!node.type.spec.isolating;
@@ -23,7 +23,7 @@ var isIsolating = function isIsolating(node) {
23
23
 
24
24
  exports.isIsolating = isIsolating;
25
25
 
26
- var containsHeaderColumn = function containsHeaderColumn(state, table) {
26
+ var containsHeaderColumn = function containsHeaderColumn(table) {
27
27
  var map = _tableMap.TableMap.get(table); // Get cell positions for first column.
28
28
 
29
29
 
@@ -38,7 +38,7 @@ var containsHeaderColumn = function containsHeaderColumn(state, table) {
38
38
  try {
39
39
  var cell = table.nodeAt(cellPositions[i]);
40
40
 
41
- if (cell && cell.type !== state.schema.nodes.tableHeader) {
41
+ if (cell && cell.type !== table.type.schema.nodes.tableHeader) {
42
42
  return false;
43
43
  }
44
44
  } catch (e) {
@@ -51,13 +51,13 @@ var containsHeaderColumn = function containsHeaderColumn(state, table) {
51
51
 
52
52
  exports.containsHeaderColumn = containsHeaderColumn;
53
53
 
54
- var containsHeaderRow = function containsHeaderRow(state, table) {
54
+ var containsHeaderRow = function containsHeaderRow(table) {
55
55
  var map = _tableMap.TableMap.get(table);
56
56
 
57
57
  for (var i = 0; i < map.width; i++) {
58
58
  var cell = table.nodeAt(map.map[i]);
59
59
 
60
- if (cell && cell.type !== state.schema.nodes.tableHeader) {
60
+ if (cell && cell.type !== table.type.schema.nodes.tableHeader) {
61
61
  return false;
62
62
  }
63
63
  }
@@ -67,20 +67,20 @@ var containsHeaderRow = function containsHeaderRow(state, table) {
67
67
 
68
68
  exports.containsHeaderRow = containsHeaderRow;
69
69
 
70
- var checkIfHeaderColumnEnabled = function checkIfHeaderColumnEnabled(state) {
71
- return filterNearSelection(state, _utils.findTable, containsHeaderColumn, false);
70
+ var checkIfHeaderColumnEnabled = function checkIfHeaderColumnEnabled(selection) {
71
+ return filterNearSelection(selection, _utils.findTable, containsHeaderColumn, false);
72
72
  };
73
73
 
74
74
  exports.checkIfHeaderColumnEnabled = checkIfHeaderColumnEnabled;
75
75
 
76
- var checkIfHeaderRowEnabled = function checkIfHeaderRowEnabled(state) {
77
- return filterNearSelection(state, _utils.findTable, containsHeaderRow, false);
76
+ var checkIfHeaderRowEnabled = function checkIfHeaderRowEnabled(selection) {
77
+ return filterNearSelection(selection, _utils.findTable, containsHeaderRow, false);
78
78
  };
79
79
 
80
80
  exports.checkIfHeaderRowEnabled = checkIfHeaderRowEnabled;
81
81
 
82
- var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(state) {
83
- return filterNearSelection(state, _utils.findTable, function (_, table) {
82
+ var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(selection) {
83
+ return filterNearSelection(selection, _utils.findTable, function (table) {
84
84
  return !!table.attrs.isNumberColumnEnabled;
85
85
  }, false);
86
86
  };
@@ -88,7 +88,7 @@ var checkIfNumberColumnEnabled = function checkIfNumberColumnEnabled(state) {
88
88
  exports.checkIfNumberColumnEnabled = checkIfNumberColumnEnabled;
89
89
 
90
90
  var isLayoutSupported = function isLayoutSupported(state) {
91
- var permittedLayouts = _pluginFactory.pluginKey.getState(state).pluginConfig.permittedLayouts;
91
+ var permittedLayouts = _pluginKey.pluginKey.getState(state).pluginConfig.permittedLayouts;
92
92
 
93
93
  var _state$schema$nodes = state.schema.nodes,
94
94
  bodiedExtension = _state$schema$nodes.bodiedExtension,
@@ -133,14 +133,14 @@ var tablesHaveDifferentNoOfColumns = function tablesHaveDifferentNoOfColumns(cur
133
133
 
134
134
  exports.tablesHaveDifferentNoOfColumns = tablesHaveDifferentNoOfColumns;
135
135
 
136
- function filterNearSelection(state, findNode, predicate, defaultValue) {
137
- var found = findNode(state.selection);
136
+ function filterNearSelection(selection, findNode, predicate, defaultValue) {
137
+ var found = findNode(selection);
138
138
 
139
139
  if (!found) {
140
140
  return defaultValue;
141
141
  }
142
142
 
143
- return predicate(state, found.node, found.pos);
143
+ return predicate(found.node, found.pos);
144
144
  }
145
145
 
146
146
  function getTableWidths(node) {
@@ -7,10 +7,14 @@ exports.isSupportedSourceNode = exports.insertTaskDecisionWithAnalytics = export
7
7
 
8
8
  var _prosemirrorCommands = require("prosemirror-commands");
9
9
 
10
+ var _prosemirrorModel = require("prosemirror-model");
11
+
10
12
  var _prosemirrorState = require("prosemirror-state");
11
13
 
12
14
  var _prosemirrorUtils = require("prosemirror-utils");
13
15
 
16
+ var _prosemirrorTransform = require("prosemirror-transform");
17
+
14
18
  var _adfSchema = require("@atlaskit/adf-schema");
15
19
 
16
20
  var _analytics = require("../analytics");
@@ -250,6 +254,14 @@ var createListAtSelection = function createListAtSelection(tr, list, item, schem
250
254
  }, [item.create({
251
255
  localId: _adfSchema.uuid.generate()
252
256
  }, $from.node($from.depth).content)]);
257
+ var hasBlockquoteParent = (0, _prosemirrorUtils.findParentNodeOfType)(blockquote)(selection);
258
+
259
+ if (hasBlockquoteParent) {
260
+ var liftedDepth = $from.depth - 1;
261
+ var range = new _prosemirrorModel.NodeRange($from, $to, liftedDepth);
262
+ tr.lift(range, (0, _prosemirrorTransform.liftTarget)(range));
263
+ }
264
+
253
265
  var listParent = (0, _prosemirrorUtils.findParentNodeOfType)(taskList)(selection) || (0, _prosemirrorUtils.findParentNodeOfType)(decisionList)(selection);
254
266
  var listItem = (0, _prosemirrorUtils.findParentNodeOfType)(taskItem)(selection) || (0, _prosemirrorUtils.findParentNodeOfType)(decisionItem)(selection); // For a selection inside a task/decision list, we can't just simply replace the
255
267
  // node type as it will mess up lists with > 1 item
@@ -281,10 +293,12 @@ var createListAtSelection = function createListAtSelection(tr, list, item, schem
281
293
 
282
294
  var nodeTypesToReplace = [blockquote];
283
295
 
284
- if (nodeType === paragraph && childCount > 0) {
296
+ if (nodeType === paragraph && childCount > 0 || hasBlockquoteParent) {
285
297
  // Only convert paragraphs containing content.
286
298
  // Empty paragraphs use the default flow.
287
299
  // This distinction ensures the text selection remains in the correct location.
300
+ // We also want to replace the paragraph type when we are inside a blockQuote
301
+ // to avoid inserting an extra taskList whilst keeping the paragraph
288
302
  nodeTypesToReplace.push(paragraph);
289
303
  }
290
304
 
@@ -9,11 +9,14 @@ exports.textFormattingStyles = void 0;
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
 
12
- var _styledComponents = require("styled-components");
12
+ var _react = require("@emotion/react");
13
13
 
14
14
  var _styles = require("@atlaskit/editor-common/styles");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var textFormattingStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), _styles.codeMarkSharedStyles);
18
+ var textFormattingStyles = function textFormattingStyles(props) {
19
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), (0, _styles.codeMarkSharedStyles)(props));
20
+ };
21
+
19
22
  exports.textFormattingStyles = textFormattingStyles;
@@ -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