@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
@@ -34,16 +34,21 @@ export function getScrollGutterOptions(props) {
34
34
  return undefined;
35
35
  }
36
36
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
37
- var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
37
+ var _props$performanceTra, _props$linking, _ref, _props$featureFlags$u, _props$featureFlags, _props$featureFlags2, _props$performanceTra2, _props$textFormatting, _props$linking2;
38
38
  var appearance = props.appearance;
39
39
  var isMobile = appearance === 'mobile';
40
40
  var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
41
41
  var cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
42
+
43
+ // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
44
+ var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
45
+ var useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
42
46
  return _objectSpread(_objectSpread({}, props), {}, {
43
47
  createAnalyticsEvent: createAnalyticsEvent,
44
48
  typeAhead: {
45
49
  createAnalyticsEvent: createAnalyticsEvent,
46
- isMobile: isMobile
50
+ isMobile: isMobile,
51
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
47
52
  },
48
53
  featureFlags: createFeatureFlagsFromProps(props),
49
54
  paste: {
@@ -102,13 +107,39 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
102
107
  * Note: The order that presets are added determines
103
108
  * their placement in the editor toolbar
104
109
  */
105
- export default function createPluginsList(props, prevProps, createAnalyticsEvent, insertNodeAPI, editorAnalyticsAPI, editorSelectionAPI, getEditorContainerWidth) {
106
- var preset = createUniversalPreset(props.appearance, getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent), createFeatureFlagsFromProps(props), prevProps === null || prevProps === void 0 ? void 0 : prevProps.appearance, createAnalyticsEvent, insertNodeAPI, editorAnalyticsAPI, editorSelectionAPI, getEditorContainerWidth);
110
+ export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
111
+ var preset = createUniversalPreset(props.appearance, getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent), createFeatureFlagsFromProps(props), prevProps === null || prevProps === void 0 ? void 0 : prevProps.appearance, createAnalyticsEvent);
107
112
  var excludes = new Set();
108
113
  if (!isCodeBlockAllowed({
109
114
  allowBlockType: props.allowBlockType
110
115
  })) {
111
116
  excludes.add('codeBlock');
112
117
  }
113
- return preset.getEditorPlugins(excludes);
118
+ return preset.build({
119
+ excludePlugins: excludes
120
+ });
121
+ }
122
+ function withDangerouslyAppendPlugins(preset) {
123
+ function createEditorNextPluginsFromDangerouslyAppended(plugins) {
124
+ return plugins ? plugins.map(function (plugin) {
125
+ return function () {
126
+ return plugin;
127
+ };
128
+ }) : [];
129
+ }
130
+ return function (editorPluginsToAppend) {
131
+ if (!editorPluginsToAppend || editorPluginsToAppend.length === 0) {
132
+ return preset;
133
+ }
134
+ var nextEditorPluginsToAppend = createEditorNextPluginsFromDangerouslyAppended(editorPluginsToAppend);
135
+ var presetWithAppendedPlugins = nextEditorPluginsToAppend.reduce(function (acc, plugin) {
136
+ return acc.add(plugin);
137
+ }, preset);
138
+ return presetWithAppendedPlugins;
139
+ };
140
+ }
141
+ export function createPreset(props, prevProps, createAnalyticsEvent) {
142
+ var _props$dangerouslyApp;
143
+ var preset = createUniversalPreset(props.appearance, getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent), createFeatureFlagsFromProps(props), prevProps === null || prevProps === void 0 ? void 0 : prevProps.appearance, createAnalyticsEvent);
144
+ return withDangerouslyAppendPlugins(preset)((_props$dangerouslyApp = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp === void 0 ? void 0 : _props$dangerouslyApp.__plugins);
114
145
  }
@@ -25,9 +25,12 @@ function getSpellCheck(featureFlags) {
25
25
  * which is used by both current and archv3 editors.
26
26
  */
27
27
  export function createFeatureFlagsFromProps(props) {
28
- var _props$featureFlags, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$collabEdit, _props$collabEdit2, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45;
28
+ var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46, _props$featureFlags47;
29
29
  var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
30
30
  var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
31
+
32
+ // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
33
+ var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
31
34
  return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
32
35
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
33
36
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
@@ -38,37 +41,39 @@ export function createFeatureFlagsFromProps(props) {
38
41
  singleLayout: _typeof(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
39
42
  undoRedoButtons: props.allowUndoRedoButtons,
40
43
  catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
41
- stickyHeadersOptimization: typeof ((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
42
- initialRenderOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
43
- mouseMoveOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
44
- tableRenderOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
45
- tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
44
+ stickyHeadersOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
45
+ initialRenderOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
46
+ mouseMoveOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
47
+ tableRenderOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
48
+ tableOverflowShadowsOptimization: typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
46
49
  extendFloatingToolbar: Boolean(_typeof(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
47
- showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.showAvatarGroupAsPlugin) : false),
48
- errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
49
- synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
50
- enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
51
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
52
- ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
53
- twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
54
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
55
- saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactionsAnalyticsOnly) : false)),
50
+ showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.showAvatarGroupAsPlugin) : false),
51
+ errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.useErrorBoundaryDocStructure) : false),
52
+ synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.synchronyErrorDocStructure) : false),
53
+ enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.enableViewUpdateSubscription) : false),
54
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.collabAvatarScroll) : false),
55
+ ufo: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.ufo) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.ufo) : false),
56
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.twoLineEditorToolbar) : false),
57
+ saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
58
+ saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.saferDispatchedTransactionsAnalyticsOnly) : false)),
56
59
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
57
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
60
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
58
61
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
59
- showHoverPreview: Boolean(typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.showHoverPreview) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.showHoverPreview) : false),
60
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.indentationButtonsInTheToolbar) : false)),
61
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.floatingToolbarCopyButton) : false)),
62
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
62
+ showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
63
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
64
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
65
+ floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
63
66
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
64
67
  // Including fallback to props.featureFlags so that mobile feature flags
