@atlaskit/editor-core 161.0.0 → 162.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/cjs/actions/index.js +76 -48
  3. package/dist/cjs/extensibility.js +2 -2
  4. package/dist/cjs/labs/next/full-page.js +1 -1
  5. package/dist/cjs/plugins/block-type/styles.js +5 -2
  6. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
  7. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
  8. package/dist/cjs/plugins/card/messages.js +4 -4
  9. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
  10. package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
  11. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
  12. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
  13. package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
  14. package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
  15. package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
  16. package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
  17. package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
  18. package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
  19. package/dist/cjs/plugins/card/ui/styled.js +5 -13
  20. package/dist/cjs/plugins/card/ui/types.js +5 -0
  21. package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
  22. package/dist/cjs/plugins/code-block/styles.js +45 -38
  23. package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
  24. package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
  25. package/dist/cjs/plugins/extension/utils.js +57 -12
  26. package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
  27. package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
  28. package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
  29. package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
  30. package/dist/cjs/plugins/layout/styles.js +2 -2
  31. package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
  32. package/dist/cjs/plugins/list/commands/index.js +35 -38
  33. package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
  34. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  35. package/dist/cjs/plugins/media/styles.js +2 -2
  36. package/dist/cjs/plugins/media/utils/media-single.js +15 -2
  37. package/dist/cjs/plugins/paste/handlers.js +19 -5
  38. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
  39. package/dist/cjs/plugins/placeholder-text/index.js +45 -1
  40. package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
  41. package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
  42. package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
  43. package/dist/cjs/plugins/table/commands/index.js +0 -6
  44. package/dist/cjs/plugins/table/commands/insert.js +1 -1
  45. package/dist/cjs/plugins/table/commands/misc.js +5 -18
  46. package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
  47. package/dist/cjs/plugins/table/handlers.js +6 -2
  48. package/dist/cjs/plugins/table/index.js +7 -13
  49. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
  50. package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
  51. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
  52. package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
  53. package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
  54. package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
  55. package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  56. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
  57. package/dist/cjs/plugins/table/reducer.js +0 -7
  58. package/dist/cjs/plugins/table/toolbar.js +5 -15
  59. package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
  60. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +3 -1
  61. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  62. package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
  63. package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
  64. package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
  65. package/dist/cjs/plugins/table/utils/nodes.js +15 -15
  66. package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
  67. package/dist/cjs/plugins/text-formatting/styles.js +5 -2
  68. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
  69. package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  70. package/dist/cjs/plugins/text-formatting/utils.js +30 -2
  71. package/dist/cjs/plugins/type-ahead/api.js +32 -1
  72. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
  73. package/dist/cjs/plugins/type-ahead/utils.js +22 -4
  74. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  75. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
  76. package/dist/cjs/ui/ContentStyles/index.js +32 -9
  77. package/dist/cjs/utils/index.js +1 -8
  78. package/dist/cjs/utils/insert.js +1 -9
  79. package/dist/cjs/utils/selection.js +2 -9
  80. package/dist/cjs/version-wrapper.js +1 -1
  81. package/dist/cjs/version.json +1 -1
  82. package/dist/es2019/actions/index.js +20 -23
  83. package/dist/es2019/extensibility.js +1 -1
  84. package/dist/es2019/labs/next/full-page.js +2 -2
  85. package/dist/es2019/plugins/block-type/styles.js +3 -3
  86. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
  87. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
  88. package/dist/es2019/plugins/card/messages.js +4 -4
  89. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
  90. package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
  91. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
  92. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
  93. package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
  94. package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
  95. package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
  96. package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
  97. package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  98. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  99. package/dist/es2019/plugins/card/ui/styled.js +2 -2
  100. package/dist/es2019/plugins/card/ui/types.js +1 -0
  101. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
  102. package/dist/es2019/plugins/code-block/styles.js +14 -14
  103. package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
  104. package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
  105. package/dist/es2019/plugins/extension/utils.js +37 -2
  106. package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
  107. package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
  108. package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
  109. package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
  110. package/dist/es2019/plugins/layout/styles.js +5 -1
  111. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
  112. package/dist/es2019/plugins/list/commands/index.js +29 -28
  113. package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
  114. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  115. package/dist/es2019/plugins/media/styles.js +1 -1
  116. package/dist/es2019/plugins/media/utils/media-single.js +14 -1
  117. package/dist/es2019/plugins/paste/handlers.js +19 -5
  118. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  119. package/dist/es2019/plugins/placeholder-text/index.js +46 -1
  120. package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
  121. package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
  122. package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
  123. package/dist/es2019/plugins/table/commands/index.js +1 -1
  124. package/dist/es2019/plugins/table/commands/insert.js +1 -1
  125. package/dist/es2019/plugins/table/commands/misc.js +5 -11
  126. package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
  127. package/dist/es2019/plugins/table/handlers.js +6 -2
  128. package/dist/es2019/plugins/table/index.js +4 -8
  129. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
  130. package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
  131. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  132. package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
  133. package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
  134. package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
  135. package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  136. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  137. package/dist/es2019/plugins/table/reducer.js +0 -9
  138. package/dist/es2019/plugins/table/toolbar.js +1 -4
  139. package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
  140. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
  141. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  142. package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
  143. package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
  144. package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
  145. package/dist/es2019/plugins/table/utils/nodes.js +11 -11
  146. package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
  147. package/dist/es2019/plugins/text-formatting/styles.js +3 -3
  148. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
  149. package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  150. package/dist/es2019/plugins/text-formatting/utils.js +13 -1
  151. package/dist/es2019/plugins/type-ahead/api.js +31 -2
  152. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
  153. package/dist/es2019/plugins/type-ahead/utils.js +15 -0
  154. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  155. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
  156. package/dist/es2019/ui/ContentStyles/index.js +45 -23
  157. package/dist/es2019/utils/index.js +1 -1
  158. package/dist/es2019/utils/insert.js +2 -10
  159. package/dist/es2019/utils/selection.js +1 -6
  160. package/dist/es2019/version-wrapper.js +1 -1
  161. package/dist/es2019/version.json +1 -1
  162. package/dist/esm/actions/index.js +76 -48
  163. package/dist/esm/extensibility.js +1 -1
  164. package/dist/esm/labs/next/full-page.js +2 -2
  165. package/dist/esm/plugins/block-type/styles.js +4 -2
  166. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
  167. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
  168. package/dist/esm/plugins/card/messages.js +4 -4
  169. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
  170. package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
  171. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
  172. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
  173. package/dist/esm/plugins/card/ui/assets/card.js +1 -1
  174. package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
  175. package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
  176. package/dist/esm/plugins/card/ui/assets/url.js +1 -1
  177. package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
  178. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
  179. package/dist/esm/plugins/card/ui/styled.js +2 -2
  180. package/dist/esm/plugins/card/ui/types.js +1 -0
  181. package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
  182. package/dist/esm/plugins/code-block/styles.js +42 -38
  183. package/dist/esm/plugins/extension/plugin-factory.js +3 -1
  184. package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
  185. package/dist/esm/plugins/extension/utils.js +51 -9
  186. package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
  187. package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
  188. package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
  189. package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
  190. package/dist/esm/plugins/layout/styles.js +2 -2
  191. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
  192. package/dist/esm/plugins/list/commands/index.js +33 -34
  193. package/dist/esm/plugins/list/utils/replace-content.js +21 -0
  194. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  195. package/dist/esm/plugins/media/styles.js +1 -1
  196. package/dist/esm/plugins/media/utils/media-single.js +12 -1
  197. package/dist/esm/plugins/paste/handlers.js +19 -5
  198. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  199. package/dist/esm/plugins/placeholder-text/index.js +44 -1
  200. package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
  201. package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
  202. package/dist/esm/plugins/placeholder-text/styles.js +2 -1
  203. package/dist/esm/plugins/table/commands/index.js +1 -1
  204. package/dist/esm/plugins/table/commands/insert.js +1 -1
  205. package/dist/esm/plugins/table/commands/misc.js +5 -15
  206. package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
  207. package/dist/esm/plugins/table/handlers.js +6 -2
  208. package/dist/esm/plugins/table/index.js +6 -11
  209. package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
  210. package/dist/esm/plugins/table/nodeviews/table.js +6 -37
  211. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
  212. package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
  213. package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
  214. package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
  215. package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
  216. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
  217. package/dist/esm/plugins/table/reducer.js +0 -7
  218. package/dist/esm/plugins/table/toolbar.js +1 -10
  219. package/dist/esm/plugins/table/transforms/metadata.js +1 -1
  220. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
  221. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
  222. package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
  223. package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
  224. package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
  225. package/dist/esm/plugins/table/utils/nodes.js +14 -14
  226. package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
  227. package/dist/esm/plugins/text-formatting/styles.js +4 -2
  228. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
  229. package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
  230. package/dist/esm/plugins/text-formatting/utils.js +18 -0
  231. package/dist/esm/plugins/type-ahead/api.js +30 -2
  232. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
  233. package/dist/esm/plugins/type-ahead/utils.js +17 -3
  234. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  235. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
  236. package/dist/esm/ui/ContentStyles/index.js +27 -9
  237. package/dist/esm/utils/index.js +1 -1
  238. package/dist/esm/utils/insert.js +2 -10
  239. package/dist/esm/utils/selection.js +1 -6
  240. package/dist/esm/version-wrapper.js +1 -1
  241. package/dist/esm/version.json +1 -1
  242. package/dist/types/actions/index.d.ts +2 -2
  243. package/dist/types/extensibility.d.ts +1 -1
  244. package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
  245. package/dist/types/plugins/block-type/styles.d.ts +2 -1
  246. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
  247. package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
  248. package/dist/types/plugins/card/messages.d.ts +2 -2
  249. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
  250. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
  251. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
  252. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
  253. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
  254. package/dist/types/plugins/card/ui/styled.d.ts +2 -3
  255. package/dist/types/plugins/card/ui/types.d.ts +12 -0
  256. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
  257. package/dist/types/plugins/code-block/styles.d.ts +3 -2
  258. package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
  259. package/dist/types/plugins/extension/types.d.ts +1 -0
  260. package/dist/types/plugins/extension/utils.d.ts +3 -1
  261. package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
  262. package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
  263. package/dist/types/plugins/layout/styles.d.ts +1 -1
  264. package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
  265. package/dist/types/plugins/list/commands/index.d.ts +0 -1
  266. package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
  267. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  268. package/dist/types/plugins/media/styles.d.ts +1 -1
  269. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  270. package/dist/types/plugins/panel/styles.d.ts +1 -1
  271. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  272. package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
  273. package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
  274. package/dist/types/plugins/rule/styles.d.ts +1 -1
  275. package/dist/types/plugins/table/commands/index.d.ts +1 -1
  276. package/dist/types/plugins/table/commands/misc.d.ts +0 -1
  277. package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
  278. package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
  279. package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
  280. package/dist/types/plugins/table/types.d.ts +1 -8
  281. package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
  282. package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
  283. package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
  284. package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
  285. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  286. package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
  287. package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
  288. package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
  289. package/dist/types/plugins/type-ahead/api.d.ts +11 -1
  290. package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
  291. package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
  292. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  293. package/dist/types/utils/index.d.ts +1 -1
  294. package/dist/types/utils/selection.d.ts +0 -1
  295. package/package.json +28 -26
