@atlaskit/editor-core 187.31.7 → 187.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/CHANGELOG.md +33 -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/Toolbar.js +3 -3
  26. package/dist/cjs/plugins/help-dialog/index.js +18 -17
  27. package/dist/cjs/plugins/insert-block/index.js +52 -51
  28. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
  29. package/dist/cjs/plugins/layout/index.js +15 -14
  30. package/dist/cjs/plugins/max-content-size/index.js +4 -3
  31. package/dist/cjs/plugins/media/index.js +49 -47
  32. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  33. package/dist/cjs/plugins/media/pm-plugins/main.js +7 -7
  34. package/dist/cjs/plugins/media/toolbar/index.js +29 -24
  35. package/dist/cjs/plugins/media/toolbar/linking.js +4 -4
  36. package/dist/cjs/plugins/media/toolbar/utils.js +22 -2
  37. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
  38. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  39. package/dist/cjs/plugins/mentions/index.js +17 -15
  40. package/dist/cjs/plugins/panel/index.js +13 -12
  41. package/dist/cjs/plugins/paste/index.js +13 -10
  42. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +8 -8
  43. package/dist/cjs/plugins/paste/pm-plugins/main.js +10 -10
  44. package/dist/cjs/plugins/placeholder/index.js +9 -7
  45. package/dist/cjs/plugins/placeholder-text/index.js +23 -16
  46. package/dist/cjs/plugins/quick-insert/index.js +13 -12
  47. package/dist/cjs/plugins/rule/index.js +8 -7
  48. package/dist/cjs/plugins/save-on-enter/index.js +4 -3
  49. package/dist/cjs/plugins/selection/index.js +5 -4
  50. package/dist/cjs/plugins/status/index.js +20 -14
  51. package/dist/cjs/plugins/submit-editor/index.js +4 -3
  52. package/dist/cjs/plugins/tasks-and-decisions/index.js +6 -5
  53. package/dist/cjs/plugins/text-color/index.js +17 -15
  54. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +31 -26
  55. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  56. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
  57. package/dist/cjs/plugins/type-ahead/index.js +21 -20
  58. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +11 -11
  59. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
  60. package/dist/cjs/use-preset.js +2 -2
  61. package/dist/cjs/version-wrapper.js +1 -1
  62. package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
  63. package/dist/es2019/plugins/analytics/plugin.js +11 -8
  64. package/dist/es2019/plugins/annotation/index.js +4 -1
  65. package/dist/es2019/plugins/avatar-group/index.js +8 -5
  66. package/dist/es2019/plugins/base/plugin.js +6 -3
  67. package/dist/es2019/plugins/before-primaryToolbar/index.js +4 -2
  68. package/dist/es2019/plugins/block-type/index.js +14 -11
  69. package/dist/es2019/plugins/breakout/index.js +6 -3
  70. package/dist/es2019/plugins/caption/index.js +3 -1
  71. package/dist/es2019/plugins/caption/pm-plugins/main.js +2 -2
  72. package/dist/es2019/plugins/code-bidi-warning/index.js +2 -4
  73. package/dist/es2019/plugins/code-block/index.js +15 -9
  74. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -2
  75. package/dist/es2019/plugins/collab-edit/index.js +9 -6
  76. package/dist/es2019/plugins/collab-edit/plugin.js +5 -5
  77. package/dist/es2019/plugins/date/index.js +6 -3
  78. package/dist/es2019/plugins/emoji/index.js +16 -13
  79. package/dist/es2019/plugins/expand/index.js +7 -4
  80. package/dist/es2019/plugins/extension/index.js +11 -8
  81. package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
  82. package/dist/es2019/plugins/feedback-dialog/index.js +4 -2
  83. package/dist/es2019/plugins/find-replace/index.js +8 -5
  84. package/dist/es2019/plugins/floating-toolbar/index.js +6 -4
  85. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
  86. package/dist/es2019/plugins/help-dialog/index.js +9 -6
  87. package/dist/es2019/plugins/insert-block/index.js +12 -9
  88. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
  89. package/dist/es2019/plugins/layout/index.js +8 -5
  90. package/dist/es2019/plugins/max-content-size/index.js +3 -1
  91. package/dist/es2019/plugins/media/index.js +14 -10
  92. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
  93. package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
  94. package/dist/es2019/plugins/media/toolbar/index.js +29 -25
  95. package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
  96. package/dist/es2019/plugins/media/toolbar/utils.js +18 -0
  97. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
  98. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  99. package/dist/es2019/plugins/mentions/index.js +9 -6
  100. package/dist/es2019/plugins/panel/index.js +5 -2
  101. package/dist/es2019/plugins/paste/index.js +9 -5
  102. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +8 -8
  103. package/dist/es2019/plugins/paste/pm-plugins/main.js +10 -10
  104. package/dist/es2019/plugins/placeholder/index.js +10 -7
  105. package/dist/es2019/plugins/placeholder-text/index.js +12 -4
  106. package/dist/es2019/plugins/quick-insert/index.js +3 -1
  107. package/dist/es2019/plugins/rule/index.js +5 -3
  108. package/dist/es2019/plugins/save-on-enter/index.js +3 -1
  109. package/dist/es2019/plugins/selection/index.js +3 -1
  110. package/dist/es2019/plugins/status/index.js +11 -3
  111. package/dist/es2019/plugins/submit-editor/index.js +3 -1
  112. package/dist/es2019/plugins/tasks-and-decisions/index.js +6 -4
  113. package/dist/es2019/plugins/text-color/index.js +6 -3
  114. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +9 -5
  115. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  116. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
  117. package/dist/es2019/plugins/type-ahead/index.js +3 -1
  118. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +11 -11
  119. package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
  120. package/dist/es2019/use-preset.js +2 -2
  121. package/dist/es2019/version-wrapper.js +1 -1
  122. package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
  123. package/dist/esm/plugins/analytics/plugin.js +14 -12
  124. package/dist/esm/plugins/annotation/index.js +15 -13
  125. package/dist/esm/plugins/avatar-group/index.js +16 -14
  126. package/dist/esm/plugins/base/plugin.js +12 -10
  127. package/dist/esm/plugins/before-primaryToolbar/index.js +3 -2
  128. package/dist/esm/plugins/block-type/index.js +32 -30
  129. package/dist/esm/plugins/breakout/index.js +10 -8
  130. package/dist/esm/plugins/caption/index.js +7 -6
  131. package/dist/esm/plugins/caption/pm-plugins/main.js +2 -2
  132. package/dist/esm/plugins/code-bidi-warning/index.js +2 -4
  133. package/dist/esm/plugins/code-block/index.js +14 -11
  134. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -2
  135. package/dist/esm/plugins/collab-edit/index.js +16 -14
  136. package/dist/esm/plugins/collab-edit/plugin.js +5 -5
  137. package/dist/esm/plugins/date/index.js +18 -17
  138. package/dist/esm/plugins/emoji/index.js +35 -33
  139. package/dist/esm/plugins/expand/index.js +14 -13
  140. package/dist/esm/plugins/extension/index.js +16 -15
  141. package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
  142. package/dist/esm/plugins/feedback-dialog/index.js +5 -4
  143. package/dist/esm/plugins/find-replace/index.js +17 -15
  144. package/dist/esm/plugins/floating-toolbar/index.js +31 -30
  145. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
  146. package/dist/esm/plugins/help-dialog/index.js +18 -17
  147. package/dist/esm/plugins/insert-block/index.js +52 -51
  148. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
  149. package/dist/esm/plugins/layout/index.js +15 -14
  150. package/dist/esm/plugins/max-content-size/index.js +4 -3
  151. package/dist/esm/plugins/media/index.js +49 -47
  152. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
  153. package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
  154. package/dist/esm/plugins/media/toolbar/index.js +30 -25
  155. package/dist/esm/plugins/media/toolbar/linking.js +4 -4
  156. package/dist/esm/plugins/media/toolbar/utils.js +19 -0
  157. package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
  158. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
  159. package/dist/esm/plugins/mentions/index.js +17 -15
  160. package/dist/esm/plugins/panel/index.js +13 -12
  161. package/dist/esm/plugins/paste/index.js +13 -10
  162. package/dist/esm/plugins/paste/pm-plugins/analytics.js +8 -8
  163. package/dist/esm/plugins/paste/pm-plugins/main.js +10 -10
  164. package/dist/esm/plugins/placeholder/index.js +9 -7
  165. package/dist/esm/plugins/placeholder-text/index.js +23 -16
  166. package/dist/esm/plugins/quick-insert/index.js +13 -12
  167. package/dist/esm/plugins/rule/index.js +8 -7
  168. package/dist/esm/plugins/save-on-enter/index.js +4 -3
  169. package/dist/esm/plugins/selection/index.js +5 -4
  170. package/dist/esm/plugins/status/index.js +20 -14
  171. package/dist/esm/plugins/submit-editor/index.js +4 -3
  172. package/dist/esm/plugins/tasks-and-decisions/index.js +6 -5
  173. package/dist/esm/plugins/text-color/index.js +17 -15
  174. package/dist/esm/plugins/toolbar-lists-indentation/index.js +31 -26
  175. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  176. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
  177. package/dist/esm/plugins/type-ahead/index.js +21 -20
  178. package/dist/esm/ui/ElementBrowser/InsertMenu.js +11 -11
  179. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  180. package/dist/esm/use-preset.js +2 -2
  181. package/dist/esm/version-wrapper.js +1 -1
  182. package/dist/types/labs/next/presets/default.d.ts +62 -618
  183. package/dist/types/plugins/avatar-group/index.d.ts +1 -1
  184. package/dist/types/plugins/before-primaryToolbar/index.d.ts +1 -1
  185. package/dist/types/plugins/caption/index.d.ts +1 -1
  186. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -1
  187. package/dist/types/plugins/media/types.d.ts +1 -0
  188. package/dist/types/plugins/selection/index.d.ts +2 -2
  189. package/dist/types/plugins/text-color/index.d.ts +3 -2
  190. package/dist/types/use-preset.d.ts +2 -2
  191. package/dist/types-ts4.5/labs/next/presets/default.d.ts +96 -716
  192. package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
  193. package/dist/types-ts4.5/plugins/before-primaryToolbar/index.d.ts +1 -1
  194. package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
  195. package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -1
  196. package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
  197. package/dist/types-ts4.5/plugins/selection/index.d.ts +2 -2
  198. package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -2
  199. package/dist/types-ts4.5/use-preset.d.ts +2 -2
  200. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
