@atlaskit/editor-core 180.1.0 → 181.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 (404) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cjs/actions/index.js +25 -10
  3. package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
  4. package/dist/cjs/create-editor/ReactEditorView.js +0 -5
  5. package/dist/cjs/create-editor/ReactEditorViewInternal.js +73 -103
  6. package/dist/cjs/create-editor/create-plugins-list.js +30 -3
  7. package/dist/cjs/create-editor/preset-utils.js +27 -0
  8. package/dist/cjs/editor-next/editor-internal.js +2 -2
  9. package/dist/cjs/editor-next/editor-migration-component.js +18 -2
  10. package/dist/cjs/editor-next/hooks/useProviderFactory.js +4 -3
  11. package/dist/cjs/editor-next/index.js +13 -9
  12. package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
  13. package/dist/cjs/editor-next/utils/handleProviders.js +17 -22
  14. package/dist/cjs/editor.js +20 -13
  15. package/dist/cjs/keymaps/consts.js +1 -16
  16. package/dist/cjs/labs/next/presets/cxhtml.js +56 -55
  17. package/dist/cjs/labs/next/presets/default.js +15 -42
  18. package/dist/cjs/labs/next/presets/mobile.js +76 -89
  19. package/dist/cjs/labs/next/presets/universal.js +330 -257
  20. package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
  21. package/dist/cjs/plugins/analytics/plugin.js +6 -0
  22. package/dist/cjs/plugins/annotation/utils.js +2 -36
  23. package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
  24. package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
  25. package/dist/cjs/plugins/caption/index.js +0 -7
  26. package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -4
  27. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
  28. package/dist/cjs/plugins/card/pm-plugins/main.js +6 -3
  29. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
  30. package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
  31. package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
  32. package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
  33. package/dist/cjs/plugins/context-panel/index.js +1 -6
  34. package/dist/cjs/plugins/data-consumer/index.js +0 -8
  35. package/dist/cjs/plugins/date/utils/internal.js +0 -4
  36. package/dist/cjs/plugins/extension/commands.js +1 -8
  37. package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
  38. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
  39. package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
  40. package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
  41. package/dist/cjs/plugins/floating-toolbar/ui/Button.js +7 -3
  42. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  43. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
  44. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  45. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +24 -8
  46. package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
  47. package/dist/cjs/plugins/fragment/index.js +0 -8
  48. package/dist/cjs/plugins/help-dialog/commands.js +2 -6
  49. package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
  50. package/dist/cjs/plugins/layout/styles.js +10 -1
  51. package/dist/cjs/plugins/list/utils/find.js +0 -28
  52. package/dist/cjs/plugins/list/utils/indentation.js +1 -25
  53. package/dist/cjs/plugins/list/utils/node.js +0 -5
  54. package/dist/cjs/plugins/list/utils/selection.js +2 -15
  55. package/dist/cjs/plugins/media/utils/media-common.js +1 -20
  56. package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
  57. package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
  58. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
  59. package/dist/cjs/plugins/mobile-dimensions/index.js +1 -4
  60. package/dist/cjs/plugins/paste/index.js +1 -2
  61. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +123 -87
  62. package/dist/cjs/plugins/paste/util/index.js +0 -46
  63. package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
  64. package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
  65. package/dist/cjs/plugins/status/utils.js +1 -15
  66. package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
  67. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  68. package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  69. package/dist/cjs/plugins/text-formatting/utils.js +1 -26
  70. package/dist/cjs/plugins/type-ahead/constants.js +1 -7
  71. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -35
  72. package/dist/cjs/plugins/type-ahead/utils.js +3 -22
  73. package/dist/cjs/test-utils.js +4 -12
  74. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
  75. package/dist/cjs/ui/ColorPalette/index.js +18 -0
  76. package/dist/cjs/ui/ColorPickerButton/index.js +6 -2
  77. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
  78. package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
  79. package/dist/cjs/ui/ContentStyles/index.js +1 -1
  80. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  81. package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
  82. package/dist/cjs/ui/Resizer/utils.js +1 -3
  83. package/dist/cjs/ui/styles.js +3 -7
  84. package/dist/cjs/utils/get-editor-plugins.js +1 -3
  85. package/dist/cjs/utils/index.js +9 -269
  86. package/dist/cjs/utils/input-rules.js +1 -15
  87. package/dist/cjs/version-wrapper.js +1 -1
  88. package/dist/cjs/version.json +1 -1
  89. package/dist/es2019/actions/index.js +23 -9
  90. package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
  91. package/dist/es2019/create-editor/ReactEditorView.js +0 -5
  92. package/dist/es2019/create-editor/ReactEditorViewInternal.js +67 -82
  93. package/dist/es2019/create-editor/create-plugins-list.js +25 -3
  94. package/dist/es2019/create-editor/preset-utils.js +15 -0
  95. package/dist/es2019/editor-next/editor-internal.js +2 -2
  96. package/dist/es2019/editor-next/editor-migration-component.js +19 -2
  97. package/dist/es2019/editor-next/hooks/useProviderFactory.js +4 -3
  98. package/dist/es2019/editor-next/index.js +13 -7
  99. package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
  100. package/dist/es2019/editor-next/utils/handleProviders.js +18 -24
  101. package/dist/es2019/editor.js +20 -11
  102. package/dist/es2019/keymaps/consts.js +7 -11
  103. package/dist/es2019/labs/next/presets/cxhtml.js +56 -53
  104. package/dist/es2019/labs/next/presets/default.js +18 -38
  105. package/dist/es2019/labs/next/presets/mobile.js +88 -88
  106. package/dist/es2019/labs/next/presets/universal.js +338 -265
  107. package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
  108. package/dist/es2019/plugins/analytics/plugin.js +7 -0
  109. package/dist/es2019/plugins/annotation/utils.js +2 -30
  110. package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
  111. package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
  112. package/dist/es2019/plugins/caption/index.js +0 -2
  113. package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -4
  114. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
  115. package/dist/es2019/plugins/card/pm-plugins/main.js +6 -3
  116. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
  117. package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
  118. package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
  119. package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
  120. package/dist/es2019/plugins/context-panel/index.js +0 -3
  121. package/dist/es2019/plugins/data-consumer/index.js +0 -7
  122. package/dist/es2019/plugins/date/utils/internal.js +0 -3
  123. package/dist/es2019/plugins/extension/commands.js +0 -6
  124. package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
  125. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
  126. package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
  127. package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
  128. package/dist/es2019/plugins/floating-toolbar/ui/Button.js +7 -3
  129. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  130. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
  131. package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  132. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +21 -4
  133. package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
  134. package/dist/es2019/plugins/fragment/index.js +0 -7
  135. package/dist/es2019/plugins/help-dialog/commands.js +1 -2
  136. package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
  137. package/dist/es2019/plugins/layout/styles.js +12 -4
  138. package/dist/es2019/plugins/list/utils/find.js +0 -27
  139. package/dist/es2019/plugins/list/utils/indentation.js +0 -23
  140. package/dist/es2019/plugins/list/utils/node.js +1 -4
  141. package/dist/es2019/plugins/list/utils/selection.js +2 -15
  142. package/dist/es2019/plugins/media/utils/media-common.js +1 -19
  143. package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
  144. package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
  145. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
  146. package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
  147. package/dist/es2019/plugins/paste/index.js +1 -2
  148. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +126 -94
  149. package/dist/es2019/plugins/paste/util/index.js +5 -45
  150. package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
  151. package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
  152. package/dist/es2019/plugins/status/utils.js +1 -11
  153. package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
  154. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  155. package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  156. package/dist/es2019/plugins/text-formatting/utils.js +0 -19
  157. package/dist/es2019/plugins/type-ahead/constants.js +0 -5
  158. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -35
  159. package/dist/es2019/plugins/type-ahead/utils.js +0 -23
  160. package/dist/es2019/test-utils.js +4 -7
  161. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
  162. package/dist/es2019/ui/ColorPalette/index.js +2 -1
  163. package/dist/es2019/ui/ColorPickerButton/index.js +6 -2
  164. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
  165. package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
  166. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  167. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  168. package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
  169. package/dist/es2019/ui/Resizer/utils.js +0 -1
  170. package/dist/es2019/ui/styles.js +0 -6
  171. package/dist/es2019/utils/get-editor-plugins.js +1 -3
  172. package/dist/es2019/utils/index.js +13 -199
  173. package/dist/es2019/utils/input-rules.js +0 -14
  174. package/dist/es2019/version-wrapper.js +1 -1
  175. package/dist/es2019/version.json +1 -1
  176. package/dist/esm/actions/index.js +23 -9
  177. package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
  178. package/dist/esm/create-editor/ReactEditorView.js +0 -5
  179. package/dist/esm/create-editor/ReactEditorViewInternal.js +73 -102
  180. package/dist/esm/create-editor/create-plugins-list.js +29 -3
  181. package/dist/esm/create-editor/preset-utils.js +21 -0
  182. package/dist/esm/editor-next/editor-internal.js +2 -2
  183. package/dist/esm/editor-next/editor-migration-component.js +18 -2
  184. package/dist/esm/editor-next/hooks/useProviderFactory.js +4 -3
  185. package/dist/esm/editor-next/index.js +13 -9
  186. package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
  187. package/dist/esm/editor-next/utils/handleProviders.js +17 -22
  188. package/dist/esm/editor.js +20 -13
  189. package/dist/esm/keymaps/consts.js +7 -11
  190. package/dist/esm/labs/next/presets/cxhtml.js +56 -55
  191. package/dist/esm/labs/next/presets/default.js +18 -41
  192. package/dist/esm/labs/next/presets/mobile.js +88 -90
  193. package/dist/esm/labs/next/presets/universal.js +330 -257
  194. package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
  195. package/dist/esm/plugins/analytics/plugin.js +6 -0
  196. package/dist/esm/plugins/annotation/utils.js +2 -32
  197. package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
  198. package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
  199. package/dist/esm/plugins/caption/index.js +0 -2
  200. package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -4
  201. package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
  202. package/dist/esm/plugins/card/pm-plugins/main.js +6 -3
  203. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
  204. package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
  205. package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
  206. package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
  207. package/dist/esm/plugins/context-panel/index.js +0 -3
  208. package/dist/esm/plugins/data-consumer/index.js +0 -7
  209. package/dist/esm/plugins/date/utils/internal.js +0 -3
  210. package/dist/esm/plugins/extension/commands.js +0 -6
  211. package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
  212. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
  213. package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
  214. package/dist/esm/plugins/feedback-dialog/index.js +0 -2
  215. package/dist/esm/plugins/floating-toolbar/ui/Button.js +7 -3
  216. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  217. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
  218. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  219. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +24 -8
  220. package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
  221. package/dist/esm/plugins/fragment/index.js +0 -7
  222. package/dist/esm/plugins/help-dialog/commands.js +0 -3
  223. package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
  224. package/dist/esm/plugins/layout/styles.js +11 -2
  225. package/dist/esm/plugins/list/utils/find.js +0 -27
  226. package/dist/esm/plugins/list/utils/indentation.js +0 -23
  227. package/dist/esm/plugins/list/utils/node.js +1 -4
  228. package/dist/esm/plugins/list/utils/selection.js +2 -12
  229. package/dist/esm/plugins/media/utils/media-common.js +1 -17
  230. package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
  231. package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
  232. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
  233. package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
  234. package/dist/esm/plugins/paste/index.js +1 -2
  235. package/dist/esm/plugins/paste/pm-plugins/analytics.js +122 -86
  236. package/dist/esm/plugins/paste/util/index.js +5 -45
  237. package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
  238. package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
  239. package/dist/esm/plugins/status/utils.js +1 -13
  240. package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
  241. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  242. package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  243. package/dist/esm/plugins/text-formatting/utils.js +0 -21
  244. package/dist/esm/plugins/type-ahead/constants.js +0 -5
  245. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -31
  246. package/dist/esm/plugins/type-ahead/utils.js +2 -20
  247. package/dist/esm/test-utils.js +4 -7
  248. package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
  249. package/dist/esm/ui/ColorPalette/index.js +2 -1
  250. package/dist/esm/ui/ColorPickerButton/index.js +6 -2
  251. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
  252. package/dist/esm/ui/ConfigPanel/utils.js +3 -14
  253. package/dist/esm/ui/ContentStyles/index.js +1 -1
  254. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  255. package/dist/esm/ui/ElementBrowser/constants.js +0 -1
  256. package/dist/esm/ui/Resizer/utils.js +0 -1
  257. package/dist/esm/ui/styles.js +2 -5
  258. package/dist/esm/utils/get-editor-plugins.js +1 -3
  259. package/dist/esm/utils/index.js +13 -196
  260. package/dist/esm/utils/input-rules.js +0 -13
  261. package/dist/esm/version-wrapper.js +1 -1
  262. package/dist/esm/version.json +1 -1
  263. package/dist/types/actions/index.d.ts +4 -4
  264. package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
  265. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +9 -7
  266. package/dist/types/create-editor/ReactEditorViewNext.d.ts +3 -4
  267. package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
  268. package/dist/types/create-editor/preset-utils.d.ts +2 -0
  269. package/dist/types/editor-next/editor-internal.d.ts +9 -9
  270. package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +2 -2
  271. package/dist/types/editor-next/hooks/useProviderFactory.d.ts +2 -2
  272. package/dist/types/editor-next/index.d.ts +6 -6
  273. package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -2
  274. package/dist/types/editor-next/utils/editorPropTypes.d.ts +1 -1
  275. package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
  276. package/dist/types/editor-next/utils/handleProviders.d.ts +2 -2
  277. package/dist/types/editor-next/utils/onEditorCreated.d.ts +2 -2
  278. package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
  279. package/dist/types/editor.d.ts +7 -4
  280. package/dist/types/keymaps/consts.d.ts +0 -11
  281. package/dist/types/labs/next/presets/cxhtml.d.ts +33 -1
  282. package/dist/types/labs/next/presets/default.d.ts +67 -10
  283. package/dist/types/labs/next/presets/mobile.d.ts +33 -1
  284. package/dist/types/labs/next/presets/universal.d.ts +5 -13
  285. package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
  286. package/dist/types/nodeviews/context-adapter.d.ts +0 -1
  287. package/dist/types/nodeviews/index.d.ts +0 -1
  288. package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
  289. package/dist/types/plugins/annotation/utils.d.ts +0 -17
  290. package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
  291. package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
  292. package/dist/types/plugins/caption/index.d.ts +0 -2
  293. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
  294. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -0
  295. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  296. package/dist/types/plugins/code-block/actions.d.ts +0 -4
  297. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
  298. package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
  299. package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
  300. package/dist/types/plugins/context-panel/index.d.ts +2 -3
  301. package/dist/types/plugins/data-consumer/index.d.ts +0 -2
  302. package/dist/types/plugins/date/utils/internal.d.ts +0 -1
  303. package/dist/types/plugins/extension/commands.d.ts +0 -1
  304. package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
  305. package/dist/types/plugins/feedback-dialog/index.d.ts +0 -2
  306. package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +3 -1
  307. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
  308. package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
  309. package/dist/types/plugins/fragment/index.d.ts +0 -2
  310. package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
  311. package/dist/types/plugins/history/actions.d.ts +1 -2
  312. package/dist/types/plugins/layout/styles.d.ts +2 -1
  313. package/dist/types/plugins/list/utils/find.d.ts +0 -1
  314. package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
  315. package/dist/types/plugins/list/utils/node.d.ts +0 -2
  316. package/dist/types/plugins/list/utils/selection.d.ts +0 -3
  317. package/dist/types/plugins/media/utils/media-common.d.ts +0 -5
  318. package/dist/types/plugins/mentions/types.d.ts +1 -2
  319. package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
  320. package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
  321. package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
  322. package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -1
  323. package/dist/types/plugins/paste/index.d.ts +0 -1
  324. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -3
  325. package/dist/types/plugins/paste/util/index.d.ts +0 -6
  326. package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
  327. package/dist/types/plugins/status/utils.d.ts +0 -3
  328. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
  329. package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
  330. package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
  331. package/dist/types/plugins/text-formatting/utils.d.ts +0 -4
  332. package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
  333. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +0 -10
  334. package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
  335. package/dist/types/test-utils.d.ts +4 -5
  336. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  337. package/dist/types/types/editor-props.d.ts +55 -42
  338. package/dist/types/ui/Appearance/Chromeless.d.ts +0 -5
  339. package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
  340. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
  341. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
  342. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
  343. package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
  344. package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
  345. package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
  346. package/dist/types/ui/ColorPalette/index.d.ts +2 -1
  347. package/dist/types/ui/ColorPickerButton/index.d.ts +4 -2
  348. package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
  349. package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
  350. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  351. package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
  352. package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
  353. package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
  354. package/dist/types/ui/Resizer/utils.d.ts +0 -1
  355. package/dist/types/ui/styles.d.ts +0 -1
  356. package/dist/types/utils/index.d.ts +6 -65
  357. package/dist/types/utils/input-rules.d.ts +1 -2
  358. package/dist/types/utils/table.d.ts +0 -1
  359. package/package.json +23 -24
  360. package/report.api.md +155 -146
  361. package/dist/cjs/labs/next/presets/preset.js +0 -101
  362. package/dist/cjs/plugins/analytics/types/type-ahead.js +0 -5
  363. package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
  364. package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
  365. package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
  366. package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
  367. package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
  368. package/dist/cjs/profiler/render-count.js +0 -60
  369. package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
  370. package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
  371. package/dist/cjs/ui/WithPluginState/types.js +0 -5
  372. package/dist/es2019/labs/next/presets/preset.js +0 -68
  373. package/dist/es2019/plugins/analytics/types/type-ahead.js +0 -1
  374. package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
  375. package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
  376. package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
  377. package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
  378. package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
  379. package/dist/es2019/profiler/render-count.js +0 -53
  380. package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
  381. package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
  382. package/dist/es2019/ui/WithPluginState/types.js +0 -1
  383. package/dist/esm/labs/next/presets/preset.js +0 -93
  384. package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
  385. package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
  386. package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
  387. package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
  388. package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
  389. package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
  390. package/dist/esm/profiler/render-count.js +0 -49
  391. package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
  392. package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
  393. package/dist/esm/ui/WithPluginState/types.js +0 -1
  394. package/dist/types/labs/next/presets/preset.d.ts +0 -46
  395. package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
  396. package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
  397. package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
  398. package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
  399. package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
  400. package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
  401. package/dist/types/profiler/render-count.d.ts +0 -14
  402. package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
  403. package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
  404. package/dist/types/ui/WithPluginState/types.d.ts +0 -10