@@ -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)) {
@@ -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.css';
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.css';
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,9 +1,11 @@
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';
@@ -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.0";
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.0",
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;
@@ -1,5 +1,25 @@
1
1
  /// <reference types="react" />
2
- export interface LinkToolbarIconDropdownProps {
2
+ import { jsx } from '@emotion/react';
3
+ import type { GlyphProps } from '@atlaskit/icon/types';
4
+ import { Props as DropdownProps } from '../../floating-toolbar/ui/Dropdown';
5
+ export declare const ICON_HEIGHT = 40;
6
+ export declare const ICON_WIDTH = 40;
7
+ interface IconSizeProps {
8
+ width?: number;
9
+ height?: number;
3
10
  }
4
- declare const LinkToolbarIconDropdown: ({}: LinkToolbarIconDropdownProps) => JSX.Element;
5
- export default LinkToolbarIconDropdown;
11
+ export interface IconDropdownOptionProps {
12
+ title: string;
13
+ description: string;
14
+ selected: boolean;
15
+ disabled: boolean;
16
+ onClick: () => void;
17
+ icon: (props: GlyphProps & IconSizeProps) => JSX.Element;
18
+ testId?: string;
19
+ tooltipContent?: string | null;
20
+ }
21
+ export interface LinkToolbarIconDropdownProps extends DropdownProps {
22
+ options: IconDropdownOptionProps[];
23
+ }
24
+ export declare const LinkToolbarIconDropdown: ({ options, ...rest }: LinkToolbarIconDropdownProps) => jsx.JSX.Element;
25
+ export {};
@@ -1,4 +1,6 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  import { RichMediaLayout } from '@atlaskit/adf-schema';
3
5
  import { Props as ResizerProps } from '../../../ui/Resizer/types';
4
6
  declare type State = {
@@ -53,6 +55,6 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
53
55
  * and hence we use `style` prop.
54
56
  */
55
57
  private getHeightDefiningComponent;
56
- render(): JSX.Element;
58
+ render(): jsx.JSX.Element;
57
59
  }
58
60
  export {};
@@ -0,0 +1,5 @@
1
+ import { IntlShape } from 'react-intl-next';
2
+ import { Command } from '../../../types';
3
+ import { OptionConfig } from './types';
4
+ import { ButtonOptionProps } from './LinkToolbarButtonGroup';
5
+ export declare const getButtonGroupOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => ButtonOptionProps;
@@ -0,0 +1,5 @@
1
+ import { IntlShape } from 'react-intl-next';
2
+ import { Command } from '../../../types';
3
+ import { OptionConfig } from './types';
4
+ import { IconDropdownOptionProps } from './LinkToolbarIconDropdown';
5
+ export declare const getIconDropdownOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => IconDropdownOptionProps;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const embedCardStyles: import("styled-components").InterpolationValue[];
3
- export declare const EmbedSpacing: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
1
+ export declare const embedCardStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const embedSpacingStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,12 @@
1
+ import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
2
+ import { Command } from '../../../types';
3
+ export interface OptionConfig {
4
+ appearance?: CardAppearance;
5
+ title: string;
6
+ onClick: Command;
7
+ selected: boolean;
8
+ testId: string;
9
+ disabled?: boolean;
10
+ hidden?: boolean;
11
+ tooltip?: string;
12
+ }
@@ -3,5 +3,14 @@ import { EditorView } from 'prosemirror-view';
3
3
  import { PMPluginFactoryParams } from '../../../types';
4
4
  import { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
5
5
  import { ACTION } from '../../analytics/types/enums';
6
- export declare const createPlugin: ({ dispatchAnalyticsEvent, }: PMPluginFactoryParams) => SafePlugin<any, any>;
6
+ import { DOMSerializer } from 'prosemirror-model';
7
+ import type { Schema } from 'prosemirror-model';
8
+ export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPluginFactoryParams) => SafePlugin<any, any>;
9
+ /**
10
+ * Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
11
+ * This allows us to store the original table’s attributes on the new table that the row is wrapped with when it is being copied.
12
+ * e.g. keeping the layout on a row that is copied.
13
+ * We store the default serializer in order to call it after we handle the table row case.
14
+ */
15
+ export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
7
16
  export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
@@ -1,2 +1,3 @@
1
- export declare const highlightingCodeBlockStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme").AtlaskitThemeProps | import("@atlaskit/theme").CustomThemeProps | import("@atlaskit/theme").NoThemeProps | undefined, any>>[];
2
- export declare const codeBlockStyles: 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 highlightingCodeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
3
+ export declare const codeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -6,6 +6,7 @@ import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider
6
6
  import { EditorAppearance } from '../../../types/editor-appearance';
7
7
  import { Dispatch, EventDispatcher } from '../../../event-dispatcher';
8
8
  import { PortalProviderAPI } from '../../../ui/PortalProvider';
9
+ import type { ExtensionState } from '../types';
9
10
  import { getPluginState, createCommand } from '../plugin-factory';
10
11
  import { pluginKey } from '../plugin-key';
11
12
  export declare const updateEditButton: (view: EditorView, extensionProvider: ExtensionProvider) => Promise<UpdateExtension<any> | undefined>;
@@ -13,5 +14,5 @@ export declare const createExtensionProviderHandler: (view: EditorView) => (name
13
14
  export declare const createContextIdentifierProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ContextIdentifierProvider> | undefined) => Promise<void>;
14
15
  declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, useLongPressSelection?: boolean, options?: {
15
16
  appearance?: EditorAppearance;
16
- }) => SafePlugin<import("../types").ExtensionState<import("@atlaskit/editor-common/extensions").Parameters>, import("prosemirror-model").Schema<any, any>>;
17
+ }) => SafePlugin<ExtensionState<import("@atlaskit/editor-common/extensions").Parameters>, import("prosemirror-model").Schema<any, any>>;
17
18
  export { pluginKey, createPlugin, createCommand, getPluginState };
