@atlaskit/editor-core 180.1.0 → 181.0.1

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 (426) hide show
  1. package/CHANGELOG.md +50 -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 +37 -5
  7. package/dist/cjs/create-editor/feature-flags-from-props.js +31 -26
  8. package/dist/cjs/create-editor/preset-utils.js +27 -0
  9. package/dist/cjs/editor-next/editor-internal.js +2 -2
  10. package/dist/cjs/editor-next/editor-migration-component.js +18 -2
  11. package/dist/cjs/editor-next/hooks/useProviderFactory.js +4 -3
  12. package/dist/cjs/editor-next/index.js +13 -9
  13. package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
  14. package/dist/cjs/editor-next/utils/handleProviders.js +17 -22
  15. package/dist/cjs/editor.js +20 -13
  16. package/dist/cjs/keymaps/consts.js +1 -16
  17. package/dist/cjs/labs/next/presets/cxhtml.js +56 -55
  18. package/dist/cjs/labs/next/presets/default.js +15 -42
  19. package/dist/cjs/labs/next/presets/mobile.js +76 -89
  20. package/dist/cjs/labs/next/presets/universal.js +330 -257
  21. package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
  22. package/dist/cjs/plugins/analytics/plugin.js +6 -0
  23. package/dist/cjs/plugins/annotation/utils.js +2 -36
  24. package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
  25. package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
  26. package/dist/cjs/plugins/caption/index.js +0 -7
  27. package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -4
  28. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
  29. package/dist/cjs/plugins/card/pm-plugins/main.js +6 -3
  30. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
  31. package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
  32. package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
  33. package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
  34. package/dist/cjs/plugins/context-panel/index.js +1 -6
  35. package/dist/cjs/plugins/data-consumer/index.js +0 -8
  36. package/dist/cjs/plugins/date/utils/internal.js +0 -4
  37. package/dist/cjs/plugins/extension/commands.js +1 -8
  38. package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
  39. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
  40. package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
  41. package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
  42. package/dist/cjs/plugins/floating-toolbar/ui/Button.js +7 -3
  43. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  44. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
  45. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  46. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +24 -8
  47. package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
  48. package/dist/cjs/plugins/fragment/index.js +0 -8
  49. package/dist/cjs/plugins/help-dialog/commands.js +2 -6
  50. package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
  51. package/dist/cjs/plugins/layout/styles.js +10 -1
  52. package/dist/cjs/plugins/list/utils/find.js +0 -28
  53. package/dist/cjs/plugins/list/utils/indentation.js +1 -25
  54. package/dist/cjs/plugins/list/utils/node.js +0 -5
  55. package/dist/cjs/plugins/list/utils/selection.js +2 -15
  56. package/dist/cjs/plugins/media/utils/media-common.js +1 -20
  57. package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
  58. package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
  59. package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
  60. package/dist/cjs/plugins/mobile-dimensions/index.js +1 -4
  61. package/dist/cjs/plugins/paste/index.js +1 -2
  62. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +123 -87
  63. package/dist/cjs/plugins/paste/util/index.js +0 -46
  64. package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
  65. package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
  66. package/dist/cjs/plugins/status/utils.js +1 -15
  67. package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
  68. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  69. package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  70. package/dist/cjs/plugins/text-formatting/utils.js +1 -26
  71. package/dist/cjs/plugins/type-ahead/constants.js +1 -7
  72. package/dist/cjs/plugins/type-ahead/index.js +4 -1
  73. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +6 -37
  74. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +4 -2
  75. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +41 -4
  76. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  77. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  78. package/dist/cjs/plugins/type-ahead/utils.js +25 -24
  79. package/dist/cjs/test-utils.js +4 -12
  80. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
  81. package/dist/cjs/ui/ColorPalette/index.js +18 -0
  82. package/dist/cjs/ui/ColorPickerButton/index.js +6 -2
  83. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
  84. package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
  85. package/dist/cjs/ui/ContentStyles/index.js +1 -1
  86. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  87. package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
  88. package/dist/cjs/ui/Resizer/utils.js +1 -3
  89. package/dist/cjs/ui/styles.js +3 -7
  90. package/dist/cjs/utils/get-editor-plugins.js +1 -3
  91. package/dist/cjs/utils/index.js +9 -269
  92. package/dist/cjs/utils/input-rules.js +1 -15
  93. package/dist/cjs/version-wrapper.js +1 -1
  94. package/dist/cjs/version.json +1 -1
  95. package/dist/es2019/actions/index.js +23 -9
  96. package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
  97. package/dist/es2019/create-editor/ReactEditorView.js +0 -5
  98. package/dist/es2019/create-editor/ReactEditorViewInternal.js +67 -82
  99. package/dist/es2019/create-editor/create-plugins-list.js +32 -5
  100. package/dist/es2019/create-editor/feature-flags-from-props.js +31 -26
  101. package/dist/es2019/create-editor/preset-utils.js +15 -0
  102. package/dist/es2019/editor-next/editor-internal.js +2 -2
  103. package/dist/es2019/editor-next/editor-migration-component.js +19 -2
  104. package/dist/es2019/editor-next/hooks/useProviderFactory.js +4 -3
  105. package/dist/es2019/editor-next/index.js +13 -7
  106. package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
  107. package/dist/es2019/editor-next/utils/handleProviders.js +18 -24
  108. package/dist/es2019/editor.js +20 -11
  109. package/dist/es2019/keymaps/consts.js +7 -11
  110. package/dist/es2019/labs/next/presets/cxhtml.js +56 -53
  111. package/dist/es2019/labs/next/presets/default.js +18 -38
  112. package/dist/es2019/labs/next/presets/mobile.js +88 -88
  113. package/dist/es2019/labs/next/presets/universal.js +338 -265
  114. package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
  115. package/dist/es2019/plugins/analytics/plugin.js +7 -0
  116. package/dist/es2019/plugins/annotation/utils.js +2 -30
  117. package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
  118. package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
  119. package/dist/es2019/plugins/caption/index.js +0 -2
  120. package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -4
  121. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
  122. package/dist/es2019/plugins/card/pm-plugins/main.js +6 -3
  123. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
  124. package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
  125. package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
  126. package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
  127. package/dist/es2019/plugins/context-panel/index.js +0 -3
  128. package/dist/es2019/plugins/data-consumer/index.js +0 -7
  129. package/dist/es2019/plugins/date/utils/internal.js +0 -3
  130. package/dist/es2019/plugins/extension/commands.js +0 -6
  131. package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
  132. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
  133. package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
  134. package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
  135. package/dist/es2019/plugins/floating-toolbar/ui/Button.js +7 -3
  136. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  137. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
  138. package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  139. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +21 -4
  140. package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
  141. package/dist/es2019/plugins/fragment/index.js +0 -7
  142. package/dist/es2019/plugins/help-dialog/commands.js +1 -2
  143. package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
  144. package/dist/es2019/plugins/layout/styles.js +12 -4
  145. package/dist/es2019/plugins/list/utils/find.js +0 -27
  146. package/dist/es2019/plugins/list/utils/indentation.js +0 -23
  147. package/dist/es2019/plugins/list/utils/node.js +1 -4
  148. package/dist/es2019/plugins/list/utils/selection.js +2 -15
  149. package/dist/es2019/plugins/media/utils/media-common.js +1 -19
  150. package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
  151. package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
  152. package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
  153. package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
  154. package/dist/es2019/plugins/paste/index.js +1 -2
  155. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +126 -94
  156. package/dist/es2019/plugins/paste/util/index.js +5 -45
  157. package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
  158. package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
  159. package/dist/es2019/plugins/status/utils.js +1 -11
  160. package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
  161. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  162. package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  163. package/dist/es2019/plugins/text-formatting/utils.js +0 -19
  164. package/dist/es2019/plugins/type-ahead/constants.js +0 -5
  165. package/dist/es2019/plugins/type-ahead/index.js +4 -1
  166. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +4 -37
  167. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +4 -2
  168. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +41 -4
  169. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  170. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  171. package/dist/es2019/plugins/type-ahead/utils.js +22 -25
  172. package/dist/es2019/test-utils.js +4 -7
  173. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
  174. package/dist/es2019/ui/ColorPalette/index.js +2 -1
  175. package/dist/es2019/ui/ColorPickerButton/index.js +6 -2
  176. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
  177. package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
  178. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  179. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  180. package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
  181. package/dist/es2019/ui/Resizer/utils.js +0 -1
  182. package/dist/es2019/ui/styles.js +0 -6
  183. package/dist/es2019/utils/get-editor-plugins.js +1 -3
  184. package/dist/es2019/utils/index.js +13 -199
  185. package/dist/es2019/utils/input-rules.js +0 -14
  186. package/dist/es2019/version-wrapper.js +1 -1
  187. package/dist/es2019/version.json +1 -1
  188. package/dist/esm/actions/index.js +23 -9
  189. package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
  190. package/dist/esm/create-editor/ReactEditorView.js +0 -5
  191. package/dist/esm/create-editor/ReactEditorViewInternal.js +73 -102
  192. package/dist/esm/create-editor/create-plugins-list.js +36 -5
  193. package/dist/esm/create-editor/feature-flags-from-props.js +31 -26
  194. package/dist/esm/create-editor/preset-utils.js +21 -0
  195. package/dist/esm/editor-next/editor-internal.js +2 -2
  196. package/dist/esm/editor-next/editor-migration-component.js +18 -2
  197. package/dist/esm/editor-next/hooks/useProviderFactory.js +4 -3
  198. package/dist/esm/editor-next/index.js +13 -9
  199. package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
  200. package/dist/esm/editor-next/utils/handleProviders.js +17 -22
  201. package/dist/esm/editor.js +20 -13
  202. package/dist/esm/keymaps/consts.js +7 -11
  203. package/dist/esm/labs/next/presets/cxhtml.js +56 -55
  204. package/dist/esm/labs/next/presets/default.js +18 -41
  205. package/dist/esm/labs/next/presets/mobile.js +88 -90
  206. package/dist/esm/labs/next/presets/universal.js +330 -257
  207. package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
  208. package/dist/esm/plugins/analytics/plugin.js +6 -0
  209. package/dist/esm/plugins/annotation/utils.js +2 -32
  210. package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
  211. package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
  212. package/dist/esm/plugins/caption/index.js +0 -2
  213. package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -4
  214. package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
  215. package/dist/esm/plugins/card/pm-plugins/main.js +6 -3
  216. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
  217. package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
  218. package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
  219. package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
  220. package/dist/esm/plugins/context-panel/index.js +0 -3
  221. package/dist/esm/plugins/data-consumer/index.js +0 -7
  222. package/dist/esm/plugins/date/utils/internal.js +0 -3
  223. package/dist/esm/plugins/extension/commands.js +0 -6
  224. package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
  225. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
  226. package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
  227. package/dist/esm/plugins/feedback-dialog/index.js +0 -2
  228. package/dist/esm/plugins/floating-toolbar/ui/Button.js +7 -3
  229. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -5
  230. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
  231. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
  232. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +24 -8
  233. package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
  234. package/dist/esm/plugins/fragment/index.js +0 -7
  235. package/dist/esm/plugins/help-dialog/commands.js +0 -3
  236. package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
  237. package/dist/esm/plugins/layout/styles.js +11 -2
  238. package/dist/esm/plugins/list/utils/find.js +0 -27
  239. package/dist/esm/plugins/list/utils/indentation.js +0 -23
  240. package/dist/esm/plugins/list/utils/node.js +1 -4
  241. package/dist/esm/plugins/list/utils/selection.js +2 -12
  242. package/dist/esm/plugins/media/utils/media-common.js +1 -17
  243. package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
  244. package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
  245. package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
  246. package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
  247. package/dist/esm/plugins/paste/index.js +1 -2
  248. package/dist/esm/plugins/paste/pm-plugins/analytics.js +122 -86
  249. package/dist/esm/plugins/paste/util/index.js +5 -45
  250. package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
  251. package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
  252. package/dist/esm/plugins/status/utils.js +1 -13
  253. package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
  254. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
  255. package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
  256. package/dist/esm/plugins/text-formatting/utils.js +0 -21
  257. package/dist/esm/plugins/type-ahead/constants.js +0 -5
  258. package/dist/esm/plugins/type-ahead/index.js +4 -1
  259. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +4 -33
  260. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +4 -2
  261. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +41 -4
  262. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  263. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  264. package/dist/esm/plugins/type-ahead/utils.js +24 -22
  265. package/dist/esm/test-utils.js +4 -7
  266. package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
  267. package/dist/esm/ui/ColorPalette/index.js +2 -1
  268. package/dist/esm/ui/ColorPickerButton/index.js +6 -2
  269. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
  270. package/dist/esm/ui/ConfigPanel/utils.js +3 -14
  271. package/dist/esm/ui/ContentStyles/index.js +1 -1
  272. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +1 -1
  273. package/dist/esm/ui/ElementBrowser/constants.js +0 -1
  274. package/dist/esm/ui/Resizer/utils.js +0 -1
  275. package/dist/esm/ui/styles.js +2 -5
  276. package/dist/esm/utils/get-editor-plugins.js +1 -3
  277. package/dist/esm/utils/index.js +13 -196
  278. package/dist/esm/utils/input-rules.js +0 -13
  279. package/dist/esm/version-wrapper.js +1 -1
  280. package/dist/esm/version.json +1 -1
  281. package/dist/types/actions/index.d.ts +4 -4
  282. package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
  283. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +9 -7
  284. package/dist/types/create-editor/ReactEditorViewNext.d.ts +3 -4
  285. package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
  286. package/dist/types/create-editor/preset-utils.d.ts +2 -0
  287. package/dist/types/editor-next/editor-internal.d.ts +9 -9
  288. package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +2 -2
  289. package/dist/types/editor-next/hooks/useProviderFactory.d.ts +2 -2
  290. package/dist/types/editor-next/index.d.ts +6 -6
  291. package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -2
  292. package/dist/types/editor-next/utils/editorPropTypes.d.ts +1 -1
  293. package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
  294. package/dist/types/editor-next/utils/handleProviders.d.ts +2 -2
  295. package/dist/types/editor-next/utils/onEditorCreated.d.ts +2 -2
  296. package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
  297. package/dist/types/editor.d.ts +7 -4
  298. package/dist/types/keymaps/consts.d.ts +0 -11
  299. package/dist/types/labs/next/presets/cxhtml.d.ts +33 -1
  300. package/dist/types/labs/next/presets/default.d.ts +67 -10
  301. package/dist/types/labs/next/presets/mobile.d.ts +33 -1
  302. package/dist/types/labs/next/presets/universal.d.ts +5 -13
  303. package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
  304. package/dist/types/nodeviews/context-adapter.d.ts +0 -1
  305. package/dist/types/nodeviews/index.d.ts +0 -1
  306. package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
  307. package/dist/types/plugins/annotation/utils.d.ts +0 -17
  308. package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
  309. package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
  310. package/dist/types/plugins/caption/index.d.ts +0 -2
  311. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
  312. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -0
  313. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
  314. package/dist/types/plugins/code-block/actions.d.ts +0 -4
  315. package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
  316. package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
  317. package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
  318. package/dist/types/plugins/context-panel/index.d.ts +2 -3
  319. package/dist/types/plugins/data-consumer/index.d.ts +0 -2
  320. package/dist/types/plugins/date/utils/internal.d.ts +0 -1
  321. package/dist/types/plugins/extension/commands.d.ts +0 -1
  322. package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
  323. package/dist/types/plugins/feedback-dialog/index.d.ts +0 -2
  324. package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +3 -1
  325. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
  326. package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
  327. package/dist/types/plugins/fragment/index.d.ts +0 -2
  328. package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
  329. package/dist/types/plugins/history/actions.d.ts +1 -2
  330. package/dist/types/plugins/layout/styles.d.ts +2 -1
  331. package/dist/types/plugins/list/utils/find.d.ts +0 -1
  332. package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
  333. package/dist/types/plugins/list/utils/node.d.ts +0 -2
  334. package/dist/types/plugins/list/utils/selection.d.ts +0 -3
  335. package/dist/types/plugins/media/utils/media-common.d.ts +0 -5
  336. package/dist/types/plugins/mentions/types.d.ts +1 -2
  337. package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
  338. package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
  339. package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
  340. package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -1
  341. package/dist/types/plugins/paste/index.d.ts +0 -1
  342. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -3
  343. package/dist/types/plugins/paste/util/index.d.ts +0 -6
  344. package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
  345. package/dist/types/plugins/status/utils.d.ts +0 -3
  346. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
  347. package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
  348. package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
  349. package/dist/types/plugins/text-formatting/utils.d.ts +0 -4
  350. package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
  351. package/dist/types/plugins/type-ahead/index.d.ts +1 -0
  352. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +2 -11
  353. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +2 -1
  354. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +1 -0
  355. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +1 -0
  356. package/dist/types/plugins/type-ahead/utils.d.ts +3 -3
  357. package/dist/types/test-utils.d.ts +4 -5
  358. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  359. package/dist/types/types/editor-props.d.ts +55 -42
  360. package/dist/types/ui/Appearance/Chromeless.d.ts +0 -5
  361. package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
  362. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
  363. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
  364. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
  365. package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
  366. package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
  367. package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
  368. package/dist/types/ui/ColorPalette/index.d.ts +2 -1
  369. package/dist/types/ui/ColorPickerButton/index.d.ts +4 -2
  370. package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
  371. package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
  372. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  373. package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
  374. package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
  375. package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
  376. package/dist/types/ui/Resizer/utils.d.ts +0 -1
  377. package/dist/types/ui/styles.d.ts +0 -1
  378. package/dist/types/utils/index.d.ts +6 -65
  379. package/dist/types/utils/input-rules.d.ts +1 -2
  380. package/dist/types/utils/table.d.ts +0 -1
  381. package/package.json +23 -24
  382. package/report.api.md +155 -146
  383. package/dist/cjs/labs/next/presets/preset.js +0 -101
  384. package/dist/cjs/plugins/analytics/types/type-ahead.js +0 -5
  385. package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
  386. package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
  387. package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
  388. package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
  389. package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
  390. package/dist/cjs/profiler/render-count.js +0 -60
  391. package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
  392. package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
  393. package/dist/cjs/ui/WithPluginState/types.js +0 -5
  394. package/dist/es2019/labs/next/presets/preset.js +0 -68
  395. package/dist/es2019/plugins/analytics/types/type-ahead.js +0 -1
  396. package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
  397. package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
  398. package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
  399. package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
  400. package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
  401. package/dist/es2019/profiler/render-count.js +0 -53
  402. package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
  403. package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
  404. package/dist/es2019/ui/WithPluginState/types.js +0 -1
  405. package/dist/esm/labs/next/presets/preset.js +0 -93
  406. package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
  407. package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
  408. package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
  409. package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
  410. package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
  411. package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
  412. package/dist/esm/profiler/render-count.js +0 -49
  413. package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
  414. package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
  415. package/dist/esm/ui/WithPluginState/types.js +0 -1
  416. package/dist/types/labs/next/presets/preset.d.ts +0 -46
  417. package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
  418. package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
  419. package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
  420. package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
  421. package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
  422. package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
  423. package/dist/types/profiler/render-count.d.ts +0 -14
  424. package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
  425. package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
  426. package/dist/types/ui/WithPluginState/types.d.ts +0 -10