65
68
  // are included (they are not kebab cased)
66
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
67
- listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.listNumberContinuity) === true,
68
- restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedListsToolbar) === true,
69
- useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42.useSomewhatSemanticTextColorNames) : false)),
69
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
70
+ listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.listNumberContinuity) === true,
71
+ restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags42 = props.featureFlags) === null || _props$featureFlags42 === void 0 ? void 0 : _props$featureFlags42.restartNumberedListsToolbar) === true,
72
+ useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44.useSomewhatSemanticTextColorNames) : false)),
70
73
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
71
- preventPopupOverflow: Boolean(typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44['prevent-popup-overflow']) : false),
72
- useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45.useEditorNext) === true
74
+ preventPopupOverflow: Boolean(typeof ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags46 = props.featureFlags) !== null && _props$featureFlags46 !== void 0 && _props$featureFlags46['prevent-popup-overflow']) : false),
75
+ useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
76
+ // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
77
+ useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
73
78
  });
74
79
  }
@@ -0,0 +1,21 @@
1
+ var EMPTY = [];
2
+ export function shouldRecreatePreset(props, nextProps) {
3
+ var _props$dangerouslyApp, _props$dangerouslyApp2, _nextProps$dangerousl, _nextProps$dangerousl2;
4
+ var prevPlugins = (_props$dangerouslyApp = (_props$dangerouslyApp2 = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp2 === void 0 ? void 0 : _props$dangerouslyApp2.__plugins) !== null && _props$dangerouslyApp !== void 0 ? _props$dangerouslyApp : EMPTY;
5
+ var nextPlugins = (_nextProps$dangerousl = (_nextProps$dangerousl2 = nextProps.dangerouslyAppendPlugins) === null || _nextProps$dangerousl2 === void 0 ? void 0 : _nextProps$dangerousl2.__plugins) !== null && _nextProps$dangerousl !== void 0 ? _nextProps$dangerousl : EMPTY;
6
+ if (nextPlugins.length !== prevPlugins.length || prevPlugins.some(function (p) {
7
+ return nextPlugins.some(function (n) {
8
+ return n.name === p.name && n !== p;
9
+ });
10
+ })) {
11
+ return true;
12
+ }
13
+ return shouldReconfigureState(props, nextProps);
14
+ }
15
+ function shouldReconfigureState(props, nextProps) {
16
+ var mobileProperties = props.appearance === 'mobile' ? ['quickInsert', 'featureFlags'] : [];
17
+ var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
18
+ return properties.reduce(function (acc, curr) {
19
+ return acc || props[curr] !== nextProps[curr];
20
+ }, false);
21
+ }
@@ -49,7 +49,7 @@ export function EditorInternalWithoutHooks(_ref) {
49
49
  providerFactory = _ref.providerFactory,
50
50
  onEditorCreated = _ref.onEditorCreated,
51
51
  onEditorDestroyed = _ref.onEditorDestroyed,
52
- getEditorPlugins = _ref.getEditorPlugins;
52
+ preset = _ref.preset;
53
53
  var Component = getUiComponent(props.appearance);
54
54
  var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
55
55
  onSave: props.onSave ? handleSave : undefined,
@@ -89,7 +89,7 @@ export function EditorInternalWithoutHooks(_ref) {
89
89
  onEditorDestroyed: onEditorDestroyed,
90
90
  allowAnalyticsGASV3: props.allowAnalyticsGASV3,
91
91
  disabled: props.disabled,
92
- getEditorPlugins: getEditorPlugins,
92
+ preset: preset,
93
93
  render: function render(_ref2) {
94
94
  var _props$featureFlags, _props$featureFlags2;
95
95
  var editor = _ref2.editor,
@@ -3,12 +3,23 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _extends from "@babel/runtime/helpers/extends";
6
7
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
7
8
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8
9
  import React from 'react';
10
+ import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
9
11
  import Editor from '../editor';
10
12
  import EditorNext from './index';
11
- import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
13
+ import useUniversalPreset from '../labs/next/presets/useUniversalPreset';
14
+ var EditorNextWrapper = function EditorNextWrapper(_ref) {
15
+ var props = _ref.props;
16
+ var preset = useUniversalPreset({
17
+ props: props
18
+ });
19
+ return /*#__PURE__*/React.createElement(EditorNext, _extends({
20
+ preset: preset
21
+ }, props));
22
+ };
12
23
  var EditorMigrationComponent = /*#__PURE__*/function (_React$Component) {
13
24
  _inherits(EditorMigrationComponent, _React$Component);
14
25
  var _super = _createSuper(EditorMigrationComponent);
@@ -20,7 +31,12 @@ var EditorMigrationComponent = /*#__PURE__*/function (_React$Component) {
20
31
  key: "render",
21
32
  value: function render() {
22
33
  var featureFlags = createFeatureFlagsFromProps(this.props);
23
- return featureFlags.useEditorNext ? /*#__PURE__*/React.createElement(EditorNext, this.props) : /*#__PURE__*/React.createElement(Editor, this.props);
34
+ if (!featureFlags.useEditorNext) {
35
+ return /*#__PURE__*/React.createElement(Editor, this.props);
36
+ }
37
+ return /*#__PURE__*/React.createElement(EditorNextWrapper, {
38
+ props: this.props
39
+ });
24
40
  }
25
41
  }]);
26
42
  return EditorMigrationComponent;
@@ -5,6 +5,7 @@ import { usePreviousState } from '@atlaskit/editor-common/hooks';
5
5
  import prepareQuickInsertProvider from '../../utils/prepare-quick-insert-provider';
6
6
  import prepareExtensionProvider from '../../utils/prepare-extension-provider';
7
7
  import handleProviders from '../utils/handleProviders';
8
+ import getProvidersFromEditorProps from '../utils/getProvidersFromEditorProps';
8
9
  function createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent) {
9
10
  var extensionProvider = prepareExtensionProvider(function () {
10
11
  return editorActions;
@@ -46,11 +47,11 @@ export default function useProviderFactory(props, editorActions, createAnalytics
46
47
  quickInsert && quickInsert !== (prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert)) {
47
48
  var newState = createNewState(editorActions, quickInsert, extensionProviders, createAnalyticsEvent);
48
49
  setProviderState(newState);
49
- handleProviders(providerFactory.current, props, newState.extensionProvider, newState.quickInsertProvider);
50
+ handleProviders(providerFactory.current, getProvidersFromEditorProps(props), newState.extensionProvider, newState.quickInsertProvider);
50
51
  return;
51
52
  }
52
- handleProviders(providerFactory.current, props, providerState.extensionProvider, providerState.quickInsertProvider);
53
- }, [props, prevProps, createAnalyticsEvent, editorActions, providerState.extensionProvider, providerState.quickInsertProvider, extensionProviders, quickInsert]);
53
+ handleProviders(providerFactory.current, getProvidersFromEditorProps(props), providerState.extensionProvider, providerState.quickInsertProvider);
54
+ }, [props, prevProps === null || prevProps === void 0 ? void 0 : prevProps.quickInsert, prevProps === null || prevProps === void 0 ? void 0 : prevProps.extensionProviders, createAnalyticsEvent, editorActions, providerState.extensionProvider, providerState.quickInsertProvider, extensionProviders, quickInsert]);
54
55
 
55
56
  // componentWillUnmount equivalent
56
57
  useEffect(function () {
@@ -5,6 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ 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; }
9
+ 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; }
8
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
12
  /** @jsx jsx */
@@ -24,7 +26,7 @@ import { defaultProps, propTypes } from './utils/editorPropTypes';
24
26
  import trackEditorActions from './utils/trackEditorActions';
25
27
  import _onEditorCreated from './utils/onEditorCreated';
26
28
  import deprecationWarnings from './utils/deprecationWarnings';
27
- import _getEditorPlugins from '../utils/get-editor-plugins';
29
+ import { basePlugin } from '../plugins';
28
30
  var EditorNext = /*#__PURE__*/function (_React$Component) {
29
31
  _inherits(EditorNext, _React$Component);
30
32
  var _super = _createSuper(EditorNext);
@@ -55,7 +57,6 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
55
57
  _this.onEditorCreated = _this.onEditorCreated.bind(_assertThisInitialized(_this));
56
58
  _this.onEditorDestroyed = _this.onEditorDestroyed.bind(_assertThisInitialized(_this));
57
59
  _this.getExperienceStore = _this.getExperienceStore.bind(_assertThisInitialized(_this));
58
- _this.getEditorPlugins = _this.getEditorPlugins.bind(_assertThisInitialized(_this));
59
60
  trackEditorActions(_this.editorActions, props.performanceTracking, function (value) {
60
61
  return _this.handleAnalyticsEvent(value);
61
62
  });
@@ -108,7 +109,7 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
108
109
  props: _this3.props,
109
110
  handleAnalyticsEvent: _this3.handleAnalyticsEvent,
110
111
  createAnalyticsEvent: _this3.createAnalyticsEvent,
111
- getEditorPlugins: _this3.getEditorPlugins,
112
+ preset: _this3.props.preset,
112
113
  handleSave: _this3.handleSave,
113
114
  editorActions: _this3.editorActions,
114
115
  getExperienceStore: _this3.getExperienceStore,
@@ -118,11 +119,6 @@ var EditorNext = /*#__PURE__*/function (_React$Component) {
118
119
  }
119
120
  }));