8
+ signature of `NextEditorPlugin`.
9
+
10
+ Previously a `NextEditorPlugin` would be consumed as so:
11
+
12
+ ```ts
13
+ const plugin: NextEditorPlugin< ... > = (config, api) => {
14
+ // Can use api like so:
15
+ api.dependencies.core.actions.execute( ... )
16
+ return { ... }
17
+ }
18
+ ```
19
+
20
+ Now these have become named parameters like so and the `pluginInjectionAPI` is used
21
+ without the `dependencies` prop:
22
+
23
+ ```ts
24
+ const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
25
+ // Can use api like so:
26
+ api.core.actions.execute( ... )
27
+ return { ... }
28
+ }
29
+ ```
30
+
31
+ ### Patch Changes
32
+
33
+ - [`8f2f42eab4d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f2f42eab4d) - update layout when submit pixel values in media toolbar
34
+ - Updated dependencies
35
+
3
36
  ## 187.31.7
4
37
 
5
38
  ### Patch Changes
@@ -404,7 +404,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
404
404
  var _this$pluginInjection, _this$experienceStore10;
405
405
  var nodes = (0, _document.getNodesCount)(_this.view.state.doc);
406
406
  var ttfb = (0, _utils.getResponseEndTime)();
407
- var contextIdentifier = (_this$pluginInjection = _this.pluginInjectionAPI.api().dependencies.base) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.sharedState.currentState();
407
+ var contextIdentifier = (_this$pluginInjection = _this.pluginInjectionAPI.api().base) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.sharedState.currentState();
408
408
  _this.dispatchAnalyticsEvent({
409
409
  action: _analytics.ACTION.PROSEMIRROR_RENDERED,
410
410
  actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
@@ -23,18 +23,18 @@ function createPlugin(options, featureFlags, pluginInjectionApi) {
23
23
  }
24
24
  var hasRequiredPerformanceAPIs = (0, _utils.isPerformanceAPIAvailable)();
25
25
  var getCreateAnalyticsEvent = function getCreateAnalyticsEvent() {
26
- var _pluginInjectionApi$d, _pluginInjectionApi$d2;
27
- return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.sharedState.currentState()) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.createAnalyticsEvent;
26
+ var _pluginInjectionApi$a, _pluginInjectionApi$a2;
27
+ return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : (_pluginInjectionApi$a2 = _pluginInjectionApi$a.sharedState.currentState()) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.createAnalyticsEvent;
28
28
  };
29
29
  return new _safePlugin.SafePlugin({
30
30
  key: _pluginKey.analyticsPluginKey,
31
31
  state: {
32
32
  init: function init() {
33
- var _pluginInjectionApi$d3;
33
+ var _pluginInjectionApi$a3;
34
34
  return _objectSpread(_objectSpread({}, options), {}, {
35
35
  createAnalyticsEvent: getCreateAnalyticsEvent(),
36
36
  fireAnalytics: (0, _analytics.fireAnalyticsEvent)(options.createAnalyticsEvent),
37
- editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d3 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.actions
37
+ editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions
38
38
  });
39
39
  },
40
40
  apply: function apply(tr, pluginState, _, state) {
@@ -99,25 +99,27 @@ function createPlugin(options, featureFlags, pluginInjectionApi) {
99
99
  * Do not use this analytics plugin.
100
100
  * This will be deprecated soon.
101
101
  */
102
- var analyticsPlugin = function analyticsPlugin(options, api) {
103
- var _api$dependencies$fea;
104
- var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies$fea = api.dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
102
+ var analyticsPlugin = function analyticsPlugin(_ref2) {
103
+ var _api$featureFlags;
104
+ var options = _ref2.config,
105
+ api = _ref2.api;
106
+ var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
105
107
  return {
106
108
  name: 'deprecatedAnalytics',
107
109
  pmPlugins: function pmPlugins() {
108
110
  return [{
109
111
  name: 'analyticsPlugin',
110
112
  plugin: function plugin() {
111
- return createPlugin(options, featureFlags, api);
113
+ return createPlugin(options !== null && options !== void 0 ? options : {}, featureFlags, api);
112
114
  }
113
115
  }];
114
116
  }
115
117
  };
116
118
  };
117
- function extendPayload(_ref2) {
118
- var payload = _ref2.payload,
119
- duration = _ref2.duration,
120
- distortedDuration = _ref2.distortedDuration;
119
+ function extendPayload(_ref3) {
120
+ var payload = _ref3.payload,
121
+ duration = _ref3.duration,
122
+ distortedDuration = _ref3.distortedDuration;
121
123
  return _objectSpread(_objectSpread({}, payload), {}, {
122
124
  attributes: _objectSpread(_objectSpread({}, payload.attributes), {}, {
123
125
  duration: duration,
@@ -20,7 +20,9 @@ var _utils = require("./utils");
20
20
  var _toolbar = require("./toolbar");
21
21
  var _InlineCommentView = require("./ui/InlineCommentView");
22
22
  var _hooks = require("@atlaskit/editor-common/hooks");
23
- var annotationPlugin = function annotationPlugin(annotationProviders, api) {
23
+ var annotationPlugin = function annotationPlugin(_ref) {
24
+ var annotationProviders = _ref.config,
25
+ api = _ref.api;
24
26
  return {
25
27
  name: 'annotation',
26
28
  marks: function marks() {
@@ -38,10 +40,10 @@ var annotationPlugin = function annotationPlugin(annotationProviders, api) {
38
40
  pmPlugins: function pmPlugins() {
39
41
  return [{
40
42
  name: 'annotation',
41
- plugin: function plugin(_ref) {
42
- var dispatch = _ref.dispatch,
43
- portalProviderAPI = _ref.portalProviderAPI,
44
- eventDispatcher = _ref.eventDispatcher;
43
+ plugin: function plugin(_ref2) {
44
+ var dispatch = _ref2.dispatch,
45
+ portalProviderAPI = _ref2.portalProviderAPI,
46
+ eventDispatcher = _ref2.eventDispatcher;
45
47
  if (annotationProviders) {
46
48
  return (0, _inlineComment.inlineCommentPlugin)({
47
49
  dispatch: dispatch,
@@ -74,9 +76,9 @@ var annotationPlugin = function annotationPlugin(annotationProviders, api) {
74
76
  }
75
77
  }
76
78
  },
77
- contentComponent: function contentComponent(_ref2) {
78
- var editorView = _ref2.editorView,
79
- dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
79
+ contentComponent: function contentComponent(_ref3) {
80
+ var editorView = _ref3.editorView,
81
+ dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
80
82
  if (!annotationProviders) {
81
83
  return null;
82
84
  }
@@ -89,11 +91,11 @@ var annotationPlugin = function annotationPlugin(annotationProviders, api) {
89
91
  }
90
92
  };
91
93
  };
92
- function AnnotationContentComponent(_ref3) {
93
- var api = _ref3.api,
94
- editorView = _ref3.editorView,
95
- annotationProviders = _ref3.annotationProviders,
96
- dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
94
+ function AnnotationContentComponent(_ref4) {
95
+ var api = _ref4.api,
96
+ editorView = _ref4.editorView,
97
+ annotationProviders = _ref4.annotationProviders,
98
+ dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
97
99
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['annotation']),
98
100
  inlineCommentState = _useSharedPluginState.annotationState;
99
101
  if (inlineCommentState && !inlineCommentState.isVisible) {
@@ -7,26 +7,28 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _AvatarGroupPluginWrapper = _interopRequireDefault(require("./ui/AvatarGroupPluginWrapper"));
10
- var avatarGroup = function avatarGroup(props, api) {
11
- var _api$dependencies, _api$dependencies$fea;
12
- 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()) || {};
10
+ var avatarGroup = function avatarGroup(_ref) {
11
+ var _api$featureFlags;
12
+ var props = _ref.config,
13
+ api = _ref.api;
14
+ var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
13
15
  return {
14
16
  name: 'avatarGroup',
15
- primaryToolbarComponent: function primaryToolbarComponent(_ref) {
16
- var editorView = _ref.editorView,
17
- popupsMountPoint = _ref.popupsMountPoint,
18
- popupsBoundariesElement = _ref.popupsBoundariesElement,
19
- popupsScrollableElement = _ref.popupsScrollableElement,
20
- disabled = _ref.disabled,
21
- isToolbarReducedSpacing = _ref.isToolbarReducedSpacing,
22
- eventDispatcher = _ref.eventDispatcher,
23
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
17
+ primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
18
+ var editorView = _ref2.editorView,
19
+ popupsMountPoint = _ref2.popupsMountPoint,
20
+ popupsBoundariesElement = _ref2.popupsBoundariesElement,
21
+ popupsScrollableElement = _ref2.popupsScrollableElement,
22
+ disabled = _ref2.disabled,
23
+ isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
24
+ eventDispatcher = _ref2.eventDispatcher,
25
+ dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
24
26
  return /*#__PURE__*/_react.default.createElement(_AvatarGroupPluginWrapper.default, {
25
27
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
26
28
  editorView: editorView,
27
29
  eventDispatcher: eventDispatcher,
28
- collabEdit: props.collabEdit,
29
- takeFullWidth: props.takeFullWidth,
30
+ collabEdit: props === null || props === void 0 ? void 0 : props.collabEdit,
31
+ takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
30
32
  featureFlags: featureFlags
31
33
  });
32
34
  }
@@ -28,9 +28,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
28
28
  // Chrome >= 88
29
29
  var isChromeWithSelectionBug = _utils.browser.chrome && _utils.browser.chrome_version >= 88;
30
30
  exports.isChromeWithSelectionBug = isChromeWithSelectionBug;
31
- var basePlugin = function basePlugin(options, api) {
32
- var _api$dependencies, _api$dependencies$fea;
33
- 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()) || {};
31
+ var basePlugin = function basePlugin(_ref) {
32
+ var _api$featureFlags;
33
+ var options = _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()) || {};
34
36
  return {
35
37
  name: 'base',
36
38
  getSharedState: function getSharedState(editorState) {
@@ -41,8 +43,8 @@ var basePlugin = function basePlugin(options, api) {
41
43
  pmPlugins: function pmPlugins() {
42
44
  var plugins = [{
43
45
  name: 'filterStepsPlugin',
44
- plugin: function plugin(_ref) {
45
- var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
46
+ plugin: function plugin(_ref2) {
47
+ var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
46
48
  return (0, _filterSteps.default)(dispatchAnalyticsEvent);
47
49
  }
48
50
  }];
@@ -66,9 +68,9 @@ var basePlugin = function basePlugin(options, api) {
66
68
  plugin: _newlinePreserveMarks.default
67
69
  }, {
68
70
  name: 'frozenEditor',
69
- plugin: function plugin(_ref2) {
71
+ plugin: function plugin(_ref3) {
70
72
  var _options$inputTrackin;
71
- var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
73
+ var dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
72
74
  return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? (0, _frozenEditor.default)(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
73
75
  }
74
76
  }, {
@@ -92,9 +94,9 @@ var basePlugin = function basePlugin(options, api) {
92
94
  }
93
95
  }, {
94
96
  name: 'contextIdentifier',
95
- plugin: function plugin(_ref3) {
96
- var dispatch = _ref3.dispatch,
97
- providerFactory = _ref3.providerFactory;
97
+ plugin: function plugin(_ref4) {
98
+ var dispatch = _ref4.dispatch,
99
+ providerFactory = _ref4.providerFactory;
98
100
  return (0, _contextIdentifier.default)(dispatch, providerFactory);
99
101
  }
100
102
  });
@@ -7,12 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _BeforePrimaryToolbarWrapper = require("./ui/BeforePrimaryToolbarWrapper");
10
- var beforePrimaryToolbar = function beforePrimaryToolbar(props) {
10
+ var beforePrimaryToolbar = function beforePrimaryToolbar(_ref) {
11
+ var props = _ref.config;
11
12
  return {
12
13
  name: 'beforePrimaryToolbar',
13
14
  primaryToolbarComponent: function primaryToolbarComponent() {
14
15
  return /*#__PURE__*/_react.default.createElement(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
15
- beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
16
+ beforePrimaryToolbarComponents: props === null || props === void 0 ? void 0 : props.beforePrimaryToolbarComponents
16
17
  });
17
18
  }
18
19
  };
@@ -97,7 +97,9 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
97
97
  }
98
98
  }];
99
99
  };
100
- var blockTypePlugin = function blockTypePlugin(options, api) {
100
+ var blockTypePlugin = function blockTypePlugin(_ref3) {
101
+ var options = _ref3.config,
102
+ api = _ref3.api;
101
103
  return {
102
104
  name: 'blockType',
103
105
  nodes: function nodes() {
@@ -122,45 +124,45 @@ var blockTypePlugin = function blockTypePlugin(options, api) {
122
124
  pmPlugins: function pmPlugins() {
123
125
  return [{
124
126
  name: 'blockType',
125
- plugin: function plugin(_ref3) {
126
- var _api$dependencies$ana;
127
- var dispatch = _ref3.dispatch;
128
- return (0, _main.createPlugin)(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, dispatch, options && options.lastNodeMustBeParagraph);
127
+ plugin: function plugin(_ref4) {
128
+ var _api$analytics;
129
+ var dispatch = _ref4.dispatch;
130
+ return (0, _main.createPlugin)(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, dispatch, options && options.lastNodeMustBeParagraph);
129
131
  }
130
132
  }, {
131
133
  name: 'blockTypeInputRule',
132
- plugin: function plugin(_ref4) {
133
- var _api$dependencies$ana2;
134
- var schema = _ref4.schema,
135
- featureFlags = _ref4.featureFlags;
136
- return (0, _inputRule.default)(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, schema, featureFlags);
134
+ plugin: function plugin(_ref5) {
135
+ var _api$analytics2;
136
+ var schema = _ref5.schema,
137
+ featureFlags = _ref5.featureFlags;
138
+ return (0, _inputRule.default)(api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, schema, featureFlags);
137
139
  }
138
140
  },
139
141
  // Needs to be lower priority than editor-tables.tableEditing
140
142
  // plugin as it is currently swallowing right/down arrow events inside tables
141
143
  {
142
144
  name: 'blockTypeKeyMap',
143
- plugin: function plugin(_ref5) {
144
- var _api$dependencies$ana3;
145
- var schema = _ref5.schema,
146
- featureFlags = _ref5.featureFlags;
147
- return (0, _keymap.default)(api === null || api === void 0 ? void 0 : (_api$dependencies$ana3 = api.dependencies.analytics) === null || _api$dependencies$ana3 === void 0 ? void 0 : _api$dependencies$ana3.actions, schema, featureFlags);
145
+ plugin: function plugin(_ref6) {
146
+ var _api$analytics3;
147
+ var schema = _ref6.schema,
148
+ featureFlags = _ref6.featureFlags;
149
+ return (0, _keymap.default)(api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, schema, featureFlags);
148
150
  }
149
151
  }];
150
152
  },
151
- primaryToolbarComponent: function primaryToolbarComponent(_ref6) {
152
- var editorView = _ref6.editorView,
153
- popupsMountPoint = _ref6.popupsMountPoint,
154
- popupsBoundariesElement = _ref6.popupsBoundariesElement,
155
- popupsScrollableElement = _ref6.popupsScrollableElement,
156
- toolbarSize = _ref6.toolbarSize,
157
- disabled = _ref6.disabled,
158
- isToolbarReducedSpacing = _ref6.isToolbarReducedSpacing,
159
- eventDispatcher = _ref6.eventDispatcher;
153
+ primaryToolbarComponent: function primaryToolbarComponent(_ref7) {
154
+ var editorView = _ref7.editorView,
155
+ popupsMountPoint = _ref7.popupsMountPoint,
156
+ popupsBoundariesElement = _ref7.popupsBoundariesElement,
157
+ popupsScrollableElement = _ref7.popupsScrollableElement,
158
+ toolbarSize = _ref7.toolbarSize,
159
+ disabled = _ref7.disabled,
160
+ isToolbarReducedSpacing = _ref7.isToolbarReducedSpacing,
161
+ eventDispatcher = _ref7.eventDispatcher;
160
162
  var isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < _types.ToolbarSize.XXL : toolbarSize < _types.ToolbarSize.XL;
161
163
  var boundSetBlockType = function boundSetBlockType(name) {
162
- var _api$dependencies$ana4;
163
- return (0, _commands.setBlockTypeWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, api === null || api === void 0 ? void 0 : (_api$dependencies$ana4 = api.dependencies.analytics) === null || _api$dependencies$ana4 === void 0 ? void 0 : _api$dependencies$ana4.actions)(editorView.state, editorView.dispatch);
164
+ var _api$analytics4;
165
+ return (0, _commands.setBlockTypeWithAnalytics)(name, _analytics.INPUT_METHOD.TOOLBAR, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)(editorView.state, editorView.dispatch);
164
166
  };
165
167
  return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
166
168
  editorView: editorView,
@@ -168,8 +170,8 @@ var blockTypePlugin = function blockTypePlugin(options, api) {
168
170
  plugins: {
169
171
  pluginState: _main.pluginKey
170
172
  },
171
- render: function render(_ref7) {
172
- var pluginState = _ref7.pluginState;
173
+ render: function render(_ref8) {
174
+ var pluginState = _ref8.pluginState;
173
175
  return /*#__PURE__*/_react.default.createElement(_ToolbarBlockType.default, {
174
176
  isSmall: isSmall,
175
177
  isDisabled: disabled,
@@ -185,9 +187,9 @@ var blockTypePlugin = function blockTypePlugin(options, api) {
185
187
  },
186
188
  pluginsOptions: {
187
189
  quickInsert: function quickInsert(intl) {
188
- var _api$dependencies$ana5, _api$dependencies$ana6;
190
+ var _api$analytics5, _api$analytics6;
189
191
  var exclude = options && options.allowBlockType && options.allowBlockType.exclude ? options.allowBlockType.exclude : [];
190
- return [].concat((0, _toConsumableArray2.default)(blockquotePluginOptions(intl, exclude.indexOf('blockquote') === -1, api === null || api === void 0 ? void 0 : (_api$dependencies$ana5 = api.dependencies.analytics) === null || _api$dependencies$ana5 === void 0 ? void 0 : _api$dependencies$ana5.actions)), (0, _toConsumableArray2.default)(headingPluginOptions(intl, exclude.indexOf('heading') === -1, api === null || api === void 0 ? void 0 : (_api$dependencies$ana6 = api.dependencies.analytics) === null || _api$dependencies$ana6 === void 0 ? void 0 : _api$dependencies$ana6.actions)));
192
+ return [].concat((0, _toConsumableArray2.default)(blockquotePluginOptions(intl, exclude.indexOf('blockquote') === -1, api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions)), (0, _toConsumableArray2.default)(headingPluginOptions(intl, exclude.indexOf('heading') === -1, api === null || api === void 0 ? void 0 : (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions)));
191
193
  }
192
194
  }
193
195
  };
@@ -86,11 +86,11 @@ var BreakoutView = /*#__PURE__*/function () {
86
86
  this.mark = mark;
87
87
  this.view = view;
88
88
  this.contentDOM = contentDOM;
89
- this.unsubscribe = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.width.sharedState.onChange(function (_ref) {
89
+ this.unsubscribe = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width.sharedState.onChange(function (_ref) {
90
90
  var nextSharedState = _ref.nextSharedState;
91
91
  return _this.updateWidth(nextSharedState);
92
92
  });
93
- this.updateWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.width.sharedState.currentState());
93
+ this.updateWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width.sharedState.currentState());
94
94
  }
95
95
  (0, _createClass2.default)(BreakoutView, [{
96
96
  key: "destroy",
@@ -163,7 +163,9 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
163
163
  node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
164
164
  });
165
165
  };
166
- var breakoutPlugin = function breakoutPlugin(options, api) {
166
+ var breakoutPlugin = function breakoutPlugin(_ref4) {
167
+ var options = _ref4.config,
168
+ api = _ref4.api;
167
169
  return {
168
170
  name: 'breakout',
169
171
  pmPlugins: function pmPlugins() {
@@ -194,11 +196,11 @@ var breakoutPlugin = function breakoutPlugin(options, api) {
194
196
  }
195
197
  return pluginState;
196
198
  },
197
- contentComponent: function contentComponent(_ref4) {
198
- var editorView = _ref4.editorView,
199
- popupsMountPoint = _ref4.popupsMountPoint,
200
- popupsBoundariesElement = _ref4.popupsBoundariesElement,
201
- popupsScrollableElement = _ref4.popupsScrollableElement;
199
+ contentComponent: function contentComponent(_ref5) {
200
+ var editorView = _ref5.editorView,
201
+ popupsMountPoint = _ref5.popupsMountPoint,
202
+ popupsBoundariesElement = _ref5.popupsBoundariesElement,
203
+ popupsScrollableElement = _ref5.popupsScrollableElement;
202
204
  // This is a bit crappy, but should be resolved once we move to a static schema.
203
205
  if (options && !options.allowBreakoutButton) {
204
206
  return null;
@@ -8,7 +8,8 @@ exports.default = void 0;
8
8
  var _adfSchema = require("@atlaskit/adf-schema");
9
9
  var _main = _interopRequireDefault(require("./pm-plugins/main"));
10
10
  var _keymap = require("./pm-plugins/keymap");
11
- var captionPlugin = function captionPlugin(_, api) {
11
+ var captionPlugin = function captionPlugin(_ref) {
12
+ var api = _ref.api;
12
13
  return {
13
14
  name: 'caption',
14
15
  nodes: function nodes() {
@@ -20,11 +21,11 @@ var captionPlugin = function captionPlugin(_, api) {
20
21
  pmPlugins: function pmPlugins() {
21
22
  return [{
22
23
  name: 'caption',
23
- plugin: function plugin(_ref) {
24
- var portalProviderAPI = _ref.portalProviderAPI,
25
- providerFactory = _ref.providerFactory,
26
- eventDispatcher = _ref.eventDispatcher,
27
- dispatch = _ref.dispatch;
24
+ plugin: function plugin(_ref2) {
25
+ var portalProviderAPI = _ref2.portalProviderAPI,
26
+ providerFactory = _ref2.providerFactory,
27
+ eventDispatcher = _ref2.eventDispatcher,
28
+ dispatch = _ref2.dispatch;
28
29
  return (0, _main.default)(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api);
29
30
  }
30
31
  }, {
@@ -19,8 +19,8 @@ var fireAnalytics = function fireAnalytics(tr, action, analyticsApi) {
19
19
  })(tr);
20
20
  };
21
21
  var _default = function _default(portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi) {
22
- var _pluginInjectionApi$d;
23
- var analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions;
22
+ var _pluginInjectionApi$a;
23
+ var analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
24
24
  return new _safePlugin.SafePlugin({
25
25
  appendTransaction: function appendTransaction(transactions, oldState, newState) {
26
26
  // only run for transactions that change selection
@@ -6,16 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _main = require("./pm-plugins/main");
8
8
  var codeBidiWarning = function codeBidiWarning(_ref) {
9
- var appearance = _ref.appearance;
9
+ var config = _ref.config;
10
10
  return {
11
11
  name: 'codeBidiWarning',
12
12
  pmPlugins: function pmPlugins() {
13
13
  return [{
14
14
  name: 'codeBidiWarning',
15
15
  plugin: function plugin(options) {
16
- return (0, _main.createPlugin)(options, {
17
- appearance: appearance
18
- });
16
+ return (0, _main.createPlugin)(options, config);
19
17
  }
20
18
  }];
21
19
  }
@@ -22,7 +22,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
22
22
  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) { (0, _defineProperty2.default)(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; } // Theres an existing interelationship between these files, where the imported function is being called for code-block
23
23
  // Insertions via the drop down menu
24
24
  // tslint-ignore-next-line
25
- var codeBlockPlugin = function codeBlockPlugin(options, api) {
25
+ var codeBlockPlugin = function codeBlockPlugin(_ref) {
26
+ var options = _ref.config,
27
+ api = _ref.api;
26
28
  return {
27
29
  name: 'codeBlock',
28
30
  nodes: function nodes() {
@@ -34,11 +36,12 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
34
36
  pmPlugins: function pmPlugins() {
35
37
  return [{
36
38
  name: 'codeBlock',
37
- plugin: function plugin(_ref) {
38
- var getIntl = _ref.getIntl;
39
+ plugin: function plugin(_ref2) {
40
+ var _options$appearance;
41
+ var getIntl = _ref2.getIntl;
39
42
  return (0, _main.createPlugin)(_objectSpread(_objectSpread({}, options), {}, {
40
43
  getIntl: getIntl,
41
- appearance: options.appearance
44
+ appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
42
45
  }));
43
46
  }
44
47
  }, {
@@ -48,8 +51,8 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
48
51
  }
49
52
  }, {
50
53
  name: 'codeBlockKeyMap',
51
- plugin: function plugin(_ref2) {
52
- var schema = _ref2.schema;
54
+ plugin: function plugin(_ref3) {
55
+ var schema = _ref3.schema;
53
56
  return (0, _keymaps.default)(schema);
54
57
  }
55
58
  }, {
@@ -65,8 +68,8 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
65
68
  (0, _refreshBrowserSelection.default)(props.originalTransaction, props.newEditorState);
66
69
  },
67
70
  pluginsOptions: {
68
- quickInsert: function quickInsert(_ref3) {
69
- var formatMessage = _ref3.formatMessage;
71
+ quickInsert: function quickInsert(_ref4) {
72
+ var formatMessage = _ref4.formatMessage;
70
73
  return [{
71
74
  id: 'codeblock',
72
75
  title: formatMessage(_messages.messages.codeblock),
@@ -78,11 +81,11 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
78
81
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconCode, null);
79
82
  },
80
83
  action: function action(insert, state) {
81
- var _api$dependencies$ana;
84
+ var _api$analytics;
82
85
  var tr = (0, _blockType.createInsertCodeBlockTransaction)({
83
86
  state: state
84
87
  });
85
- 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.attachAnalyticsEvent({
88
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent({
86
89
  action: _analytics.ACTION.INSERTED,
87
90
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
88
91
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.CODE_BLOCK,
@@ -95,7 +98,7 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
95
98
  }
96
99
  }];
97
100
  },
98
- floatingToolbar: (0, _toolbar.getToolbarConfig)(options.allowCopyToClipboard, api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration)
101
+ floatingToolbar: (0, _toolbar.getToolbarConfig)(options === null || options === void 0 ? void 0 : options.allowCopyToClipboard, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration)
99
102
  }
100
103
  };
101
104
  };
@@ -19,10 +19,10 @@ var ideUX = function ideUX(pluginInjectionApi) {
19
19
  return new _safePlugin.SafePlugin({
20
20
  props: {
21
21
  handleTextInput: function handleTextInput(view, from, to, text) {
22
- var _pluginInjectionApi$d;
22
+ var _pluginInjectionApi$c;
23
23
  var state = view.state,
24
24
  dispatch = view.dispatch;
25
- var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.composition) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.sharedState.currentState();
25
+ var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.composition) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.sharedState.currentState();
26
26
  if ((0, _lineHandling.isCursorInsideCodeBlock)(state) && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
27
27
  var beforeText = (0, _lineHandling.getStartOfCurrentLine)(state).text;
28
28
  var afterText = (0, _lineHandling.getEndOfCurrentLine)(state).text;
@@ -59,9 +59,11 @@ var providerBuilder = function providerBuilder(collabEditProviderPromise) {
59
59
  };
60
60
  }();
61
61
  };
62
- var collabEditPlugin = function collabEditPlugin(options, api) {
63
- var _api$dependencies, _api$dependencies$fea;
64
- 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()) || {};
62
+ var collabEditPlugin = function collabEditPlugin(_ref2) {
63
+ var _api$featureFlags;
64
+ var options = _ref2.config,
65
+ api = _ref2.api;
66
+ var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
65
67
  var providerResolver = function providerResolver() {};
66
68
  var collabEditProviderPromise = new Promise(function (_providerResolver) {
67
69
  providerResolver = _providerResolver;
@@ -70,11 +72,11 @@ var collabEditPlugin = function collabEditPlugin(options, api) {
70
72
  return {
71
73
  name: 'collabEdit',
72
74
  pmPlugins: function pmPlugins() {
73
- var _ref2 = options || {},
74
- _ref2$useNativePlugin = _ref2.useNativePlugin,
75
- useNativePlugin = _ref2$useNativePlugin === void 0 ? false : _ref2$useNativePlugin,
76
- _ref2$userId = _ref2.userId,
77
- userId = _ref2$userId === void 0 ? null : _ref2$userId;
75
+ var _ref3 = options || {},
76
+ _ref3$useNativePlugin = _ref3.useNativePlugin,
77
+ useNativePlugin = _ref3$useNativePlugin === void 0 ? false : _ref3$useNativePlugin,
78
+ _ref3$userId = _ref3.userId,
79
+ userId = _ref3$userId === void 0 ? null : _ref3$userId;
78
80
  return [].concat((0, _toConsumableArray2.default)(useNativePlugin ? [{
79
81
  name: 'pmCollab',
80
82
  plugin: function plugin() {
@@ -91,22 +93,22 @@ var collabEditPlugin = function collabEditPlugin(options, api) {
91
93
  }
92
94
  }] : []), [{
93
95
  name: 'collab',
94
- plugin: function plugin(_ref3) {
95
- var dispatch = _ref3.dispatch,
96
- providerFactory = _ref3.providerFactory;
96
+ plugin: function plugin(_ref4) {
97
+ var dispatch = _ref4.dispatch,
98
+ providerFactory = _ref4.providerFactory;
97
99
  return (0, _plugin.createPlugin)(dispatch, providerFactory, providerResolver, executeProviderCode, options, featureFlags, api);
98
100
  }
99
101
  }]);
100
102
  },
101
103
  onEditorViewStateUpdated: function onEditorViewStateUpdated(props) {
102
- var _api$dependencies$ana;
103
- var addErrorAnalytics = (0, _analytics.addSynchronyErrorAnalytics)(props.newEditorState, props.newEditorState.tr, featureFlags, 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);
104
+ var _api$analytics, _options$useNativePlu;
105
+ var addErrorAnalytics = (0, _analytics.addSynchronyErrorAnalytics)(props.newEditorState, props.newEditorState.tr, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
104
106
  executeProviderCode((0, _sendTransaction.sendTransaction)({
105
107
  originalTransaction: props.originalTransaction,
106
108
  transactions: props.transactions,
107
109
  oldEditorState: props.oldEditorState,
108
110
  newEditorState: props.newEditorState,
109
- useNativePlugin: options && options.useNativePlugin
111
+ useNativePlugin: (_options$useNativePlu = options === null || options === void 0 ? void 0 : options.useNativePlugin) !== null && _options$useNativePlu !== void 0 ? _options$useNativePlu : false
110
112
  }), addErrorAnalytics);
111
113
  }
112
114
  };