@@ -0,0 +1,29 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import { useLayoutEffect, useState } from 'react';
3
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
4
+ import { usePreviousState } from '@atlaskit/editor-common/hooks';
5
+ import { createPreset } from '../../../create-editor/create-plugins-list';
6
+ import { shouldRecreatePreset } from '../../../create-editor/preset-utils';
7
+ export default function useUniversalPreset(_ref) {
8
+ var props = _ref.props;
9
+ var _useAnalyticsEvents = useAnalyticsEvents(),
10
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
11
+ var previousEditorProps = usePreviousState(props);
12
+ var _useState = useState(function () {
13
+ return createPreset(props, previousEditorProps);
14
+ }),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ preset = _useState2[0],
17
+ setPreset = _useState2[1];
18
+ useLayoutEffect(function () {
19
+ if (!previousEditorProps) {
20
+ return;
21
+ }
22
+ var recreate = shouldRecreatePreset(previousEditorProps, props);
23
+ if (!recreate) {
24
+ return;
25
+ }
26
+ setPreset(createPreset(props, previousEditorProps, createAnalyticsEvent));
27
+ }, [props, previousEditorProps, createAnalyticsEvent]);
28
+ return preset;
29
+ }
@@ -28,6 +28,12 @@ function createPlugin(options) {
28
28
  },