120
121
  }
121
- }, {
122
- key: "getEditorPlugins",
123
- value: function getEditorPlugins(props) {
124
- return _getEditorPlugins(props);
125
- }
126
122
  }]);
127
123
  return EditorNext;
128
124
  }(React.Component);
@@ -130,5 +126,13 @@ _defineProperty(EditorNext, "defaultProps", defaultProps);
130
126
  _defineProperty(EditorNext, "contextTypes", {
131
127
  editorActions: PropTypes.object
132
128
  });
133
- _defineProperty(EditorNext, "propTypes", propTypes('minHeight only supports editor appearance chromeless and comment for EditorNext'));
129
+ _defineProperty(EditorNext, "propTypes", _objectSpread(_objectSpread({}, propTypes('minHeight only supports editor appearance chromeless and comment for EditorNext')), {}, {
130
+ preset: function preset(_ref) {
131
+ var _preset = _ref.preset;
132
+ if (!_preset.has(basePlugin)) {
133
+ return new Error('Presets must contain the base plugin');
134
+ }
135
+ return null;
136
+ }
137
+ }));
134
138
  export { EditorNext as default };
@@ -0,0 +1,35 @@
1
+ export default function getProvidersFromEditorProps(_ref) {
2
+ var _linking$smartLinks;
3
+ var linking = _ref.linking,
4
+ smartLinks = _ref.smartLinks,
5
+ UNSAFE_cards = _ref.UNSAFE_cards,
6
+ autoformattingProvider = _ref.autoformattingProvider,
7
+ media = _ref.media,
8
+ emojiProvider = _ref.emojiProvider,
9
+ mentionProvider = _ref.mentionProvider,
10
+ legacyImageUploadProvider = _ref.legacyImageUploadProvider,
11
+ taskDecisionProvider = _ref.taskDecisionProvider,
12
+ contextIdentifierProvider = _ref.contextIdentifierProvider,
13
+ searchProvider = _ref.searchProvider,
14
+ macroProvider = _ref.macroProvider,
15
+ activityProvider = _ref.activityProvider,
16
+ collabEdit = _ref.collabEdit,
17
+ collabEditProvider = _ref.collabEditProvider,
18
+ presenceProvider = _ref.presenceProvider;
19
+ var cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
20
+ return {
21
+ mediaProvider: media === null || media === void 0 ? void 0 : media.provider,
22
+ emojiProvider: emojiProvider,
23
+ mentionProvider: mentionProvider,
24
+ autoformattingProvider: autoformattingProvider,
25
+ cardProvider: cardProvider,
26
+ activityProvider: activityProvider,
27
+ imageUploadProvider: legacyImageUploadProvider,
28
+ taskDecisionProvider: taskDecisionProvider,
29
+ contextIdentifierProvider: contextIdentifierProvider,
30
+ searchProvider: searchProvider,
31
+ presenceProvider: presenceProvider,
32
+ macroProvider: macroProvider,
33
+ collabEditProvider: collabEdit && collabEdit.provider ? collabEdit.provider : collabEditProvider
34
+ };
35
+ }
@@ -7,36 +7,31 @@
7
7
  * @param extensionProvider
