@atlaskit/editor-core 187.31.7 → 187.32.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 (210) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -1
  3. package/dist/cjs/plugins/analytics/plugin.js +14 -12
  4. package/dist/cjs/plugins/annotation/index.js +15 -13
  5. package/dist/cjs/plugins/avatar-group/index.js +16 -14
  6. package/dist/cjs/plugins/base/plugin.js +12 -10
  7. package/dist/cjs/plugins/before-primaryToolbar/index.js +3 -2
  8. package/dist/cjs/plugins/block-type/index.js +32 -30
  9. package/dist/cjs/plugins/breakout/index.js +10 -8
  10. package/dist/cjs/plugins/caption/index.js +7 -6
  11. package/dist/cjs/plugins/caption/pm-plugins/main.js +2 -2
  12. package/dist/cjs/plugins/code-bidi-warning/index.js +2 -4
  13. package/dist/cjs/plugins/code-block/index.js +14 -11
  14. package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -2
  15. package/dist/cjs/plugins/collab-edit/index.js +16 -14
  16. package/dist/cjs/plugins/collab-edit/plugin.js +5 -5
  17. package/dist/cjs/plugins/date/index.js +18 -17
  18. package/dist/cjs/plugins/emoji/index.js +35 -33
  19. package/dist/cjs/plugins/expand/index.js +14 -13
  20. package/dist/cjs/plugins/extension/index.js +16 -15
  21. package/dist/cjs/plugins/extension/pm-plugins/main.js +4 -4
  22. package/dist/cjs/plugins/feedback-dialog/index.js +5 -4
  23. package/dist/cjs/plugins/find-replace/index.js +17 -15
  24. package/dist/cjs/plugins/floating-toolbar/index.js +31 -30
  25. package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -24
  26. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +5 -5
  27. package/dist/cjs/plugins/help-dialog/index.js +18 -17
  28. package/dist/cjs/plugins/insert-block/index.js +52 -51
  29. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
  30. package/dist/cjs/plugins/layout/index.js +15 -14
  31. package/dist/cjs/plugins/max-content-size/index.js +4 -3
  32. package/dist/cjs/plugins/media/index.js +49 -47
  33. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  34. package/dist/cjs/plugins/media/pm-plugins/main.js +7 -7
  35. package/dist/cjs/plugins/media/toolbar/index.js +29 -24
  36. package/dist/cjs/plugins/media/toolbar/linking.js +4 -4
  37. package/dist/cjs/plugins/media/toolbar/utils.js +22 -2
  38. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
  39. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  40. package/dist/cjs/plugins/media/utils/media-single.js +19 -4
  41. package/dist/cjs/plugins/mentions/index.js +17 -15
  42. package/dist/cjs/plugins/panel/index.js +13 -12
  43. package/dist/cjs/plugins/paste/index.js +13 -10
  44. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +8 -8
  45. package/dist/cjs/plugins/paste/pm-plugins/main.js +10 -10
  46. package/dist/cjs/plugins/placeholder/index.js +9 -7
  47. package/dist/cjs/plugins/placeholder-text/index.js +23 -16
  48. package/dist/cjs/plugins/quick-insert/index.js +13 -12
  49. package/dist/cjs/plugins/rule/index.js +8 -7
  50. package/dist/cjs/plugins/save-on-enter/index.js +4 -3
  51. package/dist/cjs/plugins/selection/index.js +5 -4
  52. package/dist/cjs/plugins/status/index.js +20 -14
  53. package/dist/cjs/plugins/submit-editor/index.js +4 -3
  54. package/dist/cjs/plugins/tasks-and-decisions/index.js +6 -5
  55. package/dist/cjs/plugins/text-color/index.js +17 -15
  56. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +31 -26
  57. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  58. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
  59. package/dist/cjs/plugins/type-ahead/index.js +21 -20
  60. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +11 -11
  61. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
  62. package/dist/cjs/use-preset.js +2 -2
  63. package/dist/cjs/version-wrapper.js +1 -1
  64. package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
  65. package/dist/es2019/plugins/analytics/plugin.js +11 -8
  66. package/dist/es2019/plugins/annotation/index.js +4 -1
  67. package/dist/es2019/plugins/avatar-group/index.js +8 -5
  68. package/dist/es2019/plugins/base/plugin.js +6 -3
  69. package/dist/es2019/plugins/before-primaryToolbar/index.js +4 -2
  70. package/dist/es2019/plugins/block-type/index.js +14 -11
  71. package/dist/es2019/plugins/breakout/index.js +6 -3
  72. package/dist/es2019/plugins/caption/index.js +3 -1
  73. package/dist/es2019/plugins/caption/pm-plugins/main.js +2 -2
  74. package/dist/es2019/plugins/code-bidi-warning/index.js +2 -4
  75. package/dist/es2019/plugins/code-block/index.js +15 -9
  76. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -2
  77. package/dist/es2019/plugins/collab-edit/index.js +9 -6
  78. package/dist/es2019/plugins/collab-edit/plugin.js +5 -5
  79. package/dist/es2019/plugins/date/index.js +6 -3
  80. package/dist/es2019/plugins/emoji/index.js +16 -13
  81. package/dist/es2019/plugins/expand/index.js +7 -4
  82. package/dist/es2019/plugins/extension/index.js +11 -8
  83. package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
  84. package/dist/es2019/plugins/feedback-dialog/index.js +4 -2
  85. package/dist/es2019/plugins/find-replace/index.js +8 -5
  86. package/dist/es2019/plugins/floating-toolbar/index.js +6 -4
  87. package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +9 -4
  88. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
  89. package/dist/es2019/plugins/help-dialog/index.js +9 -6
  90. package/dist/es2019/plugins/insert-block/index.js +12 -9
  91. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
  92. package/dist/es2019/plugins/layout/index.js +8 -5
  93. package/dist/es2019/plugins/max-content-size/index.js +3 -1
  94. package/dist/es2019/plugins/media/index.js +14 -10
  95. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
  96. package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
  97. package/dist/es2019/plugins/media/toolbar/index.js +29 -25
  98. package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
  99. package/dist/es2019/plugins/media/toolbar/utils.js +18 -0
  100. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
  101. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  102. package/dist/es2019/plugins/media/utils/media-single.js +22 -4
  103. package/dist/es2019/plugins/mentions/index.js +9 -6
  104. package/dist/es2019/plugins/panel/index.js +5 -2
  105. package/dist/es2019/plugins/paste/index.js +9 -5
  106. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +8 -8
  107. package/dist/es2019/plugins/paste/pm-plugins/main.js +10 -10
  108. package/dist/es2019/plugins/placeholder/index.js +10 -7
  109. package/dist/es2019/plugins/placeholder-text/index.js +12 -4
  110. package/dist/es2019/plugins/quick-insert/index.js +3 -1
  111. package/dist/es2019/plugins/rule/index.js +5 -3
  112. package/dist/es2019/plugins/save-on-enter/index.js +3 -1
  113. package/dist/es2019/plugins/selection/index.js +3 -1
  114. package/dist/es2019/plugins/status/index.js +11 -3
  115. package/dist/es2019/plugins/submit-editor/index.js +3 -1
  116. package/dist/es2019/plugins/tasks-and-decisions/index.js +6 -4
  117. package/dist/es2019/plugins/text-color/index.js +6 -3
  118. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +9 -5
  119. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  120. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
  121. package/dist/es2019/plugins/type-ahead/index.js +3 -1
  122. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +11 -11
  123. package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
  124. package/dist/es2019/use-preset.js +2 -2
  125. package/dist/es2019/version-wrapper.js +1 -1
  126. package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
  127. package/dist/esm/plugins/analytics/plugin.js +14 -12
  128. package/dist/esm/plugins/annotation/index.js +15 -13
  129. package/dist/esm/plugins/avatar-group/index.js +16 -14
  130. package/dist/esm/plugins/base/plugin.js +12 -10
  131. package/dist/esm/plugins/before-primaryToolbar/index.js +3 -2
  132. package/dist/esm/plugins/block-type/index.js +32 -30
  133. package/dist/esm/plugins/breakout/index.js +10 -8
  134. package/dist/esm/plugins/caption/index.js +7 -6
  135. package/dist/esm/plugins/caption/pm-plugins/main.js +2 -2
  136. package/dist/esm/plugins/code-bidi-warning/index.js +2 -4
  137. package/dist/esm/plugins/code-block/index.js +14 -11
  138. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -2
  139. package/dist/esm/plugins/collab-edit/index.js +16 -14
  140. package/dist/esm/plugins/collab-edit/plugin.js +5 -5
  141. package/dist/esm/plugins/date/index.js +18 -17
  142. package/dist/esm/plugins/emoji/index.js +35 -33
  143. package/dist/esm/plugins/expand/index.js +14 -13
  144. package/dist/esm/plugins/extension/index.js +16 -15
  145. package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
  146. package/dist/esm/plugins/feedback-dialog/index.js +5 -4
  147. package/dist/esm/plugins/find-replace/index.js +17 -15
  148. package/dist/esm/plugins/floating-toolbar/index.js +31 -30
  149. package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +28 -23
  150. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +4 -4
  151. package/dist/esm/plugins/help-dialog/index.js +18 -17
  152. package/dist/esm/plugins/insert-block/index.js +52 -51
  153. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
  154. package/dist/esm/plugins/layout/index.js +15 -14
  155. package/dist/esm/plugins/max-content-size/index.js +4 -3
  156. package/dist/esm/plugins/media/index.js +49 -47
  157. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
  158. package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
  159. package/dist/esm/plugins/media/toolbar/index.js +30 -25
  160. package/dist/esm/plugins/media/toolbar/linking.js +4 -4
  161. package/dist/esm/plugins/media/toolbar/utils.js +19 -0
  162. package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
  163. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  164. package/dist/esm/plugins/media/utils/media-single.js +19 -4
  165. package/dist/esm/plugins/mentions/index.js +17 -15
  166. package/dist/esm/plugins/panel/index.js +13 -12
  167. package/dist/esm/plugins/paste/index.js +13 -10
  168. package/dist/esm/plugins/paste/pm-plugins/analytics.js +8 -8
  169. package/dist/esm/plugins/paste/pm-plugins/main.js +10 -10
  170. package/dist/esm/plugins/placeholder/index.js +9 -7
  171. package/dist/esm/plugins/placeholder-text/index.js +23 -16
  172. package/dist/esm/plugins/quick-insert/index.js +13 -12
  173. package/dist/esm/plugins/rule/index.js +8 -7
  174. package/dist/esm/plugins/save-on-enter/index.js +4 -3
  175. package/dist/esm/plugins/selection/index.js +5 -4
  176. package/dist/esm/plugins/status/index.js +20 -14
  177. package/dist/esm/plugins/submit-editor/index.js +4 -3
  178. package/dist/esm/plugins/tasks-and-decisions/index.js +6 -5
  179. package/dist/esm/plugins/text-color/index.js +17 -15
  180. package/dist/esm/plugins/toolbar-lists-indentation/index.js +31 -26
  181. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  182. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
  183. package/dist/esm/plugins/type-ahead/index.js +21 -20
  184. package/dist/esm/ui/ElementBrowser/InsertMenu.js +11 -11
  185. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  186. package/dist/esm/use-preset.js +2 -2
  187. package/dist/esm/version-wrapper.js +1 -1
  188. package/dist/types/labs/next/presets/default.d.ts +62 -618
  189. package/dist/types/plugins/avatar-group/index.d.ts +1 -1
  190. package/dist/types/plugins/before-primaryToolbar/index.d.ts +1 -1
  191. package/dist/types/plugins/caption/index.d.ts +1 -1
  192. package/dist/types/plugins/floating-toolbar/ui/ScrollButtons.d.ts +3 -3
  193. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -2
  194. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -1
  195. package/dist/types/plugins/media/types.d.ts +1 -0
  196. package/dist/types/plugins/selection/index.d.ts +2 -2
  197. package/dist/types/plugins/text-color/index.d.ts +3 -2
  198. package/dist/types/use-preset.d.ts +2 -2
  199. package/dist/types-ts4.5/labs/next/presets/default.d.ts +96 -716
  200. package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
  201. package/dist/types-ts4.5/plugins/before-primaryToolbar/index.d.ts +1 -1
  202. package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
  203. package/dist/types-ts4.5/plugins/floating-toolbar/ui/ScrollButtons.d.ts +3 -3
  204. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -2
  205. package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -1
  206. package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
  207. package/dist/types-ts4.5/plugins/selection/index.d.ts +2 -2
  208. package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -2
  209. package/dist/types-ts4.5/use-preset.d.ts +2 -2
  210. package/package.json +3 -3