@@ -2,11 +2,6 @@ export var TYPE_AHEAD_DECORATION_KEY = 'typeahead_decoration_key';
2
2
  export var TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = 'typeaheadDecoration';
3
3
  export var TYPE_AHEAD_POPUP_CONTENT_CLASS = 'fabric-editor-typeahead';
4
4
  export var TYPE_AHEAD_DECORATION_ELEMENT_ID = 'typeahaed_decoration_element_id';
5
- export var NavigationDirection;
6
- (function (NavigationDirection) {
7
- NavigationDirection[NavigationDirection["LEFT"] = -1] = "LEFT";
8
- NavigationDirection[NavigationDirection["RIGHT"] = 1] = "RIGHT";
9
- })(NavigationDirection || (NavigationDirection = {}));
10
5
  export var CloseSelectionOptions;
11
6
  (function (CloseSelectionOptions) {
12
7
  CloseSelectionOptions["BEFORE_TEXT_INSERTED"] = "BEFORE_TEXT_INSERTED";
@@ -138,35 +138,4 @@ export var factoryDecorations = function factoryDecorations(_ref) {
138
138
  createDecorations: createDecorations,
139
139
  removeDecorations: removeDecorations
140
140
  };
141
- };
142
- export var isSelectionInsideTypeAhead = function isSelectionInsideTypeAhead(_ref4) {
143
- var decorationSet = _ref4.decorationSet,
144
- selection = _ref4.selection;
145
- if (!decorationSet || decorationSet === DecorationSet.empty) {
146
- return false;
147
- }
148
- var typeAheadDecorations = decorationSet.find(undefined, undefined, function (spec) {
149
- return spec.isTypeAheadDecoration;
150
- });
151
- if (!typeAheadDecorations || typeAheadDecorations.length === 0) {
152
- return false;
153
- }
154
- return typeAheadDecorations.some(function (dec) {
155
- return dec.from === selection.from && dec.to === selection.to;
156
- });
157
- };
158
- export var findDecorationElement = function findDecorationElement(_ref5) {
159
- var selection = _ref5.selection,
160
- decorationSet = _ref5.decorationSet;
161
- if (!decorationSet || decorationSet === DecorationSet.empty || !(selection instanceof TextSelection) || !selection.$cursor) {
162
- return null;
163
- }
164
- var pos = selection.$cursor.pos;
165
- var decoration = decorationSet.find(pos, pos, function (spec) {
166
- return spec === null || spec === void 0 ? void 0 : spec.isTypeAheadDecoration;
167
- });
168
- if (!decoration || decoration.length !== 1) {
169
- return null;
170
- }
171
- return document.querySelector("#".concat(decoration[0].spec.key));
172
141
  };
@@ -1,34 +1,16 @@
1
- import { TextSelection } from 'prosemirror-state';
2
- import { DecorationSet } from 'prosemirror-view';
3
1
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
4
2
  import { pluginKey as typeAheadPluginKey } from './pm-plugins/key';
5
3
  import { updateSelectedIndex } from './commands/update-selected-index';
6
4
  import { StatsModifier } from './stats-modifier';
7
5
  import { typeAheadListMessages } from './messages';
8
- export var findTypeAheadDecorations = function findTypeAheadDecorations(state) {
9
- var selection = state.selection;
10
- var _typeAheadPluginKey$g = typeAheadPluginKey.getState(state),
11
- decorationSet = _typeAheadPluginKey$g.decorationSet;
12
- if (!decorationSet || decorationSet === DecorationSet.empty || !(selection instanceof TextSelection) || !selection.$cursor) {
13
- return null;
14
- }
15
- var pos = selection.$cursor.pos;
16
- var decoration = decorationSet.find(pos, pos, function (spec) {
17
- return spec === null || spec === void 0 ? void 0 : spec.isTypeAheadDecoration;
18
- });
19
- if (!decoration || decoration.length !== 1) {
20
- return null;
21
- }
22
- return decoration[0];
23
- };
24
6
  export var isTypeAheadHandler = function isTypeAheadHandler(handler) {
25
7
  return handler && Object.values(TypeAheadAvailableNodes).includes(handler.id) && typeof handler.trigger === 'string' && typeof handler.selectItem === 'function' && typeof handler.getItems === 'function';
26
8
  };
27
9
 
28
10
  /** Is a typeahead plugin open? */
29
11
  export var isTypeAheadOpen = function isTypeAheadOpen(editorState) {
30
- var _typeAheadPluginKey$g2, _typeAheadPluginKey$g3;
31
- return (typeAheadPluginKey === null || typeAheadPluginKey === void 0 ? void 0 : (_typeAheadPluginKey$g2 = typeAheadPluginKey.getState(editorState)) === null || _typeAheadPluginKey$g2 === void 0 ? void 0 : (_typeAheadPluginKey$g3 = _typeAheadPluginKey$g2.decorationSet) === null || _typeAheadPluginKey$g3 === void 0 ? void 0 : _typeAheadPluginKey$g3.find().length) > 0;
12
+ var _typeAheadPluginKey$g, _typeAheadPluginKey$g2;
13
+ return (typeAheadPluginKey === null || typeAheadPluginKey === void 0 ? void 0 : (_typeAheadPluginKey$g = typeAheadPluginKey.getState(editorState)) === null || _typeAheadPluginKey$g === void 0 ? void 0 : (_typeAheadPluginKey$g2 = _typeAheadPluginKey$g.decorationSet) === null || _typeAheadPluginKey$g2 === void 0 ? void 0 : _typeAheadPluginKey$g2.find().length) > 0;
32
14
  };
33
15
  export var getPluginState = function getPluginState(editorState) {
34
16
  return typeAheadPluginKey.getState(editorState);
@@ -4,12 +4,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
5
  import { TextSelection } from 'prosemirror-state';
6
6
  import { sortByOrder } from './create-editor/sort-by-order';
7
- import { Preset } from './labs/next/presets/preset';
8
7
  import { createSchema } from './create-editor/create-schema';
9
8
  import basePlugin from './plugins/base';
10
9
  import { analyticsPluginKey } from './plugins/analytics/plugin-key';
11
10
  export { createTypeAheadTools } from './plugins/type-ahead/api';
12
- export { Preset } from './labs/next/presets/preset';
11
+ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
13
12
  export function getFireAnalytics(editorView) {
14
13
  var _analyticsPluginKey$g;
15
14
  return analyticsPluginKey === null || analyticsPluginKey === void 0 ? void 0 : (_analyticsPluginKey$g = analyticsPluginKey.getState(editorView.state)) === null || _analyticsPluginKey$g === void 0 ? void 0 : _analyticsPluginKey$g.fireAnalytics;
@@ -58,13 +57,11 @@ function lightProcessPluginsList(editorPlugins) {
58
57
  });
59
58
  }
60
59
  export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
61
- var preset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Preset();
60
+ var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new EditorPresetBuilder();
62
61
  return function (pluginFactoryParams) {
63
62
  var editorPlugins = [];
64
- if (!preset.has(basePlugin)) {
65
- preset.add(basePlugin);
66
- }
67
- editorPlugins = preset.getEditorPlugins();
63
+ var preset = inputPreset.has(basePlugin) ? inputPreset : inputPreset.add(basePlugin);
64
+ editorPlugins = preset.build();
68
65
  var editorConfig = lightProcessPluginsList(editorPlugins);
69
66
  var schema = createSchema(editorConfig);
70
67
  var plugins = editorConfig.plugins.sort(sortByOrder('plugins')).map(function (_ref) {
@@ -1,3 +1,4 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
4
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
@@ -15,10 +16,18 @@ var StickyToolbar = function StickyToolbar(props) {
15
16
  _useState2 = _slicedToArray(_useState, 2),
16
17
  top = _useState2[0],
17
18
  setTop = _useState2[1];
19
+
20
+ // ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
21
+ // else if offsetTop is a number set top to offsetTop
22
+ // otherwise top is 0 as initial state
18
23
  useEffect(function () {
19
24
  var _props$externalToolba, _props$externalToolba2;
20
- setTop(((_props$externalToolba = props.externalToolbarRef) === null || _props$externalToolba === void 0 ? void 0 : (_props$externalToolba2 = _props$externalToolba.current) === null || _props$externalToolba2 === void 0 ? void 0 : _props$externalToolba2.clientHeight) || 0);
21
- }, [setTop, props.externalToolbarRef]);
25
+ if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
26
+ setTop(props.externalToolbarRef.current.clientHeight);
27
+ } else {
28
+ setTop(props.offsetTop || 0);
29
+ }
30
+ }, [props.externalToolbarRef, props.offsetTop]);
22
31
  return jsx("div", {
23
32
  css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n "])), top)],
24
33
  "data-testid": "ak-editor-main-toolbar",
@@ -31,13 +40,39 @@ var FixedToolbar = function FixedToolbar(props) {
31
40
  "data-testid": "ak-editor-main-toolbar"
32
41
  }, props.children);
33
42
  };
43
+
44
+ /**
45
+ * ED-15802: Scenarios when a sticky bar is used:
46
+ * 1. useStickyToolbar is true
47
+ * 2. useStickyToolbar is a DOM element
48
+ * 3. useStickyToolbar is an object and has offsetTop key;
49
+ */
50
+ var getStickyParameters = function getStickyParameters(configuration) {
51
+ // const isUsingStickyOffset, isHTMLElement is used so TS can properly infer types.
52
+ var isHTMLElement = _typeof(configuration) === 'object' && !('offsetTop' in configuration);
53
+ var isUsingStickyOffset = _typeof(configuration) === 'object' && 'offsetTop' in configuration;
54
+ if (_typeof(configuration) !== 'object') {
55
+ return {
56
+ externalToolbarRef: undefined,
57
+ offsetTop: undefined
58
+ };
59
+ }
60
+ if (isUsingStickyOffset) {
61
+ return {
62
+ offsetTop: configuration.offsetTop
63
+ };
64
+ }
65
+ if (isHTMLElement) {
66
+ return {
67
+ externalToolbarRef: configuration
68
+ };
69
+ }
70
+ };
34
71
  export var MainToolbar = function MainToolbar(_ref) {
35
72
  var useStickyToolbar = _ref.useStickyToolbar,
36
73
  children = _ref.children;
37
- if (!!useStickyToolbar) {
38
- return jsx(StickyToolbar, {
39
- externalToolbarRef: typeof useStickyToolbar === 'boolean' ? undefined : useStickyToolbar
40
- }, children);
74
+ if (useStickyToolbar) {
75
+ return jsx(StickyToolbar, getStickyParameters(useStickyToolbar), children);
41
76
  }
42
77
  return jsx(FixedToolbar, null, children);
43
78
  };
@@ -1,2 +1,3 @@
1
- import { ColorPalette } from '@atlaskit/editor-common/ui-color';
1
+ import { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
2
+ export { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages };
2
3
  export default ColorPalette;
@@ -137,13 +137,17 @@ var ColorPickerButton = function ColorPickerButton(props) {
137
137
  isOpenedByKeyboard: isOpenedByKeyboard,
138
138
  isPopupPositioned: isPopupPositioned
139
139
  }, jsx(ColorPaletteWithListeners, {
140
- palette: props.colorPalette,
141
140
  cols: props.cols,
142
141
  selectedColor: selectedColor,
143
142
  onClick: onColorSelected,
144
143
  handleClickOutside: togglePopup,
145
144
  handleEscapeKeydown: handleEsc,
146
- hexToPaletteColor: props.hexToPaletteColor
145
+ paletteOptions: {
146
+ palette: props.colorPalette,
147
+ hexToPaletteColor: props.hexToPaletteColor,
148
+ showSomewhatSemanticTooltips: props.showSomewhatSemanticTooltips,
149
+ paletteColorTooltipMessages: props.paletteColorTooltipMessages
150
+ }
147
151
  }))));
148
152
  };