8
8
  * @param quickInsertProvider
9
9
  */
10
- export default function handleProviders(providerFactory, props, extensionProvider, quickInsertProvider) {
11
- var _linking$smartLinks;
12
- var emojiProvider = props.emojiProvider,
13
- mentionProvider = props.mentionProvider,
14
- taskDecisionProvider = props.taskDecisionProvider,
15
- contextIdentifierProvider = props.contextIdentifierProvider,
16
- collabEditProvider = props.collabEditProvider,
17
- activityProvider = props.activityProvider,
18
- presenceProvider = props.presenceProvider,
19
- macroProvider = props.macroProvider,
20
- legacyImageUploadProvider = props.legacyImageUploadProvider,
21
- media = props.media,
22
- collabEdit = props.collabEdit,
23
- autoformattingProvider = props.autoformattingProvider,
24
- searchProvider = props.searchProvider,
25
- UNSAFE_cards = props.UNSAFE_cards,
26
- smartLinks = props.smartLinks,
27
- linking = props.linking;
10
+ export default function handleProviders(providerFactory, _ref, extensionProvider, quickInsertProvider) {
11
+ var emojiProvider = _ref.emojiProvider,
12
+ mentionProvider = _ref.mentionProvider,
13
+ taskDecisionProvider = _ref.taskDecisionProvider,
14
+ contextIdentifierProvider = _ref.contextIdentifierProvider,
15
+ collabEditProvider = _ref.collabEditProvider,
16
+ activityProvider = _ref.activityProvider,
17
+ presenceProvider = _ref.presenceProvider,
18
+ macroProvider = _ref.macroProvider,
19
+ imageUploadProvider = _ref.imageUploadProvider,
20
+ mediaProvider = _ref.mediaProvider,
21
+ autoformattingProvider = _ref.autoformattingProvider,
22
+ searchProvider = _ref.searchProvider,
23
+ cardProvider = _ref.cardProvider;
28
24
  providerFactory.setProvider('emojiProvider', emojiProvider);
29
25
  providerFactory.setProvider('mentionProvider', mentionProvider);
30
26
  providerFactory.setProvider('taskDecisionProvider', taskDecisionProvider);
31
27
  providerFactory.setProvider('contextIdentifierProvider', contextIdentifierProvider);
32
- providerFactory.setProvider('mediaProvider', media && media.provider);
33
- providerFactory.setProvider('imageUploadProvider', legacyImageUploadProvider);
34
- providerFactory.setProvider('collabEditProvider', collabEdit && collabEdit.provider ? collabEdit.provider : collabEditProvider);
28
+ providerFactory.setProvider('mediaProvider', mediaProvider);
29
+ providerFactory.setProvider('imageUploadProvider', imageUploadProvider);
30
+ providerFactory.setProvider('collabEditProvider', collabEditProvider);
35
31
  providerFactory.setProvider('activityProvider', activityProvider);
36
32
  providerFactory.setProvider('searchProvider', searchProvider);
37
33
  providerFactory.setProvider('presenceProvider', presenceProvider);
38
34
  providerFactory.setProvider('macroProvider', macroProvider);
39
- var cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
40
35
  if (cardProvider) {
41
36
  providerFactory.setProvider('cardProvider', cardProvider);
42
37
  }
@@ -27,12 +27,14 @@ import { fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
27
27
  import prepareQuickInsertProvider from './utils/prepare-quick-insert-provider';
28
28
  import prepareExtensionProvider from './utils/prepare-extension-provider';
29
29
  import handleProviders from './editor-next/utils/handleProviders';
30
+ import getProvidersFromEditorProps from './editor-next/utils/getProvidersFromEditorProps';
30
31
  import { startMeasure, clearMeasure, stopMeasure, measureTTI } from '@atlaskit/editor-common/utils';
31
32
  import measurements from './utils/performance/measure-enum';
32
33
  import editorMeasureTTICallback from './editor-next/utils/editorMeasureTTICallback';
33
34
  import { ACTION } from '@atlaskit/editor-common/analytics';
34
35
  import sendDurationAnalytics from './editor-next/utils/sendDurationAnalytics';
35
- import _getEditorPlugins from './utils/get-editor-plugins';
36
+ import { createPreset } from './create-editor/create-plugins-list';
37
+ import { shouldRecreatePreset } from './create-editor/preset-utils';
36
38
  var Editor = /*#__PURE__*/function (_React$Component) {
37
39
  _inherits(Editor, _React$Component);
38
40
  var _super = _createSuper(Editor);
@@ -70,7 +72,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
70
72
  _this.startTime = performance.now();
71
73
  _this.onEditorCreated = _this.onEditorCreated.bind(_assertThisInitialized(_this));
72
74
  _this.onEditorDestroyed = _this.onEditorDestroyed.bind(_assertThisInitialized(_this));
73
- _this.getEditorPlugins = _this.getEditorPlugins.bind(_assertThisInitialized(_this));
74
75
  _this.getExperienceStore = _this.getExperienceStore.bind(_assertThisInitialized(_this));
75
76
  _this.trackEditorActions(_this.editorActions, props);
76
77
 
@@ -92,9 +93,11 @@ var Editor = /*#__PURE__*/function (_React$Component) {
92
93
  */
93
94
  var _extensionProvider = _this.prepareExtensionProvider(props.extensionProviders);
94
95
  var quickInsertProvider = _this.prepareQuickInsertProvider(_extensionProvider, props.quickInsert);
96
+ var preset = createPreset(props, undefined, _this.createAnalyticsEvent);
95
97
  _this.state = {
96
98
  extensionProvider: _extensionProvider,
97
- quickInsertProvider: quickInsertProvider
99
+ quickInsertProvider: quickInsertProvider,
100
+ preset: preset
98
101
  };
99
102
  return _this;
100
103
  }
@@ -108,7 +111,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
108
111
  key: "componentDidMount",
109
112
  value: function componentDidMount() {
110
113
  stopMeasure(measurements.EDITOR_MOUNTED, sendDurationAnalytics(ACTION.EDITOR_MOUNTED, this.props, this.getExperienceStore, this.createAnalyticsEvent));
111
- handleProviders(this.providerFactory, this.props, this.state.extensionProvider, this.state.quickInsertProvider);
114
+ handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
112
115
  }
113
116
 
114
117
  /**
@@ -119,6 +122,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
119
122
  key: "componentDidUpdate",
120
123
  value: function componentDidUpdate(prevProps) {
121
124
  var _this2 = this;
125
+ var needsANewPreset = shouldRecreatePreset(prevProps, this.props);
126
+ var preset = needsANewPreset ? createPreset(this.props, prevProps, this.createAnalyticsEvent) : this.state.preset;
122
127
  var _this$props2 = this.props,
123
128
  extensionProviders = _this$props2.extensionProviders,
124
129
  quickInsert = _this$props2.quickInsert;
@@ -131,13 +136,20 @@ var Editor = /*#__PURE__*/function (_React$Component) {
131
136
  var quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
132
137
  this.setState({
133
138
  extensionProvider: extensionProvider,
134
- quickInsertProvider: quickInsertProvider
139
+ quickInsertProvider: quickInsertProvider,
140
+ preset: preset
135
141
  }, function () {
136
- return handleProviders(_this2.providerFactory, _this2.props, _this2.state.extensionProvider, _this2.state.quickInsertProvider);
142
+ return handleProviders(_this2.providerFactory, getProvidersFromEditorProps(_this2.props), _this2.state.extensionProvider, _this2.state.quickInsertProvider);
137
143
  });
138
144
  return;
139
145
  }
140
- handleProviders(this.providerFactory, this.props, this.state.extensionProvider, this.state.quickInsertProvider);
146
+ if (needsANewPreset) {
147
+ this.setState({
148
+ preset: preset
149
+ });
150
+ return;
151
+ }
152
+ handleProviders(this.providerFactory, getProvidersFromEditorProps(this.props), this.state.extensionProvider, this.state.quickInsertProvider);
141
153
  }
142
154
 
143
155
  /**
@@ -264,7 +276,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
264
276
  props: _this5.props,
265
277
  handleAnalyticsEvent: _this5.handleAnalyticsEvent,
266
278
  createAnalyticsEvent: _this5.createAnalyticsEvent,
267
- getEditorPlugins: _this5.getEditorPlugins,
279
+ preset: _this5.state.preset,
268
280
  handleSave: _this5.handleSave,
269
281
  editorActions: _this5.editorActions,
270
282
  providerFactory: _this5.providerFactory,
@@ -274,11 +286,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
274
286
  }
275
287
  }));
276
288
  }
277
- }, {
278
- key: "getEditorPlugins",
279
- value: function getEditorPlugins(props) {
280
- return _getEditorPlugins(props);
281
- }
282
289
  }]);
283
290
  return Editor;
284
291
  }(React.Component);
@@ -1,12 +1,8 @@
1
- export var LEFT = 37;
2
- export var RIGHT = 39;
3
- export var UP = 38;
4
- export var DOWN = 40;
5
- export var KEY_0 = 48;
6
- export var KEY_1 = 49;
7
- export var KEY_2 = 50;
8
- export var KEY_3 = 51;
9
- export var KEY_4 = 52;
10
- export var KEY_5 = 53;
11
- export var KEY_6 = 54;
1
+ var KEY_0 = 48;
2
+ var KEY_1 = 49;
3
+ var KEY_2 = 50;
4
+ var KEY_3 = 51;
5
+ var KEY_4 = 52;
6
+ var KEY_5 = 53;
7
+ var KEY_6 = 54;
12
8
  export var HEADING_KEYS = [KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6];