@@ -110,7 +110,8 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
110
110
  function filterUndefined(x) {
111
111
  return !!x;
112
112
  }
113
- var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
113
+ var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
114
+ var api = _ref.api;
114
115
  return {
115
116
  name: 'floatingToolbar',
116
117
  pmPlugins: function pmPlugins() {
@@ -118,10 +119,10 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
118
119
  return [{
119
120
  // Should be after all toolbar plugins
120
121
  name: 'floatingToolbar',
121
- plugin: function plugin(_ref) {
122
- var dispatch = _ref.dispatch,
123
- providerFactory = _ref.providerFactory,
124
- getIntl = _ref.getIntl;
122
+ plugin: function plugin(_ref2) {
123
+ var dispatch = _ref2.dispatch,
124
+ providerFactory = _ref2.providerFactory,
125
+ getIntl = _ref2.getIntl;
125
126
  return floatingToolbarPluginFactory({
126
127
  floatingToolbarHandlers: floatingToolbarHandlers,
127
128
  dispatch: dispatch,
@@ -131,8 +132,8 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
131
132
  }
132
133
  }, {
133
134
  name: 'floatingToolbarData',
134
- plugin: function plugin(_ref2) {
135
- var dispatch = _ref2.dispatch;
135
+ plugin: function plugin(_ref3) {
136
+ var dispatch = _ref3.dispatch;
136
137
  return floatingToolbarDataPluginFactory(dispatch);
137
138
  }
138
139
  }, {
@@ -156,13 +157,13 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
156
157
  floatingToolbarData: dataPluginKey.getState(editorState)
157
158
  };
158
159
  },
159
- contentComponent: function contentComponent(_ref3) {
160
- var popupsMountPoint = _ref3.popupsMountPoint,
161
- popupsBoundariesElement = _ref3.popupsBoundariesElement,
162
- popupsScrollableElement = _ref3.popupsScrollableElement,
163
- editorView = _ref3.editorView,
164
- providerFactory = _ref3.providerFactory,
165
- dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
160
+ contentComponent: function contentComponent(_ref4) {
161
+ var popupsMountPoint = _ref4.popupsMountPoint,
162
+ popupsBoundariesElement = _ref4.popupsBoundariesElement,
163
+ popupsScrollableElement = _ref4.popupsScrollableElement,
164
+ editorView = _ref4.editorView,
165
+ providerFactory = _ref4.providerFactory,
166
+ dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
166
167
  return /*#__PURE__*/React.createElement(ContentComponent, {
167
168
  editorView: editorView,
168
169
  pluginInjectionApi: api,
@@ -176,22 +177,22 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
176
177
  };
177
178
  };
178
179
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
179
- function ContentComponent(_ref4) {
180
- var _pluginInjectionApi$d, _pluginInjectionApi$d2, _configWithNodeInfo$c, _configWithNodeInfo$c2;
181
- var pluginInjectionApi = _ref4.pluginInjectionApi,
182
- editorView = _ref4.editorView,
183
- popupsMountPoint = _ref4.popupsMountPoint,
184
- popupsBoundariesElement = _ref4.popupsBoundariesElement,
185
- popupsScrollableElement = _ref4.popupsScrollableElement,
186
- providerFactory = _ref4.providerFactory,
187
- dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
188
- var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.featureFlags) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.sharedState.currentState()) || {};
180
+ function ContentComponent(_ref5) {
181
+ var _pluginInjectionApi$f, _configWithNodeInfo$c, _configWithNodeInfo$c2;
182
+ var pluginInjectionApi = _ref5.pluginInjectionApi,
183
+ editorView = _ref5.editorView,
184
+ popupsMountPoint = _ref5.popupsMountPoint,
185
+ popupsBoundariesElement = _ref5.popupsBoundariesElement,
186
+ popupsScrollableElement = _ref5.popupsScrollableElement,
187
+ providerFactory = _ref5.providerFactory,
188
+ dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
189
+ var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.featureFlags) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.sharedState.currentState()) || {};
189
190
  var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled']),
190
191
  floatingToolbarState = _useSharedPluginState.floatingToolbarState,
191
192
  editorDisabledState = _useSharedPluginState.editorDisabledState;
192
- var _ref5 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
193
- configWithNodeInfo = _ref5.configWithNodeInfo,
194
- floatingToolbarData = _ref5.floatingToolbarData;
193
+ var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
194
+ configWithNodeInfo = _ref6.configWithNodeInfo,
195
+ floatingToolbarData = _ref6.floatingToolbarData;
195
196
  if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
196
197
  return null;
197
198
  }
@@ -219,7 +220,7 @@ function ContentComponent(_ref4) {
219
220
  return null;
220
221
  }
221
222
  var customPositionCalculation;
222
- var toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions.hoverDecoration);
223
+ var toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.decorations.actions.hoverDecoration);
223
224
  if (onPositionCalculated) {
224
225
  customPositionCalculation = function customPositionCalculation(nextPos) {
225
226
  return onPositionCalculated(editorView, nextPos);
@@ -230,8 +231,8 @@ function ContentComponent(_ref4) {
230
231
  };
231
232
 
232
233
  // Confirm dialog
233
- var _ref6 = floatingToolbarData || {},
234
- confirmDialogForItem = _ref6.confirmDialogForItem;
234
+ var _ref7 = floatingToolbarData || {},
235
+ confirmDialogForItem = _ref7.confirmDialogForItem;
235
236
  var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
236
237
  var scrollable = featureFlags.floatingToolbarCopyButton && config.scrollable;
237
238
  var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
@@ -13,7 +13,7 @@ import rafSchedule from 'raf-schd';
13
13
  var toolbarScrollButtons = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: ", ";\n padding: ", " ", ";\n border-left: solid ", " 1px;\n flex-shrink: 0;\n align-items: center;\n"])), "var(--ds-space-050, 4px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(N30, ")"));
14
14
  var LeftIcon = ChevronLeftLargeIcon;
15
15
  var RightIcon = ChevronRightLargeIcon;
16
- export default (function (_ref) {
16
+ export var ScrollButtons = function ScrollButtons(_ref) {
17
17
  var intl = _ref.intl,
18
18
  scrollContainerRef = _ref.scrollContainerRef,
19
19
  node = _ref.node,
@@ -31,52 +31,56 @@ export default (function (_ref) {
31
31
  _useState6 = _slicedToArray(_useState5, 2),
32
32
  canScrollRight = _useState6[0],
33
33
  setCanScrollRight = _useState6[1];
34
- var scheduledSetCanScroll = rafSchedule(function () {
35
- var _ref2 = scrollContainerRef.current,
36
- scrollLeft = _ref2.scrollLeft,
37
- scrollWidth = _ref2.scrollWidth,
38
- offsetWidth = _ref2.offsetWidth;
34
+ var setCanScrollDebounced = rafSchedule(function () {
35
+ // Refs are null before mounting and after unmount
36
+ if (!scrollContainerRef.current) {
37
+ return;
38
+ }
39
+ var _scrollContainerRef$c = scrollContainerRef.current,
40
+ scrollLeft = _scrollContainerRef$c.scrollLeft,
41
+ scrollWidth = _scrollContainerRef$c.scrollWidth,
42
+ offsetWidth = _scrollContainerRef$c.offsetWidth;
39
43
  setCanScrollLeft(scrollLeft > 0);
40
44
  setCanScrollRight(scrollLeft + offsetWidth < scrollWidth - 1); // -1 to account for half pixel
41
45
  });
42
46
 
43
47
  var onScroll = function onScroll() {
44
- return scheduledSetCanScroll();
48
+ return setCanScrollDebounced();
45
49
  };
46
50
  var scrollLeft = function scrollLeft() {
47
- var _scrollContainerRef$c, _scrollContainerRef$c2, _scrollContainerRef$c3;
48
- var _ref3 = ((_scrollContainerRef$c = scrollContainerRef.current) === null || _scrollContainerRef$c === void 0 ? void 0 : _scrollContainerRef$c.getBoundingClientRect()) || {},
49
- _ref3$width = _ref3.width,
50
- scrollContainerWidth = _ref3$width === void 0 ? 0 : _ref3$width;
51
- var scrollLeft = ((_scrollContainerRef$c2 = scrollContainerRef.current) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.scrollLeft) || 0;
51
+ var _scrollContainerRef$c2, _scrollContainerRef$c3, _scrollContainerRef$c4;
52
+ var _ref2 = ((_scrollContainerRef$c2 = scrollContainerRef.current) === null || _scrollContainerRef$c2 === void 0 ? void 0 : _scrollContainerRef$c2.getBoundingClientRect()) || {},
53
+ _ref2$width = _ref2.width,
54
+ scrollContainerWidth = _ref2$width === void 0 ? 0 : _ref2$width;
55
+ var scrollLeft = ((_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.scrollLeft) || 0;
52
56
 
53
57
  // scroll to current position - scroll container width
54
58
  var scrollTo = scrollLeft - scrollContainerWidth;
55
- (_scrollContainerRef$c3 = scrollContainerRef.current) === null || _scrollContainerRef$c3 === void 0 ? void 0 : _scrollContainerRef$c3.scrollTo({
59
+ (_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.scrollTo({
56
60
  top: 0,
57
61
  left: scrollTo,
58
62
  behavior: 'smooth'
59
63
  });
60
64
  };
61
65
  var scrollRight = function scrollRight() {
62
- var _scrollContainerRef$c4, _scrollContainerRef$c5, _scrollContainerRef$c6;
63
- var _ref4 = ((_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 ? void 0 : _scrollContainerRef$c4.getBoundingClientRect()) || {},
64
- _ref4$width = _ref4.width,
65
- scrollContainerWidth = _ref4$width === void 0 ? 0 : _ref4$width;
66
- var scrollLeft = ((_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.scrollLeft) || 0;
66
+ var _scrollContainerRef$c5, _scrollContainerRef$c6, _scrollContainerRef$c7;
67
+ var _ref3 = ((_scrollContainerRef$c5 = scrollContainerRef.current) === null || _scrollContainerRef$c5 === void 0 ? void 0 : _scrollContainerRef$c5.getBoundingClientRect()) || {},
68
+ _ref3$width = _ref3.width,
69
+ scrollContainerWidth = _ref3$width === void 0 ? 0 : _ref3$width;
70
+ var scrollLeft = ((_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.scrollLeft) || 0;
67
71
 
68
72
  // scroll to current position + scroll container width
69
73
  var scrollTo = scrollLeft + scrollContainerWidth;
70
- (_scrollContainerRef$c6 = scrollContainerRef.current) === null || _scrollContainerRef$c6 === void 0 ? void 0 : _scrollContainerRef$c6.scrollTo({
74
+ (_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 ? void 0 : _scrollContainerRef$c7.scrollTo({
71
75
  top: 0,
72
76
  left: scrollTo,
73
77
  behavior: 'smooth'
74
78
  });
75
79
  };
76
80
  var resizeObserver = new ResizeObserver(function (t) {
77
- var _scrollContainerRef$c7, _scrollContainerRef$c8, _scrollContainerRef$c9;
78
- var widthNeededToShowAllItems = ((_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 ? void 0 : _scrollContainerRef$c7.scrollWidth) || 0;
79
- var availableSpace = (_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : (_scrollContainerRef$c9 = _scrollContainerRef$c8.parentNode) === null || _scrollContainerRef$c9 === void 0 ? void 0 : _scrollContainerRef$c9.offsetWidth;
81
+ var _scrollContainerRef$c8, _scrollContainerRef$c9, _scrollContainerRef$c10;
82
+ var widthNeededToShowAllItems = ((_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : _scrollContainerRef$c8.scrollWidth) || 0;
83
+ var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0 ? void 0 : (_scrollContainerRef$c10 = _scrollContainerRef$c9.parentNode) === null || _scrollContainerRef$c10 === void 0 ? void 0 : _scrollContainerRef$c10.offsetWidth;
80
84
  if (availableSpace >= widthNeededToShowAllItems) {
81
85
  setNeedScroll(false);
82
86
  } else {
@@ -99,6 +103,7 @@ export default (function (_ref) {
99
103
  scrollContainerRefCurrent.removeEventListener('scroll', onScroll);
100
104
  resizeObserver.unobserve(scrollContainerRefCurrent);
101
105
  }
106
+ setCanScrollDebounced.cancel();
102
107
  };
103
108
  // eslint-disable-next-line react-hooks/exhaustive-deps
104
109
  }, []);
@@ -131,4 +136,4 @@ export default (function (_ref) {
131
136
  onClick: scrollRight,
132
137
  disabled: !canScrollRight || disabled
133
138
  })) : null;
134
- });
139
+ };
@@ -32,7 +32,7 @@ import { EmojiPickerButton } from './EmojiPickerButton';
32
32
  import { injectIntl } from 'react-intl-next';
33
33
  import messages from './messages';
34
34
  import { clearHoverSelection } from '@atlaskit/editor-plugin-table/commands';
35
- import ScrollButtons from './ScrollButtons';
35
+ import { ScrollButtons } from './ScrollButtons';
36
36
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
37
37
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
38
38
  var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
@@ -59,7 +59,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
59
59
  return jsx(ButtonGroup, null, items.filter(function (item) {
60
60
  return !item.hidden;
61
61
  }).map(function (item, idx) {
62
- var _api$dependencies$con;
62
+ var _api$contextPanel;
63
63
  switch (item.type) {
64
64
  case 'button':
65
65
  var ButtonIcon = item.icon;
@@ -231,7 +231,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
231
231
  editorView: editorView,
232
232
  extensionProvider: extensionsProvider,
233
233
  separator: item.separator,
234
- applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$dependencies$con = api.dependencies.contextPanel) === null || _api$dependencies$con === void 0 ? void 0 : _api$dependencies$con.actions.applyChange
234
+ applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange
235
235
  });
236
236
  case 'separator':
237
237
  return jsx(Separator, {
@@ -374,7 +374,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
374
374
  if (table) {
375
375
  return clearHoverSelection()(state, dispatch);
376
376
  }
377
- (_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.dependencies.decorations.actions.removeDecoration(state, dispatch);
377
+ (_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.decorations.actions.removeDecoration(state, dispatch);
378
378
  }
379
379
  }
380
380
  }, {
@@ -37,29 +37,30 @@ export function createPlugin(dispatch, imageEnabled) {
37
37
  }
38
38
  });
39
39
  }
40
- var helpDialog = function helpDialog() {
41
- var imageUploadProviderExists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
42
- var api = arguments.length > 1 ? arguments[1] : undefined;
40
+ var helpDialog = function helpDialog(_ref) {
41
+ var _ref$config = _ref.config,
42
+ imageUploadProviderExists = _ref$config === void 0 ? false : _ref$config,
43
+ api = _ref.api;
43
44
  return {
44
45
  name: 'helpDialog',
45
46
  pmPlugins: function pmPlugins() {
46
47
  return [{
47
48
  name: 'helpDialog',
48
- plugin: function plugin(_ref) {
49
- var dispatch = _ref.dispatch;
49
+ plugin: function plugin(_ref2) {
50
+ var dispatch = _ref2.dispatch;
50
51
  return createPlugin(dispatch, imageUploadProviderExists);
51
52
  }
52
53
  }, {
53
54
  name: 'helpDialogKeymap',
54
55
  plugin: function plugin() {
55
- var _api$dependencies$ana;
56
- return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions);
56
+ var _api$analytics;
57
+ return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
57
58
  }
58
59
  }];
59
60
  },
60
61
  pluginsOptions: {
61
- quickInsert: function quickInsert(_ref2) {
62
- var formatMessage = _ref2.formatMessage;
62
+ quickInsert: function quickInsert(_ref3) {
63
+ var formatMessage = _ref3.formatMessage;
63
64
  return [{
64
65
  id: 'helpdialog',
65
66
  title: formatMessage(messages.help),
@@ -73,10 +74,10 @@ var helpDialog = function helpDialog() {
73
74
  });
74
75
  },
75
76
  action: function action(insert) {
76
- var _api$dependencies$ana2;
77
+ var _api$analytics2;
77
78
  var tr = insert('');
78
79
  openHelpCommand(tr);
79
- api === null || api === void 0 ? void 0 : (_api$dependencies$ana2 = api.dependencies.analytics) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.actions.attachAnalyticsEvent({
80
+ api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
80
81
  action: ACTION.HELP_OPENED,
81
82
  actionSubject: ACTION_SUBJECT.HELP,
82
83
  actionSubjectId: ACTION_SUBJECT_ID.HELP_QUICK_INSERT,
@@ -90,19 +91,19 @@ var helpDialog = function helpDialog() {
90
91
  }];
91
92
  }
92
93
  },
93
- contentComponent: function contentComponent(_ref3) {
94
- var editorView = _ref3.editorView;
94
+ contentComponent: function contentComponent(_ref4) {
95
+ var editorView = _ref4.editorView;
95
96
  return /*#__PURE__*/React.createElement(WithPluginState, {
96
97
  plugins: {
97
98
  helpDialog: pluginKey
98
99
  },
99
- render: function render(_ref4) {
100
- var _ref4$helpDialog = _ref4.helpDialog,
101
- helpDialog = _ref4$helpDialog === void 0 ? {} : _ref4$helpDialog;
100
+ render: function render(_ref5) {
101
+ var _ref5$helpDialog = _ref5.helpDialog,
102
+ helpDialog = _ref5$helpDialog === void 0 ? {} : _ref5$helpDialog;
102
103
  return /*#__PURE__*/React.createElement(HelpDialogLoader, {
103
104
  editorView: editorView,
104
105
  isVisible: helpDialog.isVisible,
105
- quickInsertEnabled: !!(api !== null && api !== void 0 && api.dependencies.quickInsert),
106
+ quickInsertEnabled: !!(api !== null && api !== void 0 && api.quickInsert),
106
107
  imageEnabled: helpDialog.imageEnabled
107
108
  });
108
109
  }
@@ -27,25 +27,26 @@ var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
27
27
  return 0;
28
28
  }
29
29
  };
30
- var insertBlockPlugin = function insertBlockPlugin() {
31
- var _api$dependencies, _api$dependencies$fea;
32
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33
- var api = arguments.length > 1 ? arguments[1] : undefined;
34
- var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
30
+ var insertBlockPlugin = function insertBlockPlugin(_ref) {
31
+ var _api$featureFlags;
32
+ var _ref$config = _ref.config,
33
+ options = _ref$config === void 0 ? {} : _ref$config,
34
+ api = _ref.api;
35
+ var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
35
36
  return {
36
37
  name: 'insertBlock',
37
- primaryToolbarComponent: function primaryToolbarComponent(_ref) {
38
- var editorView = _ref.editorView,
39
- editorActions = _ref.editorActions,
40
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
41
- providerFactory = _ref.providerFactory,
42
- popupsMountPoint = _ref.popupsMountPoint,
43
- popupsBoundariesElement = _ref.popupsBoundariesElement,
44
- popupsScrollableElement = _ref.popupsScrollableElement,
45
- toolbarSize = _ref.toolbarSize,
46
- disabled = _ref.disabled,
47
- isToolbarReducedSpacing = _ref.isToolbarReducedSpacing,
48
- isLastItem = _ref.isLastItem;
38
+ primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
39
+ var editorView = _ref2.editorView,
40
+ editorActions = _ref2.editorActions,
41
+ dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
42
+ providerFactory = _ref2.providerFactory,
43
+ popupsMountPoint = _ref2.popupsMountPoint,
44
+ popupsBoundariesElement = _ref2.popupsBoundariesElement,
45
+ popupsScrollableElement = _ref2.popupsScrollableElement,
46
+ toolbarSize = _ref2.toolbarSize,
47
+ disabled = _ref2.disabled,
48
+ isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
49
+ isLastItem = _ref2.isLastItem;
49
50
  var renderNode = function renderNode(providers) {
50
51
  // We will slowly migrate these to use the new approach inside
51
52
  // `ToolbarInsertBlockWithInjectionApi` and remove `WithPluginState`
@@ -59,13 +60,13 @@ var insertBlockPlugin = function insertBlockPlugin() {
59
60
  placeholderTextState: placeholderTextStateKey,
60
61
  layoutState: layoutStateKey
61
62
  },
62
- render: function render(_ref2) {
63
- var blockTypeState = _ref2.blockTypeState,
64
- mediaState = _ref2.mediaState,
65
- _ref2$macroState = _ref2.macroState,
66
- macroState = _ref2$macroState === void 0 ? {} : _ref2$macroState,
67
- placeholderTextState = _ref2.placeholderTextState,
68
- layoutState = _ref2.layoutState;
63
+ render: function render(_ref3) {
64
+ var blockTypeState = _ref3.blockTypeState,
65
+ mediaState = _ref3.mediaState,
66
+ _ref3$macroState = _ref3.macroState,
67
+ macroState = _ref3$macroState === void 0 ? {} : _ref3$macroState,
68
+ placeholderTextState = _ref3.placeholderTextState,
69
+ layoutState = _ref3.layoutState;
69
70
  return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
70
71
  pluginInjectionApi: api,
71
72
  editorView: editorView,
@@ -99,28 +100,28 @@ var insertBlockPlugin = function insertBlockPlugin() {
99
100
  }
100
101
  };
101
102
  };
102
- function ToolbarInsertBlockWithInjectionApi(_ref3) {
103
- var _pluginInjectionApi$d2, _pluginInjectionApi$d3;
104
- var editorView = _ref3.editorView,
105
- editorActions = _ref3.editorActions,
106
- dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
107
- providerFactory = _ref3.providerFactory,
108
- popupsMountPoint = _ref3.popupsMountPoint,
109
- popupsBoundariesElement = _ref3.popupsBoundariesElement,
110
- popupsScrollableElement = _ref3.popupsScrollableElement,
111
- toolbarSize = _ref3.toolbarSize,
112
- disabled = _ref3.disabled,
113
- isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
114
- isLastItem = _ref3.isLastItem,
115
- providers = _ref3.providers,
116
- pluginInjectionApi = _ref3.pluginInjectionApi,
117
- options = _ref3.options,
118
- blockTypeState = _ref3.blockTypeState,
119
- mediaState = _ref3.mediaState,
120
- macroState = _ref3.macroState,
121
- placeholderTextState = _ref3.placeholderTextState,
122
- layoutState = _ref3.layoutState,
123
- featureFlags = _ref3.featureFlags;
103
+ function ToolbarInsertBlockWithInjectionApi(_ref4) {
104
+ var _pluginInjectionApi$a2, _pluginInjectionApi$i;
105
+ var editorView = _ref4.editorView,
106
+ editorActions = _ref4.editorActions,
107
+ dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
108
+ providerFactory = _ref4.providerFactory,
109
+ popupsMountPoint = _ref4.popupsMountPoint,
110
+ popupsBoundariesElement = _ref4.popupsBoundariesElement,
111
+ popupsScrollableElement = _ref4.popupsScrollableElement,
112
+ toolbarSize = _ref4.toolbarSize,
113
+ disabled = _ref4.disabled,
114
+ isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing,
115
+ isLastItem = _ref4.isLastItem,
116
+ providers = _ref4.providers,
117
+ pluginInjectionApi = _ref4.pluginInjectionApi,
118
+ options = _ref4.options,
119
+ blockTypeState = _ref4.blockTypeState,
120
+ mediaState = _ref4.mediaState,
121
+ macroState = _ref4.macroState,
122
+ placeholderTextState = _ref4.placeholderTextState,
123
+ layoutState = _ref4.layoutState,
124
+ featureFlags = _ref4.featureFlags;
124
125
  var buttons = toolbarSizeToButtons(toolbarSize);
125
126
  var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji']),
126
127
  dateState = _useSharedPluginState.dateState,
@@ -134,9 +135,9 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
134
135
  * @param name Block name
135
136
  */
136
137
  var handleInsertBlockType = React.useCallback(function (name) {
137
- var _pluginInjectionApi$d;
138
- return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions);
139
- }, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions]);
138
+ var _pluginInjectionApi$a;
139
+ return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
140
+ }, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions]);
140
141
  return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
141
142
  pluginInjectionApi: pluginInjectionApi,
142
143
  buttons: buttons,
@@ -156,9 +157,9 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
156
157
  mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
157
158
  onShowMediaPicker: mediaState && mediaState.showMediaPicker,
158
159
  mediaSupported: !!mediaState,
159
- imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.dependencies.imageUpload),
160
+ imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
160
161
  imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
161
- handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d3 = pluginInjectionApi.dependencies.imageUpload) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.actions.startUpload,
162
+ handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$i = pluginInjectionApi.imageUpload) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.actions.startUpload,
162
163
  availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
163
164
  linkSupported: !!hyperlinkState,
164
165
  linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
@@ -164,19 +164,19 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
164
164
  }
165
165
  });
166
166
  _defineProperty(_assertThisInitialized(_this), "toggleLinkPanel", function (inputMethod) {
167
- var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3;
167
+ var _pluginInjectionApi$c, _pluginInjectionApi$h;
168
168
  var pluginInjectionApi = _this.props.pluginInjectionApi;
169
- return (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : (_pluginInjectionApi$d3 = _pluginInjectionApi$d2.hyperlink) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : false;
169
+ return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : _pluginInjectionApi$h.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$c !== void 0 ? _pluginInjectionApi$c : false;
170
170
  });
171
171
  _defineProperty(_assertThisInitialized(_this), "insertMention", function (inputMethod) {
172
- var _pluginInjectionApi$d4;
172
+ var _pluginInjectionApi$m;
173
173
  var _this$props = _this.props,
174
174
  editorView = _this$props.editorView,
175
175
  pluginInjectionApi = _this$props.pluginInjectionApi;
176
176
  if (!editorView) {
177
177
  return true;
178
178
  }
179
- var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies.mention) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : _pluginInjectionApi$d4.sharedState.currentState();
179
+ var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
180
180
  if (pluginState && pluginState.canInsertMention === false) {
181
181
  return false;
182
182
  }
@@ -184,13 +184,13 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
184
184
  return true;
185
185
  });
186
186
  _defineProperty(_assertThisInitialized(_this), "insertTable", function (inputMethod) {
187
- var _pluginInjectionApi$d5, _pluginInjectionApi$d6, _pluginInjectionApi$d7, _pluginInjectionApi$d8;
187
+ var _pluginInjectionApi$t, _pluginInjectionApi$t2, _pluginInjectionApi$t3, _pluginInjectionApi$t4;
188
188
  var _this$props2 = _this.props,
189
189
  pluginInjectionApi = _this$props2.pluginInjectionApi,
190
190
  editorView = _this$props2.editorView;
191
191
  var state = editorView.state,
192
192
  dispatch = editorView.dispatch;
193
- return (_pluginInjectionApi$d5 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies.table) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : (_pluginInjectionApi$d7 = (_pluginInjectionApi$d8 = _pluginInjectionApi$d6.actions).insertTable) === null || _pluginInjectionApi$d7 === void 0 ? void 0 : _pluginInjectionApi$d7.call(_pluginInjectionApi$d8, {
193
+ return (_pluginInjectionApi$t = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$t2 = pluginInjectionApi.table) === null || _pluginInjectionApi$t2 === void 0 ? void 0 : (_pluginInjectionApi$t3 = (_pluginInjectionApi$t4 = _pluginInjectionApi$t2.actions).insertTable) === null || _pluginInjectionApi$t3 === void 0 ? void 0 : _pluginInjectionApi$t3.call(_pluginInjectionApi$t4, {
194
194
  action: ACTION.INSERTED,
195
195
  actionSubject: ACTION_SUBJECT.DOCUMENT,
196
196
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
@@ -198,7 +198,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
198
198
  inputMethod: inputMethod
199
199
  },
200
200
  eventType: EVENT_TYPE.TRACK
201
- })(state, dispatch)) !== null && _pluginInjectionApi$d5 !== void 0 ? _pluginInjectionApi$d5 : false;
201
+ })(state, dispatch)) !== null && _pluginInjectionApi$t !== void 0 ? _pluginInjectionApi$t : false;
202
202
  });
203
203
  _defineProperty(_assertThisInitialized(_this), "createDate", function (inputMethod) {
204
204
  var editorView = _this.props.editorView;
@@ -275,17 +275,17 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
275
275
  };
276
276
  });
277
277
  _defineProperty(_assertThisInitialized(_this), "handleSelectedEmoji", function (emojiId) {
278
- var _pluginInjectionApi$d9;
278
+ var _pluginInjectionApi$e;
279
279
  var pluginInjectionApi = _this.props.pluginInjectionApi;
280
280
  _this.props.editorView.focus();
281
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute((_pluginInjectionApi$d9 = pluginInjectionApi.dependencies.emoji) === null || _pluginInjectionApi$d9 === void 0 ? void 0 : _pluginInjectionApi$d9.commands.insertEmoji(emojiId, INPUT_METHOD.PICKER));
281
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute((_pluginInjectionApi$e = pluginInjectionApi.emoji) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.commands.insertEmoji(emojiId, INPUT_METHOD.PICKER));
282
282
  _this.toggleEmojiPicker();
283
283
  return true;
284
284
  });
285
285
  _defineProperty(_assertThisInitialized(_this), "openElementBrowser", function () {
286
- var _pluginInjectionApi$d10;
286
+ var _pluginInjectionApi$q;
287
287
  var pluginInjectionApi = _this.props.pluginInjectionApi;
288
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d10 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d10 === void 0 ? void 0 : _pluginInjectionApi$d10.commands.openElementBrowserModal);
288
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.commands.openElementBrowserModal);
289
289
  });
290
290
  _defineProperty(_assertThisInitialized(_this), "onItemActivated", function (_ref2) {
291
291
  var item = _ref2.item,
@@ -8,9 +8,10 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
8
8
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
9
9
  import { pluginKey } from './pm-plugins/plugin-key';
10
10
  export { pluginKey };
11
- var layoutPlugin = function layoutPlugin() {
12
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13
- var api = arguments.length > 1 ? arguments[1] : undefined;
11
+ var layoutPlugin = function layoutPlugin(_ref) {
12
+ var _ref$config = _ref.config,
13
+ options = _ref$config === void 0 ? {} : _ref$config,
14
+ api = _ref.api;
14
15
  return {
15
16
  name: 'layout',
16
17
  nodes: function nodes() {
@@ -32,19 +33,19 @@ var layoutPlugin = function layoutPlugin() {
32
33
  },
33
34
  pluginsOptions: {
34
35
  floatingToolbar: function floatingToolbar(state, intl) {
35
- var _ref = pluginKey.getState(state),
36
- pos = _ref.pos,
37
- allowBreakout = _ref.allowBreakout,
38
- addSidebarLayouts = _ref.addSidebarLayouts,
39
- allowSingleColumnLayout = _ref.allowSingleColumnLayout;
36
+ var _ref2 = pluginKey.getState(state),
37
+ pos = _ref2.pos,
38
+ allowBreakout = _ref2.allowBreakout,
39
+ addSidebarLayouts = _ref2.addSidebarLayouts,
40
+ allowSingleColumnLayout = _ref2.allowSingleColumnLayout;
40
41
  if (pos !== null) {
41
- var _api$dependencies$dec;
42
- return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api === null || api === void 0 ? void 0 : (_api$dependencies$dec = api.dependencies.decorations.actions) === null || _api$dependencies$dec === void 0 ? void 0 : _api$dependencies$dec.hoverDecoration);
42
+ var _api$decorations$acti;
43
+ return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api === null || api === void 0 ? void 0 : (_api$decorations$acti = api.decorations.actions) === null || _api$decorations$acti === void 0 ? void 0 : _api$decorations$acti.hoverDecoration);
43
44
  }
44
45
  return undefined;
45
46
  },
46
- quickInsert: function quickInsert(_ref2) {
47
- var formatMessage = _ref2.formatMessage;
47
+ quickInsert: function quickInsert(_ref3) {
48
+ var formatMessage = _ref3.formatMessage;
48
49
  return [{
49
50
  id: 'layout',
50
51
  title: formatMessage(messages.columns),
@@ -55,9 +56,9 @@ var layoutPlugin = function layoutPlugin() {
55
56
  return /*#__PURE__*/React.createElement(IconLayout, null);
56
57
  },
57
58
  action: function action(insert, state) {
58
- var _api$dependencies$ana, _api$dependencies$ana2;
59
+ var _api$analytics, _api$analytics$action;
59
60
  var tr = insert(createDefaultLayoutSection(state));
60
- api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : (_api$dependencies$ana2 = _api$dependencies$ana.actions) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.attachAnalyticsEvent({
61
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.attachAnalyticsEvent({
61
62
  action: ACTION.INSERTED,
62
63
  actionSubject: ACTION_SUBJECT.DOCUMENT,
63
64
  actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
@@ -19,14 +19,15 @@ export function createPlugin(dispatch, maxContentSize) {
19
19
  }
20
20
  });
21
21
  }
22
- var maxContentSizePlugin = function maxContentSizePlugin(maxContentSize) {
22
+ var maxContentSizePlugin = function maxContentSizePlugin(_ref) {
23
+ var maxContentSize = _ref.config;
23
24
  return {
24
25
  name: 'maxContentSize',
25
26
  pmPlugins: function pmPlugins() {
26
27
  return [{
27
28
  name: 'maxContentSize',
28
- plugin: function plugin(_ref) {
29
- var dispatch = _ref.dispatch;
29
+ plugin: function plugin(_ref2) {
30
+ var dispatch = _ref2.dispatch;
30
31
  return createPlugin(dispatch, maxContentSize);
31
32
  }
32
33
  }];