29
29
  apply: function apply(tr, pluginState, _, state) {
30
30
  var _getFeatureFlags;
31
+ if (pluginState.createAnalyticsEvent !== options.createAnalyticsEvent) {
32
+ // When the plugin state is reconfigured, the init function isn't called again
33
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
34
+ createAnalyticsEvent: options.createAnalyticsEvent
35
+ });
36
+ }
31
37
  if ((_getFeatureFlags = getFeatureFlags(state)) !== null && _getFeatureFlags !== void 0 && _getFeatureFlags.catchAllTracking) {
32
38
  var analyticsEventWithChannel = getAnalyticsEventsFromTransaction(tr);
33
39
  if (analyticsEventWithChannel.length > 0) {
@@ -22,7 +22,7 @@ export var surroundingMarks = function surroundingMarks($pos) {
22
22
  * Finds annotation marks, and returns their IDs.
23
23
  * @param marks Array of marks to search in
24
24
  */
25
- export var filterAnnotationIds = function filterAnnotationIds(marks) {
25
+ var filterAnnotationIds = function filterAnnotationIds(marks) {
26
26
  if (!marks.length) {
27
27
  return [];
28
28
  }
@@ -44,7 +44,7 @@ export var filterAnnotationIds = function filterAnnotationIds(marks) {
44
44
  * @param annotations annotation metadata
45
45
  * @param $from location to look around (usually the selection)
46
46
  */
47
- export var reorderAnnotations = function reorderAnnotations(annotations, $from) {
47
+ var reorderAnnotations = function reorderAnnotations(annotations, $from) {
48
48
  var idSet = surroundingMarks($from).map(filterAnnotationIds);
49
49
  annotations.sort(function (a, b) {
50
50
  return sum(idSet, function (ids) {
@@ -93,36 +93,6 @@ var validateAnnotationMark = function validateAnnotationMark(annotationMark) {
93
93
  }
94
94
  };
95
95
 
96
- // helper function: return the first selection range for the window
97
- var getSelectionRange = function getSelectionRange() {
98
- var selection = window.getSelection();
99
-
100
- // no selection made in browser
101
- if (!selection || selection.isCollapsed) {
102
- return null;
103
- }
104
- var selectionRange = selection.getRangeAt(0);
105
- return selectionRange;
106
- };
107
-
108
- // helper function: find the bounds of first part within selected content
109
- export var getSelectionStartRect = function getSelectionStartRect() {
110
- var range = getSelectionRange();
111
- if (!range) {
112
- return null;
113
- }
114
- var rects = range.getClientRects();
115
- if (!rects.length) {
116
- return null;
117
- }
118
- // Find first selection area that width is not 0
119
- // Sometimes there is a chance that user is selecting an empty DOM node.
120
- var firstRect = Array.from(rects).find(function (rect) {
121
- return rect.width !== 0 && rect.height !== 0;
122
- });
123
- return firstRect || null;
124
- };
125
-
126
96
  /*
127
97
  * add decoration for the comment selection in draft state
128
98
  * (when creating new comment)
@@ -59,8 +59,4 @@ export var plugin = new SafePlugin({
59
59
  }
60
60
  };
61
61
  }
62
- });
63
- var plugins = function plugins() {
64
- return [plugin];
65
- };
66
- export default plugins;
62
+ });
@@ -11,22 +11,16 @@ function getHeadingLevel(match) {
11
11
  level: match[1].length
12
12
  };
13
13
  }
14
- export function headingRule(nodeType, maxLevel) {
14
+ function headingRule(nodeType, maxLevel) {
15
15
  return createWrappingTextBlockRule({
16
16
  match: new RegExp('^(#{1,' + maxLevel + '})\\s$'),
17
17
  nodeType: nodeType,
18
18
  getAttrs: getHeadingLevel
19
19
  });
20
20
  }
21
- export function blockQuoteRule(nodeType) {
21
+ function blockQuoteRule(nodeType) {
22
22
  return createJoinNodesRule(/^\s*>\s$/, nodeType);
23
23
  }
24
- export function codeBlockRule(nodeType) {
25
- return createWrappingTextBlockRule({
26
- match: /^```$/,
27
- nodeType: nodeType
28
- });
29
- }
30
24
 
31
25
  /**
32
26
  * Get heading rules
@@ -135,7 +129,7 @@ function getCodeBlockRules(schema) {
135
129
  });
136
130
  return [ruleAnalytics(threeTildeRule), ruleAnalytics(leftNodeReplacementThreeTildeRule)];
137
131
  }
138
- export function inputRulePlugin(schema, featureFlags) {
132
+ function inputRulePlugin(schema, featureFlags) {
139
133
  var rules = [];
140
134
  if (schema.nodes.heading) {
141
135
  rules.push.apply(rules, _toConsumableArray(getHeadingRules(schema)));
@@ -1,8 +1,6 @@
1
1
  import { caption } from '@atlaskit/adf-schema';
2
2
  import { default as createCaptionPlugin } from './pm-plugins/main';
3
- import { pluginKey } from './pm-plugins/plugin-key';
4
3
  import { captionKeymap } from './pm-plugins/keymap';
5
- export { pluginKey };
6
4
  var captionPlugin = function captionPlugin() {
7
5
  return {
8
6
  name: 'caption',
@@ -76,7 +76,8 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
76
76
  var _this$props2 = this.props,
77
77
  node = _this$props2.node,
78
78
  cardContext = _this$props2.cardContext,
79
- platform = _this$props2.platform;
79
+ platform = _this$props2.platform,
80
+ showServerActions = _this$props2.showServerActions;
80
81
  var _node$attrs = node.attrs,
81
82
  url = _node$attrs.url,
82
83
  data = _node$attrs.data;
@@ -89,7 +90,8 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
89
90
  onClick: this.onClick,
90
91
  onResolve: this.onResolve,
91
92
  showActions: platform === 'web',
92
- platform: platform
93
+ platform: platform,
94
+ showServerActions: showServerActions
93
95
  }), this.gapCursorSpan());
94
96
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
95
97
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -126,12 +128,15 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
126
128
  }, {
127
129
  key: "render",
128
130
  value: function render() {
129
- var platform = this.reactComponentProps.platform;
131
+ var _this$reactComponentP = this.reactComponentProps,
132
+ platform = _this$reactComponentP.platform,
133
+ showServerActions = _this$reactComponentP.showServerActions;
130
134
  return /*#__PURE__*/React.createElement(WrappedBlockCard, {
131
135
  node: this.node,
132
136
  view: this.view,
133
137
  getPos: this.getPos,
134
- platform: platform
138
+ platform: platform,
139
+ showServerActions: showServerActions
135
140
  });
136
141
  }
137
142
  }]);
@@ -66,6 +66,7 @@ export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
66
66
  var _this$props2 = this.props,
67
67
  node = _this$props2.node,
68
68
  cardContext = _this$props2.cardContext,
69
+ showServerActions = _this$props2.showServerActions,
69
70
  useAlternativePreloader = _this$props2.useAlternativePreloader;
70
71
  var _node$attrs = node.attrs,
71
72
  url = _node$attrs.url,
@@ -81,7 +82,8 @@ export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
81
82
  container: this.scrollContainer,
82
83
  onResolve: this.onResolve,
83
84
  onError: this.onError,
84
- inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined
85
+ inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
86
+ showServerActions: showServerActions
85
87
  }));
86
88
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
87
89
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -100,11 +102,13 @@ export function InlineCardNodeView(props) {
100
102
  var useAlternativePreloader = props.useAlternativePreloader,
101
103
  node = props.node,
102
104
  view = props.view,
103
- getPos = props.getPos;
105
+ getPos = props.getPos,
106
+ showServerActions = props.showServerActions;
104
107
  return /*#__PURE__*/React.createElement(WrappedInlineCard, {
105
108
  node: node,
106
109
  view: view,
107
110
  getPos: getPos,
111
+ showServerActions: showServerActions,
108
112
  useAlternativePreloader: useAlternativePreloader
109
113
  });
110
114
  }
@@ -16,7 +16,8 @@ export var createPlugin = function createPlugin(options) {
16
16
  allowResizing = options.allowResizing,
17
17
  useAlternativePreloader = options.useAlternativePreloader,
18
18
  fullWidthMode = options.fullWidthMode,
19
- createAnalyticsEvent = options.createAnalyticsEvent;
19
+ createAnalyticsEvent = options.createAnalyticsEvent,
20
+ showServerActions = options.showServerActions;
20
21
  return new SafePlugin({
21
22
  state: {
22
23
  init: function init() {
@@ -97,14 +98,16 @@ export var createPlugin = function createPlugin(options) {
97
98
  pmPluginFactoryParams: pmPluginFactoryParams,
98
99
  Component: InlineCardNodeView,
99
100
  extraComponentProps: {
100
- useAlternativePreloader: useAlternativePreloader
101
+ useAlternativePreloader: useAlternativePreloader,
102
+ showServerActions: showServerActions
101
103
  }
102
104
  }),
103
105
  blockCard: function blockCard(node, view, getPos) {
104
106
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
105
107
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
106
108
  var reactComponentProps = {
107
- platform: platform
109
+ platform: platform,
110
+ showServerActions: showServerActions
108
111
  };
109
112
  var hasIntlContext = true;
110
113
  return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
@@ -21,6 +21,10 @@ export var resolveWithProvider = function resolveWithProvider(view, outstandingR
21
21
  };
22
22
  var updateCardType = function updateCardType(resolvedCard, options) {
23
23
  if ((resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'blockCard' && !options.allowBlockCards || (resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'embedCard' && !options.allowEmbeds) {
24
+ // clean out the 'layout' attr from an embedCard type that should be transformed into the inlineCard type.
25
+ if (resolvedCard.type === 'embedCard') {
26
+ delete resolvedCard.attrs.layout;
27
+ }
24
28
  resolvedCard.type = 'inlineCard';
25
29
  }
26
30
  };
@@ -1,14 +1,4 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- 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; }
4
1
  import { pluginKey } from '../plugin-key';
5
2
  export var getPluginState = function getPluginState(state) {
6
3
  return pluginKey.getState(state);
7
- };
8
- export var setPluginState = function setPluginState(stateProps) {
9
- return function (state, dispatch) {
10
- var pluginState = getPluginState(state);
11
- dispatch(state.tr.setMeta(pluginKey, _objectSpread(_objectSpread({}, pluginState), stateProps)));
12
- return true;
13
- };
14
4
  };
@@ -1 +1 @@
1
- export { PubSubSpecialEventType } from './types';
1
+ export {};
@@ -1,10 +1 @@
1
- /**
2
- * Same as PubSub client types (don't want a direct dep though)
3
- */
4
-
5
- export var PubSubSpecialEventType;
6
- (function (PubSubSpecialEventType) {
7
- PubSubSpecialEventType["ERROR"] = "ERROR";
8
- PubSubSpecialEventType["CONNECTED"] = "CONNECTED";
9
- PubSubSpecialEventType["RECONNECT"] = "RECONNECT";
10
- })(PubSubSpecialEventType || (PubSubSpecialEventType = {}));
1
+ export {};
@@ -4,9 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { PluginKey } from 'prosemirror-state';
6
6
  export var pluginKey = new PluginKey('contextPanelPluginKey');
7
- export function getPluginState(state) {
8
- return pluginKey.getState(state);
9
- }
10
7
  function contextPanelPluginFactory(contextPanels, dispatch) {
11
8
  return new SafePlugin({
12
9
  key: pluginKey,
@@ -1,11 +1,4 @@
1
1
  import { dataConsumer } from '@atlaskit/adf-schema';
2
- import { Plugin } from 'prosemirror-state';
3
- import { pluginKey } from './plugin-key';
4
- export function createPlugin() {
5
- return new Plugin({
6
- key: pluginKey
7
- });
8
- }
9
2
  var dataConsumerMarkPlugin = function dataConsumerMarkPlugin() {
10
3
  return {
11
4
  name: 'dataConsumerPlugin',
@@ -5,9 +5,6 @@ import { formatDateType, dateTypeToDate, dateToDateType } from './formatParse';
5
5
  import addDays from 'date-fns/addDays';
6
6
  import addMonths from 'date-fns/addMonths';
7
7
  import addYears from 'date-fns/addYears';
8
- export function padToTwo(number) {
9
- return number <= 99 ? "0".concat(number).slice(-2) : "".concat(number);
10
- }
11
8
  function isDigit(c) {
12
9
  if (c === undefined) {
13
10
  return false;
@@ -42,12 +42,6 @@ export var forceAutoSave = function forceAutoSave(resolve, reject) {
42
42
  }
43
43
  }, applyChange);
44
44
  };
45
- export var showContextPanel = createCommand({
46
- type: 'UPDATE_STATE',
47
- data: {
48
- showContextPanel: true
49
- }
50
- }, applyChange);
51
45
  export var updateExtensionLayout = function updateExtensionLayout(layout) {
52
46
  return createCommand({
53
47
  type: 'UPDATE_STATE',
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["type"];
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ 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
7
  /** @jsx jsx */
6
8
  import React from 'react';
7
9
  import { jsx } from '@emotion/react';
@@ -45,7 +47,10 @@ function ExtensionWithPluginState(props) {
45
47
  'with-children': hasChildren,
46
48
  'without-frame': removeBorder
47
49
  });
48
- var customContainerStyles = {};
50
+ var customContainerStyles = {
51
+ width: '100%'
52
+ };
53
+ var newContentStyles = {};
49
54
  if (shouldBreakout) {
50
55
  var _calculateBreakoutSty = calculateBreakoutStyles({
51
56
  mode: node.attrs.layout,
@@ -54,8 +59,10 @@ function ExtensionWithPluginState(props) {
54
59
  }),
55
60
  type = _calculateBreakoutSty.type,
56
61
  breakoutStyles = _objectWithoutProperties(_calculateBreakoutSty, _excluded);
62
+ newContentStyles = _objectSpread({}, breakoutStyles);
57
63
  customContainerStyles = breakoutStyles;
58
64
  }
65
+ newContentStyles = _objectSpread(_objectSpread({}, newContentStyles), contentWrapper);
59
66
  return jsx("div", {
60
67
  ref: handleRef,
61
68
  "data-layout": node.attrs.layout,
@@ -74,7 +81,7 @@ function ExtensionWithPluginState(props) {
74
81
  }, !removeBorder && jsx(ExtensionLozenge, {
75
82
  node: node
76
83
  }), children), hasBody && jsx("div", {
77
- css: contentWrapper
84
+ css: newContentStyles
78
85
  }, jsx("div", {
79
86
  css: content,
80
87
  ref: handleContentDOMRef,
@@ -11,11 +11,11 @@ export var wrapperStyle = function wrapperStyle(theme) {
11
11
  };
12
12
  export var header = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", "px ", "px 0px;\n vertical-align: middle;\n\n &.with-children:not(.without-frame) {\n padding: 4px 8px 8px;\n }\n &.without-frame {\n padding: 0;\n }\n"])), padding / 2, padding / 2);
13
13
  export var content = function content(theme) {
14
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n"])), padding, themed({
14
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n width: 100%;\n"])), padding, themed({
15
15
  light: "var(--ds-surface, white)",
16
16
  dark: "var(--ds-surface, ".concat(DN30, ")")
17
17
  })(theme), themed({
18
18
  dark: "var(--ds-text, ".concat(DN900, ")")
19
19
  })(theme), "var(--ds-border, ".concat(N30, ")"), borderRadius());
20
20
  };
21
- export var contentWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px ", "px;\n"])), padding, padding);
21
+ export var contentWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px ", "px;\n display: flex;\n justify-content: center;\n"])), padding, padding);
@@ -69,6 +69,7 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
69
69
  var title = parameters && parameters.extensionTitle || parameters && parameters.macroMetadata && parameters.macroMetadata.title || extensionKey;
70
70
  var isBlockExtension = name === 'extension';
71
71
  return jsx("div", {
72
+ "data-testid": "lozenge-fallback",
72
73
  css: placeholderFallback
73
74
  }, lozengeData && !isBlockExtension ? this.renderImage(_objectSpread({
74
75
  height: ICON_SIZE,
@@ -5,13 +5,11 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  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; }
7
7
  import React from 'react';
8
- import { PluginKey } from 'prosemirror-state';
9
8
  import { IconFeedback } from '../quick-insert/assets';
10
9
  import { version as coreVersion } from '../../version-wrapper';
11
10
  import { addAnalytics, ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '../analytics';
12
11
  import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
13
12
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
14
- export var pluginKey = new PluginKey('feedbackDialogPlugin');
15
13
  var showJiraCollectorDialog;
16
14
  var feedbackInfoHash;
17
15
  var defaultFeedbackInfo;
@@ -30,7 +30,9 @@ export default (function (_ref) {
30
30
  _ref$hideTooltipOnCli = _ref.hideTooltipOnClick,
31
31
  hideTooltipOnClick = _ref$hideTooltipOnCli === void 0 ? true : _ref$hideTooltipOnCli,
32
32
  ariaHasPopup = _ref.ariaHasPopup,
33
- tabIndex = _ref.tabIndex;
33
+ tabIndex = _ref.tabIndex,
34
+ areaControls = _ref.areaControls,
35
+ ariaLabel = _ref.ariaLabel;
34
36
  // Check if there's only an icon and add additional styles
35
37
  var iconOnly = (icon || iconAfter) && !children;
36
38
  var customSpacing = iconOnly ? iconOnlySpacing : {};
@@ -55,8 +57,10 @@ export default (function (_ref) {
55
57
  }))
56
58
  }, rest);
57
59
  },
58
- "aria-label": title,
59
- "aria-pressed": selected,
60
+ "aria-label": ariaLabel || title,
61
+ "aria-pressed": !ariaHasPopup ? selected : undefined,
62
+ "aria-expanded": ariaHasPopup ? selected : undefined,
63
+ "aria-controls": ariaHasPopup ? areaControls : undefined,
60
64
  spacing: 'compact',
61
65
  href: href,
62
66
  target: target,
@@ -80,9 +80,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
80
80
  });
81
81
  _defineProperty(_assertThisInitialized(_this), "hideOnEsc", function () {
82
82
  var _document$querySelect;
83
- _this.hide();
84
- //Focus the trigger button only on Escape
83
+ // Focus the trigger button only on Escape
84
+ // Focus is done before hiding to ensure onBlur is called
85
85
  (_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
86
+ _this.hide();
86
87
  });
87
88
  _defineProperty(_assertThisInitialized(_this), "onOpenChanged", function (openChangedEvent) {
88
89
  if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
@@ -109,7 +110,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
109
110
  tooltip = _this$props2.tooltip,
110
111
  buttonTestId = _this$props2.buttonTestId,
111
112
  dropdownWidth = _this$props2.dropdownWidth,
112
- editorView = _this$props2.editorView;
113
+ editorView = _this$props2.editorView,
114
+ dropdownListId = _this$props2.dropdownListId;
113
115
  var trigger;
114
116
  if (icon) {
115
117
  var TriggerIcon = hideExpandIcon ? icon : jsx(CompositeIcon, {
@@ -137,7 +139,9 @@ var Dropdown = /*#__PURE__*/function (_Component) {
137
139
  onKeyDown: this.toggleOpenByKeyboard,
138
140
  selected: isOpen,
139
141
  disabled: disabled,
140
- tooltipContent: tooltip
142
+ tooltipContent: tooltip,
143
+ ariaHasPopup: true,
144
+ areaControls: dropdownListId
141
145
  }, title);
142
146
  }
143
147
 
@@ -160,7 +164,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
160
164
  fitWidth: fitWidth + fitTolerance,
161
165
  fitHeight: fitHeight + fitTolerance,
162
166
  trigger: trigger,
163
- editorView: editorView
167
+ editorView: editorView,
168
+ dropdownListId: dropdownListId
164
169
  }, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
165
170
  hide: this.hide,
166
171
  dispatchCommand: dispatchCommand
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
- var _templateObject, _templateObject2;
3
+ var _templateObject;
4
4
  /** @jsx jsx */
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import React from 'react';
@@ -14,11 +14,6 @@ import withOuterListeners from '../../../ui/with-outer-listeners';
14
14
 
15
15
  // helps adjusts position of popup
16
16
  var emojiPickerButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
17
-
18
- // helps to vertically align emoji picker
19
- // both top and bottom margin should be 2px
20
- // https://product-fabric.atlassian.net/browse/CETI-148
21
- var emojiPickerWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: -12px;\n margin-top: -4px;\n"])));
22
17
  var EmojiPickerWithListener = withOuterListeners(EmojiPicker);
23
18
  export var EmojiPickerButton = function EmojiPickerButton(props) {
24
19
  var buttonRef = React.useRef(null);
@@ -78,13 +73,11 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
78
73
  // we need an index of > 500 to display over it
79
74
  ,
80
75
  zIndex: props.setDisableParentScroll ? 600 : undefined
81
- }, jsx("div", {
82
- css: emojiPickerWrapper
83
76
  }, jsx(WithProviders, {
84
77
  providers: ['emojiProvider'],
85
78
  providerFactory: props.providerFactory,
86
79
  renderNode: renderPicker
87
- })));
80
+ }));
88
81
  };
89
82
  var title = props.title || '';
90
83
  return jsx("div", {
@@ -84,6 +84,7 @@ var ExtensionButton = function ExtensionButton(props) {
84
84
  };
85
85
  return /*#__PURE__*/React.createElement(Button, {
86
86
  title: item.label,
87
+ ariaLabel: item.tooltip,
87
88
  icon: ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
88
89
  label: item.label || ''
89
90
  }) : undefined,
@@ -29,6 +29,7 @@ import Separator from './Separator';
29
29
  import Input from './Input';
30
30
  import { ExtensionsPlaceholder } from './ExtensionsPlaceholder';
31
31
  import ColorPickerButton from '../../../ui/ColorPickerButton';
32
+ import { backgroundPaletteTooltipMessages } from '../../../ui/ColorPalette';
32
33
  import { EmojiPickerButton } from './EmojiPickerButton';
33
34
  import Announcer from '../../../utils/announcer/announcer';
34
35
  import { injectIntl } from 'react-intl-next';
@@ -54,6 +55,10 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
54
55
  setDisableScroll = _ref.setDisableScroll,
55
56
  mountRef = _ref.mountRef;
56
57
  var emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
58
+ var _ref2 = editorView ? getFeatureFlags(editorView.state) : {
59
+ useSomewhatSemanticTextColorNames: false
60
+ },
61
+ useSomewhatSemanticTextColorNames = _ref2.useSomewhatSemanticTextColorNames;
57
62
  return jsx(ButtonGroup, null, items.filter(function (item) {
58
63
  return !item.hidden;
59
64
  }).map(function (item, idx) {
@@ -139,7 +144,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
139
144
  showSelected: item.showSelected,
140
145
  buttonTestId: item.testId,
141
146
  editorView: editorView,
142
- setDisableParentScroll: scrollable ? setDisableScroll : undefined
147
+ setDisableParentScroll: scrollable ? setDisableScroll : undefined,
148
+ dropdownListId: (item === null || item === void 0 ? void 0 : item.id) && "".concat(item.id, "-dropdownList")
143
149
  });
144
150
  case 'select':
145
151
  if (item.selectType === 'list') {
@@ -178,12 +184,22 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
178
184
  // Currently in floating toolbar, color picker is only
179
185
  // used in panel and table cell background color.
180
186
  // Both uses same color palette.
181
- // That's why hard-coding hexToEditorBackgroundPaletteColor.
187
+ // That's why hard-coding hexToEditorBackgroundPaletteColor
188
+ // and paletteColorTooltipMessages.
182
189
  // When we need to support different color palette
183
190
  // in floating toolbar, we need to set hexToPaletteColor
184
- // in item options.
191
+ // and paletteColorTooltipMessages in item options.
185
192
  ,
186
- hexToPaletteColor: hexToEditorBackgroundPaletteColor
193
+ hexToPaletteColor: hexToEditorBackgroundPaletteColor,
194
+ paletteColorTooltipMessages: backgroundPaletteTooltipMessages
195
+ // We did not want to create new FF or update
196
+ // useSomewhatSemanticTextColorNames name
197
+ // because it is temporary and require extra work.
198
+ // So even though it says text color names,
199
+ // we are going to use for all color pickers
200
+ // such as text, background and table charts.
201
+ ,
202
+ showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames
187
203
  });
188
204
  }
189
205
  if (item.selectType === 'emoji') {
@@ -205,8 +221,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
205
221
  if (!editorView || !extensionsProvider) {
206
222
  return null;
207
223
  }
208
- var _ref2 = getFeatureFlags(editorView.state) || {},
209
- extendFloatingToolbar = _ref2.extendFloatingToolbar;
224
+ var _ref3 = getFeatureFlags(editorView.state) || {},
225
+ extendFloatingToolbar = _ref3.extendFloatingToolbar;
210
226
  if (!extendFloatingToolbar) {
211
227
  return null;
212
228
  }
@@ -343,8 +359,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
343
359
  // this prevents https://product-fabric.atlassian.net/browse/ED-10207
344
360
  _createClass(Toolbar, [{
345
361
  key: "resetStyling",
346
- value: function resetStyling(_ref3) {
347
- var table = _ref3.table;
362
+ value: function resetStyling(_ref4) {
363
+ var table = _ref4.table;
348
364
  if (this.props.editorView) {
349
365
  var _this$props$editorVie2 = this.props.editorView,
350
366
  state = _this$props$editorVie2.state,
@@ -50,14 +50,4 @@ export function findNode(parent, predicate) {
50
50
  return true;
51
51
  });
52
52
  return matchedNode;
53
- }
54
- export function getFocusableElements(rootNode) {
55
- if (!rootNode) {
56
- return [];
57
- }
58
- var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select') || [];
59
- return Array.from(focusableModalElements) || [];
60
- }
61
- export function getFirstFocusableElement(rootNode) {
62
- return getFocusableElements(rootNode)[0];
63
53
  }