@@ -3,6 +3,7 @@ import { UpdateExtension, ExtensionProvider, Parameters, TransformBefore, Transf
3
3
  export declare type ExtensionState<T extends Parameters = Parameters> = {
4
4
  localId?: string;
5
5
  autoSaveResolve?: () => void;
6
+ shouldRefreshEditButton: boolean;
6
7
  showEditButton: boolean;
7
8
  showContextPanel: boolean;
8
9
  updateExtension?: Promise<UpdateExtension<T> | void>;
@@ -1,10 +1,12 @@
1
1
  import { Schema, Mark } from 'prosemirror-model';
2
- import { EditorState } from 'prosemirror-state';
2
+ import { EditorState, ReadonlyTransaction } from 'prosemirror-state';
3
3
  import { Node as PMNode } from 'prosemirror-model';
4
4
  import { NodeWithPos, DomAtPos } from 'prosemirror-utils';
5
+ import type { ExtensionState } from './types';
5
6
  export declare const getSelectedExtension: (state: EditorState, searchParent?: boolean) => import("prosemirror-utils").ContentNodeWithPos | undefined;
6
7
  export declare const findExtensionWithLocalId: (state: EditorState, localId?: string | undefined) => NodeWithPos | undefined;
7
8
  export declare const getSelectedDomElement: (schema: Schema, domAtPos: DomAtPos, selectedExtensionNode: NodeWithPos) => HTMLElement;
8
9
  export declare const getDataConsumerMark: (newNode: PMNode) => Mark | undefined;
9
10
  export declare const getNodeTypesReferenced: (ids: string[], state: EditorState) => string[];
10
11
  export declare const findNodePosWithLocalId: (state: EditorState, localId: string) => NodeWithPos | undefined;
12
+ export declare const onSelectionChanged: (tr: ReadonlyTransaction, state: ExtensionState) => ExtensionState;
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  import { TRIGGER_METHOD, DispatchAnalyticsEvent } from '../../analytics/types';
4
5
  import { MatchCaseProps } from '../types';
5
6
  export declare type FindReplaceProps = {
@@ -37,6 +38,6 @@ declare class FindReplace extends React.PureComponent<FindReplaceProps> {
37
38
  setReplaceTextfieldRef: (replaceTextfieldRef: React.RefObject<HTMLInputElement>) => void;
38
39
  setFocusToFind: () => void;
39
40
  setFocusToReplace: () => void;
40
- render(): JSX.Element;
41
+ render(): jsx.JSX.Element;
41
42
  }
42
43
  export default FindReplace;
@@ -1,5 +1,5 @@
1
- export declare const replaceSectionButtonStyles: import("@emotion/core").SerializedStyles;
2
- export declare const ruleStyles: import("@emotion/core").SerializedStyles;
3
- export declare const wrapperStyles: import("@emotion/core").SerializedStyles;
4
- export declare const sectionWrapperStyles: import("@emotion/core").SerializedStyles;
5
- export declare const countStyles: import("@emotion/core").SerializedStyles;
1
+ export declare const replaceSectionButtonStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const ruleStyles: import("@emotion/react").SerializedStyles;
3
+ export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
4
+ export declare const sectionWrapperStyles: import("@emotion/react").SerializedStyles;
5
+ export declare const countStyles: import("@emotion/react").SerializedStyles;
@@ -1,3 +1,3 @@
1
1
  export declare const LAYOUT_SECTION_MARGIN: number;
2
2
  export declare const LAYOUT_COLUMN_PADDING: number;
3
- export declare const layoutStyles: import("styled-components").InterpolationValue[];
3
+ export declare const layoutStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,25 @@
1
+ import { Node, NodeType } from 'prosemirror-model';
2
+ import { Transaction } from 'prosemirror-state';
3
+ /**
4
+ * Wraps the selection in a list with the given type. If this results in
5
+ * two adjacent lists of the same type, those will be joined together.
6
+ */
7
+ export declare function wrapInListAndJoin(nodeType: NodeType, tr: Transaction): void;
8
+ /**
9
+ * Wraps the selection in a list with the given type and attributes.
10
+ *
11
+ * Adapted from https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js#L64-L89
12
+ */
13
+ export declare function wrapInList(listType: NodeType, attrs?: {
14
+ [key: string]: any;
15
+ }): (tr: Transaction) => boolean;
16
+ /**
17
+ * Checks whether two adjacent nodes can be joined. If so, the document
18
+ * will be updated to join those nodes. If not, the original transaction
19
+ * remains untouched.
20
+ *
21
+ * Nodes are considered joinable if the `isJoinable` predicate returns true.
22
+ *
23
+ * Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
24
+ */
25
+ export declare function autoJoin(tr: Transaction, isJoinable: (before: Node, after: Node) => boolean): void;
@@ -13,4 +13,3 @@ export declare const rootListDepth: (pos: ResolvedPos, nodes: Record<string, Nod
13
13
  export declare function toggleList(inputMethod: InputMethod, listType: 'bulletList' | 'orderedList'): Command;
14
14
  export declare function toggleBulletList(view: EditorView, inputMethod?: InputMethod): boolean;
15
15
  export declare function toggleOrderedList(view: EditorView, inputMethod?: InputMethod): boolean;
16
- export declare function wrapInList(nodeType: NodeType): Command;
@@ -0,0 +1,8 @@
1
+ import { ResolvedPos } from 'prosemirror-model';
2
+ import { Step } from 'prosemirror-transform';
3
+ declare type Params = {
4
+ insertPosition: number;
5
+ $target: ResolvedPos;
6
+ };
7
+ export declare const moveTargetIntoList: ({ insertPosition, $target, }: Params) => Step;
8
+ export {};