149
153
  var title = props.title || '';
@@ -29,6 +29,7 @@ function Expand(_ref) {
29
29
  expanded = _useState2[0],
30
30
  setExpanded = _useState2[1];
31
31
  return jsx("div", {
32
+ "data-testid": "expand-config-field",
32
33
  css: expandContainer
33
34
  }, jsx("div", {
34
35
  css: expandControl
@@ -1,27 +1,16 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
1
  import { ValidationError } from './types';
4
2
  export var validate = function validate(field, value) {
5
3
  return validateRequired(field, value);
6
4
  };
7
- export var fromEntries = function fromEntries(iterable) {
8
- return _toConsumableArray(iterable).reduce(function (obj, _ref) {
9
- var _ref2 = _slicedToArray(_ref, 2),
10
- key = _ref2[0],
11
- val = _ref2[1];
12
- obj[key] = val;
13
- return obj;
14
- }, {});
15
- };
16
5
  var isEmptyString = function isEmptyString(value) {
17
6
  return typeof value === 'string' && value === '';
18
7
  };
19
8
  var isEmptyArray = function isEmptyArray(value) {
20
9
  return Array.isArray(value) && value.length === 0;
21
10
  };
22
- export var validateRequired = function validateRequired(_ref3, value) {
23
- var isRequired = _ref3.isRequired,
24
- isMultiple = _ref3.isMultiple;
11
+ export var validateRequired = function validateRequired(_ref, value) {
12
+ var isRequired = _ref.isRequired,
13
+ isMultiple = _ref.isMultiple;
25
14
  if (isRequired) {
26
15
  var isUndefined = typeof value === 'undefined';
27
16
  var isEmpty = isEmptyString(value) || isMultiple && isEmptyArray(value) || false;
@@ -38,7 +38,7 @@ import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewPro
38
38
  var contentStyles = function contentStyles(props) {
39
39
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\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 ", ";\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\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 :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\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({
40
40
  theme: props.theme
41
- }), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
41
+ }), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles(props), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
42
42
  };
43
43
  export var createEditorContentStyle = function createEditorContentStyle(styles) {
44
44
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -114,7 +114,7 @@ var Footer = function Footer(_ref) {
114
114
  var HelpLink = function HelpLink(url, helpText) {
115
115
  return jsx(Button, {
116
116
  iconBefore: jsx(QuestionCircleIcon, {
117
- label: "help",
117
+ label: "",
118
118
  size: "medium"
119
119
  }),
120
120
  appearance: "subtle-link",
@@ -14,7 +14,6 @@ export var SIDEBAR_WIDTH = "".concat(GRID_SIZE * 25, "px");
14
14
  export var SIDEBAR_HEADING_WRAPPER_HEIGHT = "".concat(GRID_SIZE * 6, "px");
15
15
  export var SIDEBAR_HEADING_PADDING_LEFT = '12px';
16
16
  export var INLINE_SIDEBAR_HEIGHT = '54px';
17
- export var SEARCH_ITEM_MARGIN = '12px';
18
17
  export var SEARCH_ITEM_HEIGHT_WIDTH = '20px';
19
18
  export var SCROLLBAR_WIDTH = 15;
20
19
  export var ELEMENT_LIST_PADDING = 2;
@@ -6,7 +6,6 @@ export var snapTo = function snapTo(target, points) {
6
6
  });
7
7
  };
8
8
  export var handleSides = ['left', 'right'];
9
- export var alignmentLayouts = ['align-start', 'align-end'];
10
9
  export var imageAlignmentMap = {
11
10
  left: 'start',
12
11
  right: 'end'
@@ -1,5 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
3
3
  import { css } from '@emotion/react';
4
4
  import { N30 } from '@atlaskit/theme/colors';
5
5
  export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
@@ -12,7 +12,4 @@ export var expandIconWrapperStyle = css(_templateObject5 || (_templateObject5 =
12
12
  export var triggerWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n"])));
13
13
  export var buttonContentStyle = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n min-width: 80px;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n flex-direction: column;\n padding: 6px;\n"])));
14
14
  export var buttonContentReducedSpacingStyle = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 8px;\n"])));
15
-
16
- // Taken from the style of inline dialog components
17
- export var dropShadow = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n box-shadow: ", ";\n"])), "var(--ds-shadow-overlay, ".concat("0 0 1px rgba(9, 30, 66, 0.31),\n 0 4px 8px -2px rgba(9, 30, 66, 0.25)", ")"));
18
- export var clickSelectWrapperStyle = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n user-select: all;\n"])));
15
+ export var clickSelectWrapperStyle = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n user-select: all;\n"])));
@@ -1,5 +1,4 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import { createEditorSelectionAPI } from '../selection-api/api';
3
2
  import createPluginsList from '../create-editor/create-plugins-list';
4
3
 
5
4
  /**
@@ -17,9 +16,8 @@ var getEditorPlugins = function getEditorPlugins(_ref) {
17
16
  insertNodeAPI = _ref.insertNodeAPI,
18
17
  editorAnalyticsAPI = _ref.editorAnalyticsAPI;
19
18
  var dangerouslyAppendedPlugins = (_props$dangerouslyApp = (_props$dangerouslyApp2 = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp2 === void 0 ? void 0 : _props$dangerouslyApp2.__plugins) !== null && _props$dangerouslyApp !== void 0 ? _props$dangerouslyApp : [];
20
- var selectionAPI = createEditorSelectionAPI();
21
19
  return [].concat(_toConsumableArray(createPluginsList(props, {
22
20
  appearance: prevAppearance
23
- }, createAnalyticsEvent, insertNodeAPI, editorAnalyticsAPI, selectionAPI)), _toConsumableArray(dangerouslyAppendedPlugins));
21
+ }, createAnalyticsEvent)), _toConsumableArray(dangerouslyAppendedPlugins));
24
22
  };
25
23
  export default getEditorPlugins;
@@ -1,23 +1,17 @@
1
1
  import { toggleMark } from 'prosemirror-commands';
2
- import { Fragment, Slice } from 'prosemirror-model';
3
2
  import { NodeSelection, TextSelection } from 'prosemirror-state';
4
- import { findWrapping, liftTarget } from 'prosemirror-transform';
5
3
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
6
4
  import { FakeTextCursorSelection } from '../plugins/fake-text-cursor/cursor';
7
5
  import { hasParentNodeOfType } from 'prosemirror-utils';
8
6
  import { isNodeEmpty } from './document';
9
7
  import { atTheBeginningOfDoc, atTheEndOfDoc } from './prosemirror/position';
8
+ import { isMediaNode } from '@atlaskit/editor-common/utils';
10
9
  export { insideTable } from '@atlaskit/editor-common/core-utils';
11
10
  export { isEmptyParagraph, hasVisibleContent, isNodeEmpty, isEmptyDocument, processRawValue, getStepRange, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount } from './document';
12
- export { cascadeCommands, getEditorValueWithMedia } from './action';
13
- export { isMarkAllowedInRange, isMarkExcluded, removeBlockMarks, sanitiseSelectionMarksForWrapping, sanitiseMarksInSelection } from './mark';
14
- export { isParagraph, isText, isLinkMark, validateNodes } from './nodes';
15
- export { normaliseNestedLayout, setNodeSelection, setAllSelection, setGapCursorSelection, setCellSelection, setTextSelection, isValidPosition } from './selection';
16
- export { containsClassName } from './dom';
11
+ export { sanitiseMarksInSelection } from './mark';
12
+ export { isParagraph, isText, isLinkMark } from './nodes';
13
+ export { normaliseNestedLayout, setNodeSelection, setGapCursorSelection, setTextSelection } from './selection';
17
14
  export { default as measurements } from './performance/measure-enum';
18
- function validateNode(_node) {
19
- return false;
20
- }
21
15
  function isMarkTypeCompatibleWithMark(markType, mark) {
22
16
  return !mark.type.excludes(markType) && !markType.excludes(mark.type);
23
17
  }
@@ -25,23 +19,12 @@ function isMarkTypeAllowedInNode(markType, state) {
25
19
  return toggleMark(markType)(state);
26
20
  }
27
21
  export function canMoveUp(state) {
28
- var selection = state.selection,
29
- doc = state.doc;
30
-
22
+ var selection = state.selection;
31
23
  /**
32
- * If there's a media element on the selection,
33
- * add text blocks with arrow navigation.
34
- * Also, the selection could be media | mediaGroup.
24
+ * If there's a media element on the selection it will use a gap cursor to move
35
25
  */
36
- if (selection instanceof NodeSelection) {
37
- if (selection.node.type.name === 'media') {
38
- /** Weird way of checking if the previous element is a paragraph */
39
- var mediaAncestorNode = doc.nodeAt(selection.anchor - 3);
40
- return !!(mediaAncestorNode && mediaAncestorNode.type.name === 'paragraph');
41
- } else if (selection.node.type.name === 'mediaGroup') {
42
- var mediaGroupAncestorNode = selection.$anchor.nodeBefore;
43
- return !!(mediaGroupAncestorNode && mediaGroupAncestorNode.type.name === 'paragraph');
44
- }
26
+ if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
27
+ return true;
45
28
  }
46
29
  if (selection instanceof TextSelection) {
47
30
  if (!selection.empty) {
@@ -51,21 +34,13 @@ export function canMoveUp(state) {
51
34
  return !atTheBeginningOfDoc(state);
52
35
  }
53
36
  export function canMoveDown(state) {
54
- var selection = state.selection,
55
- doc = state.doc;
37
+ var selection = state.selection;
56
38
 
57
39
  /**
58
- * If there's a media element on the selection,
59
- * add text blocks with arrow navigation.
60
- * Also, the selection could be media | mediaGroup.
40
+ * If there's a media element on the selection it will use a gap cursor to move
61
41
  */
62
- if (selection instanceof NodeSelection) {
63
- if (selection.node.type.name === 'media') {
64
- var nodeAfter = doc.nodeAt(selection.$head.after());
65
- return !!(nodeAfter && nodeAfter.type.name === 'paragraph');
66
- } else if (selection.node.type.name === 'mediaGroup') {
67
- return !(selection.$head.parentOffset === selection.$anchor.parent.content.size);
68
- }
42
+ if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
43
+ return true;
69
44
  }
70
45
  if (selection instanceof TextSelection) {
71
46
  if (!selection.empty) {
@@ -126,19 +101,6 @@ export function isMarkTypeAllowedInCurrentSelection(markType, state) {
126
101
  return allowedInActiveMarks;
127
102
  });
128
103
  }
129
- export function createSliceWithContent(content, state) {
130
- return new Slice(Fragment.from(state.schema.text(content)), 0, 0);
131
- }
132
-
133
- /**
134
- * Determines if content inside a selection can be joined with the next block.
135
- * We need this check since the built-in method for "joinDown" will join a orderedList with bulletList.
136
- */
137
- export function canJoinDown(selection, doc, nodeType) {
138
- return checkNodeDown(selection, doc, function (node) {
139
- return node.type === nodeType;
140
- });
141
- }
142
104
  export function checkNodeDown(selection, doc, filter) {
143
105
  var ancestorDepth = findAncestorPosition(doc, selection.$to).depth;
144
106
 
@@ -150,65 +112,10 @@ export function checkNodeDown(selection, doc, filter) {
150
112
  return res.nodeAfter ? filter(res.nodeAfter) : false;
151
113
  }
152
114
 
153
- /**
154
- * Determines if content inside a selection can be joined with the previous block.
155
- * We need this check since the built-in method for "joinUp" will join a orderedList with bulletList.
156
- */
157
- export function canJoinUp(selection, doc, nodeType) {
158
- var res = doc.resolve(selection.$from.before(findAncestorPosition(doc, selection.$from).depth));
159
- return res.nodeBefore && res.nodeBefore.type === nodeType;
160
- }
161
-
162
- /**
163
- * Finds all "selection-groups" within a range. A selection group is based on ancestors.
164
- *
165
- * Example:
166
- * Given the following document and selection ({<} = start of selection and {>} = end)
167
- * doc
168
- * blockquote
169
- * ul
170
- * li
171
- * li{<}
172
- * li
173
- * p
174
- * p{>}
175
- *
176
- * The output will be two selection-groups. One within the ul and one with the two paragraphs.
177
- */
178
- export function getGroupsInRange(doc, $from, $to) {
179
- var isNodeValid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : validateNode;
180
- var groups = Array();
181
- var commonAncestor = hasCommonAncestor(doc, $from, $to);
182
- var fromAncestor = findAncestorPosition(doc, $from);
183
- if (commonAncestor || fromAncestor.depth === 1 && isNodeValid($from.node(1))) {
184
- groups.push({
185
- $from: $from,
186
- $to: $to
187
- });
188
- } else {
189
- var current = $from;
190
- while (current.pos < $to.pos) {
191
- var ancestorPos = findAncestorPosition(doc, current);
192
- while (ancestorPos.depth > 1) {
193
- ancestorPos = findAncestorPosition(doc, ancestorPos);
194
- }
195
- var endPos = doc.resolve(Math.min(
196
- // should not be smaller then start position in case of an empty paragraph for example.
197
- Math.max(ancestorPos.start(ancestorPos.depth), ancestorPos.end(ancestorPos.depth) - 3), $to.pos));
198
- groups.push({
199
- $from: current,
200
- $to: endPos
201
- });
202
- current = doc.resolve(Math.min(endPos.after(1) + 1, doc.nodeSize - 2));
203
- }
204
- }
205
- return groups;
206
- }
207
-
208
115
  /**
209
116
  * Traverse the document until an "ancestor" is found. Any nestable block can be an ancestor.
210
117
  */
211
- export function findAncestorPosition(doc, pos) {
118
+ function findAncestorPosition(doc, pos) {
212
119
  var nestableBlocks = ['blockquote', 'bulletList', 'orderedList'];
213
120
  if (pos.depth === 1) {
214
121
  return pos;
@@ -224,96 +131,6 @@ export function findAncestorPosition(doc, pos) {
224
131
  }
225
132
  return newPos;
226
133
  }
227
-
228
- /**
229
- * Determine if two positions have a common ancestor.
230
- */
231
- export function hasCommonAncestor(doc, $from, $to) {
232
- var current;
233
- var target;
234
- if ($from.depth > $to.depth) {
235
- current = findAncestorPosition(doc, $from);
236
- target = findAncestorPosition(doc, $to);
237
- } else {
238
- current = findAncestorPosition(doc, $to);
239
- target = findAncestorPosition(doc, $from);
240
- }
241
- while (current.depth > target.depth && current.depth > 1) {
242
- current = findAncestorPosition(doc, current);
243
- }
244
- return current.node(current.depth) === target.node(target.depth);
245
- }
246
-
247
- /**
248
- * Takes a selection $from and $to and lift all text nodes from their parents to document-level
249
- */
250
- export function liftSelection(tr, doc, $from, $to) {
251
- var startPos = $from.start($from.depth);
252
- var endPos = $to.end($to.depth);
253
- var target = Math.max(0, findAncestorPosition(doc, $from).depth - 1);
254
- tr.doc.nodesBetween(startPos, endPos, function (node, pos) {
255
- if (node.isText ||
256
- // Text node
257
- node.isTextblock && !node.textContent // Empty paragraph
258
- ) {
259
- var res = tr.doc.resolve(tr.mapping.map(pos));
260
- var sel = new NodeSelection(res);
261
- var range = sel.$from.blockRange(sel.$to);
262
- if (liftTarget(range) !== undefined) {
263
- tr.lift(range, target);
264
- }
265
- }
266
- });
267
- startPos = tr.mapping.map(startPos);
268
- endPos = tr.mapping.map(endPos);
269
- endPos = tr.doc.resolve(endPos).end(tr.doc.resolve(endPos).depth); // We want to select the entire node
270
-
271
- tr.setSelection(new TextSelection(tr.doc.resolve(startPos), tr.doc.resolve(endPos)));
272
- return {
273
- tr: tr,
274
- $from: tr.doc.resolve(startPos),
275
- $to: tr.doc.resolve(endPos)
276
- };
277
- }
278
-
279
- /**
280
- * Lift nodes in block to one level above.
281
- */
282
- export function liftSiblingNodes(view) {
283
- var tr = view.state.tr;
284
- var _view$state$selection = view.state.selection,
285
- $from = _view$state$selection.$from,
286
- $to = _view$state$selection.$to;
287
- var blockStart = tr.doc.resolve($from.start($from.depth - 1));
288
- var blockEnd = tr.doc.resolve($to.end($to.depth - 1));
289
- var range = blockStart.blockRange(blockEnd);
290
- view.dispatch(tr.lift(range, blockStart.depth - 1));
291
- }
292
-
293
- /**
294
- * Lift sibling nodes to document-level and select them.
295
- */
296
- export function liftAndSelectSiblingNodes(view) {
297
- var tr = view.state.tr;
298
- var _view$state$selection2 = view.state.selection,
299
- $from = _view$state$selection2.$from,
300
- $to = _view$state$selection2.$to;
301
- var blockStart = tr.doc.resolve($from.start($from.depth - 1));
302
- var blockEnd = tr.doc.resolve($to.end($to.depth - 1));
303
- // TODO: [ts30] handle void and null properly
304
- var range = blockStart.blockRange(blockEnd);
305
- tr.setSelection(new TextSelection(blockStart, blockEnd));
306
- tr.lift(range, blockStart.depth - 1);
307
- return tr;
308
- }
309
- export function wrapIn(nodeType, tr, $from, $to) {
310
- var range = $from.blockRange($to);
311
- var wrapping = range && findWrapping(range, nodeType);
312
- if (wrapping) {
313
- tr = tr.wrap(range, wrapping).scrollIntoView();
314
- }
315
- return tr;
316
- }
317
134
  var transformer = new JSONTransformer();
318
135
  export function toJSON(node) {
319
136
  return transformer.encode(node);
@@ -24,19 +24,6 @@ export var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
24
24
  });
25
25
  };
26
26
  };
27
- export var ruleWithTransform = function ruleWithTransform(transform) {
28
- return function (originalRule) {
29
- var onHandlerApply = function onHandlerApply(state, tr, matchResult) {
30
- transform(state, tr);
31
- if (originalRule.onHandlerApply) {
32
- originalRule.onHandlerApply(state, tr, matchResult);
33
- }
34
- };
35
- return _objectSpread(_objectSpread({}, originalRule), {}, {
36
- onHandlerApply: onHandlerApply
37
- });
38
- };
39
- };
40
27
  export var createRule = function createRule(match, handler) {
41
28
  return {
42
29
  match: match,
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "180.1.0";
2
+ export var version = "181.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": "180.1.0",
3
+ "version": "181.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,10 +1,10 @@
1
1
  import { Node } from 'prosemirror-model';
2
- import { EditorActionsOptions, ContextUpdateHandler, ReplaceRawValue } from '@atlaskit/editor-common/types';
3
- import { EditorView } from 'prosemirror-view';
4
- import { EventDispatcher } from '../event-dispatcher';
2
+ import { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue } from '@atlaskit/editor-common/types';
5
3
  import { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
6
- import { Transformer } from '@atlaskit/editor-common/types';
7
4
  import { ResolvedEditorState } from '@atlaskit/editor-common/collab';
5
+ import { Transformer } from '@atlaskit/editor-common/types';
6
+ import { EditorView } from 'prosemirror-view';
7
+ import { EventDispatcher } from '../event-dispatcher';
8
8
  export default class EditorActions<T = any> implements EditorActionsOptions<T> {
9
9
  private editorView?;
10
10
  private contentTransformer?;