@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
@@ -113,8 +113,8 @@ class ResizableMediaSingleNext extends React.Component {
113
113
  });
114
114
  _defineProperty(this, "saveWrapper", wrapper => this.wrapper = wrapper);
115
115
  _defineProperty(this, "displayGuideline", guidelines => {
116
- var _this$props$pluginInj, _this$props$pluginInj2, _this$props$pluginInj3, _this$props$pluginInj4;
117
- return (_this$props$pluginInj = this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 ? void 0 : (_this$props$pluginInj2 = _this$props$pluginInj.dependencies) === null || _this$props$pluginInj2 === void 0 ? void 0 : (_this$props$pluginInj3 = _this$props$pluginInj2.guideline) === null || _this$props$pluginInj3 === void 0 ? void 0 : (_this$props$pluginInj4 = _this$props$pluginInj3.actions) === null || _this$props$pluginInj4 === void 0 ? void 0 : _this$props$pluginInj4.displayGuideline(this.props.view)({
116
+ var _this$props$pluginInj, _this$props$pluginInj2, _this$props$pluginInj3;
117
+ return (_this$props$pluginInj = this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 ? void 0 : (_this$props$pluginInj2 = _this$props$pluginInj.guideline) === null || _this$props$pluginInj2 === void 0 ? void 0 : (_this$props$pluginInj3 = _this$props$pluginInj2.actions) === null || _this$props$pluginInj3 === void 0 ? void 0 : _this$props$pluginInj3.displayGuideline(this.props.view)({
118
118
  guidelines
119
119
  });
120
120
  });
@@ -146,8 +146,8 @@ class ResizableMediaSingleNext extends React.Component {
146
146
  return Math.min(contentWidth || akEditorDefaultLayoutWidth, isVideoFile ? MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH : MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH);
147
147
  }));
148
148
  _defineProperty(this, "getRelativeGuides", () => {
149
- var _this$props$pluginInj5, _this$props$pluginInj6, _this$props$pluginInj7, _this$props$pluginInj8;
150
- const guidelinePluginState = (_this$props$pluginInj5 = this.props.pluginInjectionApi) === null || _this$props$pluginInj5 === void 0 ? void 0 : (_this$props$pluginInj6 = _this$props$pluginInj5.dependencies) === null || _this$props$pluginInj6 === void 0 ? void 0 : (_this$props$pluginInj7 = _this$props$pluginInj6.guideline) === null || _this$props$pluginInj7 === void 0 ? void 0 : (_this$props$pluginInj8 = _this$props$pluginInj7.sharedState) === null || _this$props$pluginInj8 === void 0 ? void 0 : _this$props$pluginInj8.currentState();
149
+ var _this$props$pluginInj4, _this$props$pluginInj5, _this$props$pluginInj6;
150
+ const guidelinePluginState = (_this$props$pluginInj4 = this.props.pluginInjectionApi) === null || _this$props$pluginInj4 === void 0 ? void 0 : (_this$props$pluginInj5 = _this$props$pluginInj4.guideline) === null || _this$props$pluginInj5 === void 0 ? void 0 : (_this$props$pluginInj6 = _this$props$pluginInj5.sharedState) === null || _this$props$pluginInj6 === void 0 ? void 0 : _this$props$pluginInj6.currentState();
151
151
  const {
152
152
  top: topOffset
153
153
  } = (guidelinePluginState === null || guidelinePluginState === void 0 ? void 0 : guidelinePluginState.rect) || {
@@ -19,12 +19,12 @@ export default class ResizableMediaSingle extends React.Component {
19
19
  isVideoFile: true
20
20
  });
21
21
  _defineProperty(this, "displayGrid", (visible, gridType, highlight) => {
22
- var _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$d3;
22
+ var _pluginInjectionApi$g, _pluginInjectionApi$g2;
23
23
  const {
24
24
  pluginInjectionApi,
25
25
  view
26
26
  } = this.props;
27
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.grid) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : (_pluginInjectionApi$d3 = _pluginInjectionApi$d2.actions) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.displayGrid(view)({
27
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$g = pluginInjectionApi.grid) === null || _pluginInjectionApi$g === void 0 ? void 0 : (_pluginInjectionApi$g2 = _pluginInjectionApi$g.actions) === null || _pluginInjectionApi$g2 === void 0 ? void 0 : _pluginInjectionApi$g2.displayGrid(view)({
28
28
  visible,
29
29
  gridType,
30
30
  highlight: highlight
@@ -175,15 +175,33 @@ export function transformSliceForMedia(slice, schema) {
175
175
  orderedList,
176
176
  media,
177
177
  mediaInline,
178
- expand
178
+ expand,
179
+ nestedExpand
179
180
  } = schema.nodes;
180
181
  return selection => {
181
182
  let newSlice = slice;
182
- if (hasParentNodeOfType([layoutSection, table, bulletList, orderedList, expand])(selection)) {
183
+ if (hasParentNodeOfType([layoutSection, table, bulletList, orderedList, expand, nestedExpand])(selection)) {
183
184
  newSlice = mapSlice(newSlice, node => {
184
- const attrs = hasParentNodeOfType([layoutSection, table])(selection) ? {
185
+ const extendedOrLegacyAttrs = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
186
+ layout: node.attrs.layout,
187
+ widthType: node.attrs.widthType,
188
+ width: node.attrs.width
189
+ } : {
185
190
  layout: node.attrs.layout
186
- } : {};
191
+ };
192
+ let attrs = {};
193
+ if (hasParentNodeOfType([layoutSection, table])(selection)) {
194
+ // Supports layouts
195
+ attrs = {
196
+ ...extendedOrLegacyAttrs
197
+ };
198
+ } else if (hasParentNodeOfType([bulletList, orderedList, expand, nestedExpand])(selection)) {
199
+ // does not support other layouts
200
+ attrs = {
201
+ ...extendedOrLegacyAttrs,
202
+ layout: 'center'
203
+ };
204
+ }
187
205
  return node.type.name === 'mediaSingle' ? mediaSingle.createChecked(attrs, node.content, node.marks) : node;
188
206
  });
189
207
  }
@@ -18,13 +18,16 @@ const getSharedState = editorState => {
18
18
  }
19
19
  return mentionPluginKey.getState(editorState);
20
20
  };
21
- const mentionsPlugin = (options, api) => {
21
+ const mentionsPlugin = ({
22
+ config: options,
23
+ api
24
+ }) => {
22
25
  let sessionId = uuid();
23
26
  const fireEvent = payload => {
24
- var _api$dependencies$ana, _api$dependencies$ana2;
27
+ var _api$analytics$shared, _api$analytics;
25
28
  const {
26
29
  createAnalyticsEvent
27
- } = (_api$dependencies$ana = api === null || api === void 0 ? void 0 : (_api$dependencies$ana2 = api.dependencies.analytics) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.sharedState.currentState()) !== null && _api$dependencies$ana !== void 0 ? _api$dependencies$ana : {};
30
+ } = (_api$analytics$shared = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.sharedState.currentState()) !== null && _api$analytics$shared !== void 0 ? _api$analytics$shared : {};
28
31
  if (!createAnalyticsEvent) {
29
32
  return;
30
33
  }
@@ -83,19 +86,19 @@ const mentionsPlugin = (options, api) => {
83
86
  keyshortcut: '@',
84
87
  icon: () => /*#__PURE__*/React.createElement(IconMention, null),
85
88
  action(insert, state) {
86
- var _api$dependencies$ana3;
89
+ var _api$analytics2;
87
90
  const tr = insert(undefined);
88
91
  const pluginState = getSharedState(state);
89
92
  if (pluginState && pluginState.canInsertMention === false) {
90
93
  return false;
91
94
  }
92
- api === null || api === void 0 ? void 0 : api.dependencies.typeAhead.commands.openTypeAheadAtCursor({
95
+ api === null || api === void 0 ? void 0 : api.typeAhead.commands.openTypeAheadAtCursor({
93
96
  triggerHandler: typeAhead,
94
97
  inputMethod: INPUT_METHOD.QUICK_INSERT
95
98
  })({
96
99
  tr
97
100
  });
98
- 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.attachAnalyticsEvent({
101
+ api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
99
102
  action: ACTION.INVOKED,
100
103
  actionSubject: ACTION_SUBJECT.TYPEAHEAD,
101
104
  actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_MENTION,
@@ -12,7 +12,10 @@ import { T50 } from '@atlaskit/theme/colors';
12
12
  // Insertions via the drop down menu
13
13
  // tslint-ignore-next-line
14
14
  import { createWrapSelectionTransaction } from '../block-type/commands/block-type';
15
- const panelPlugin = (options = {}, api) => ({
15
+ const panelPlugin = ({
16
+ config: options = {},
17
+ api
18
+ }) => ({
16
19
  name: 'panel',
17
20
  nodes() {
18
21
  const panelNode = panel(!!options.allowCustomPanel);
@@ -135,7 +138,7 @@ const panelPlugin = (options = {}, api) => ({
135
138
  }
136
139
  return quickInsertOptions;
137
140
  },
138
- floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory, api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration)
141
+ floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration)
139
142
  }
140
143
  });
141
144
 
@@ -1,10 +1,14 @@
1
1
  import { createPlugin } from './pm-plugins/main';
2
2
  const pastePlugin = ({
3
- cardOptions,
4
- sanitizePrivateContent
5
- }, api) => {
6
- var _api$dependencies, _api$dependencies$fea;
7
- const 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()) || {};
3
+ config,
4
+ api
5
+ }) => {
6
+ var _api$featureFlags;
7
+ const {
8
+ cardOptions,
9
+ sanitizePrivateContent
10
+ } = config !== null && config !== void 0 ? config : {};
11
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
8
12
  return {
9
13
  name: 'paste',
10
14
  pmPlugins() {
@@ -227,10 +227,10 @@ export const handlePasteAsPlainTextWithAnalytics = (view, event, slice) => injec
227
227
  asPlain: true
228
228
  }))(handlePasteAsPlainText(slice, event));
229
229
  export const handlePasteIntoTaskAndDecisionWithAnalytics = (view, event, slice, type, pluginInjectionApi) => {
230
- var _pluginInjectionApi$d, _pluginInjectionApi$d2;
230
+ var _pluginInjectionApi$c, _pluginInjectionApi$c2;
231
231
  return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
232
232
  type
233
- }))(handlePasteIntoTaskOrDecisionOrPanel(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.actions) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.queueCardsFromChangedTr));
233
+ }))(handlePasteIntoTaskOrDecisionOrPanel(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr));
234
234
  };
235
235
  export const handlePasteIntoCaptionWithAnalytics = (view, event, slice, type) => injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
236
236
  type
@@ -242,22 +242,22 @@ export const handleMediaSingleWithAnalytics = (view, event, slice, type, editorA
242
242
  type
243
243
  }))(handleMediaSingle(INPUT_METHOD.CLIPBOARD, editorAnalyticsAPI)(slice));
244
244
  export const handlePastePreservingMarksWithAnalytics = (view, event, slice, type, pluginInjectionApi) => {
245
- var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
245
+ var _pluginInjectionApi$c3, _pluginInjectionApi$c4;
246
246
  return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
247
247
  type
248
- }))(handlePastePreservingMarks(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d3 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : (_pluginInjectionApi$d4 = _pluginInjectionApi$d3.actions) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : _pluginInjectionApi$d4.queueCardsFromChangedTr));
248
+ }))(handlePastePreservingMarks(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.actions) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.queueCardsFromChangedTr));
249
249
  };
250
250
  export const handleMarkdownWithAnalytics = (view, event, slice, pluginInjectionApi) => {
251
- var _pluginInjectionApi$d5, _pluginInjectionApi$d6;
251
+ var _pluginInjectionApi$c5, _pluginInjectionApi$c6;
252
252
  return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
253
253
  type: PasteTypes.markdown
254
- }))(handleMarkdown(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d5 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : (_pluginInjectionApi$d6 = _pluginInjectionApi$d5.actions) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.queueCardsFromChangedTr));
254
+ }))(handleMarkdown(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c5 = pluginInjectionApi.card) === null || _pluginInjectionApi$c5 === void 0 ? void 0 : (_pluginInjectionApi$c6 = _pluginInjectionApi$c5.actions) === null || _pluginInjectionApi$c6 === void 0 ? void 0 : _pluginInjectionApi$c6.queueCardsFromChangedTr));
255
255
  };
256
256
  export const handleRichTextWithAnalytics = (view, event, slice, pluginInjectionApi) => {
257
- var _pluginInjectionApi$d7, _pluginInjectionApi$d8;
257
+ var _pluginInjectionApi$c7, _pluginInjectionApi$c8;
258
258
  return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
259
259
  type: PasteTypes.richText
260
- }))(handleRichText(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d7 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d7 === void 0 ? void 0 : (_pluginInjectionApi$d8 = _pluginInjectionApi$d7.actions) === null || _pluginInjectionApi$d8 === void 0 ? void 0 : _pluginInjectionApi$d8.queueCardsFromChangedTr));
260
+ }))(handleRichText(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c7 = pluginInjectionApi.card) === null || _pluginInjectionApi$c7 === void 0 ? void 0 : (_pluginInjectionApi$c8 = _pluginInjectionApi$c7.actions) === null || _pluginInjectionApi$c8 === void 0 ? void 0 : _pluginInjectionApi$c8.queueCardsFromChangedTr));
261
261
  };
262
262
  function injectAnalyticsPayloadBeforeCommand(createPayloadByTransaction) {
263
263
  return mainCommand => {
@@ -77,7 +77,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
77
77
  }
78
78
  },
79
79
  handlePaste(view, rawEvent, slice) {
80
- var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$d4, _pluginInjectionApi$d5;
80
+ var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$a;
81
81
  const event = rawEvent;
82
82
  if (!event.clipboardData) {
83
83
  return false;
@@ -177,9 +177,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
177
177
  });
178
178
  return tableExists;
179
179
  });
180
- if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.dependencies.betterTypeHistory) {
181
- var _pluginInjectionApi$d;
182
- tr = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.betterTypeHistory) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.flagPasteEvent(tr);
180
+ if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.betterTypeHistory) {
181
+ var _pluginInjectionApi$b;
182
+ tr = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$b = pluginInjectionApi.betterTypeHistory) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.flagPasteEvent(tr);
183
183
  }
184
184
  addLinkMetadata(view.state.selection, tr, {
185
185
  action: isPlainText ? ACTION.PASTED_AS_PLAIN : ACTION.PASTED,
@@ -207,14 +207,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
207
207
  // force a "paste as plain text" action by clearing the markdownSlice.
208
208
  markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
209
209
  if (markdownSlice) {
210
- var _pluginInjectionApi$d2, _pluginInjectionApi$d3;
210
+ var _pluginInjectionApi$c, _pluginInjectionApi$c2;
211
211
  // linkify text prior to converting to macro
212
212
  if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
213
213
  return true;
214
214
  }
215
215
 
216
216
  // run macro autoconvert prior to other conversions
217
- if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : (_pluginInjectionApi$d3 = _pluginInjectionApi$d2.actions) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
217
+ if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
218
218
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
219
219
  sendPasteAnalyticsEvent(view, event, markdownSlice, {
220
220
  type: PasteTypes.markdown
@@ -246,7 +246,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
246
246
  if (handleCodeBlockWithAnalytics(view, event, slice, text)(state, dispatch)) {
247
247
  return true;
248
248
  }
249
- if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.analytics) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions)(state, dispatch, view)) {
249
+ if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(state, dispatch, view)) {
250
250
  return true;
251
251
  }
252
252
  if (handleSelectedTableWithAnalytics(view, event, slice)(state, dispatch)) {
@@ -281,7 +281,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
281
281
 
282
282
  // finally, handle rich-text copy-paste
283
283
  if (isRichText) {
284
- var _pluginInjectionApi$d6, _pluginInjectionApi$d7, _pluginInjectionApi$d8;
284
+ var _pluginInjectionApi$c3, _pluginInjectionApi$c4, _pluginInjectionApi$l;
285
285
  // linkify the text where possible
286
286
  slice = linkifyContent(state.schema)(slice);
287
287
  if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
@@ -289,7 +289,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
289
289
  }
290
290
 
291
291
  // run macro autoconvert prior to other conversions
292
- if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : (_pluginInjectionApi$d7 = _pluginInjectionApi$d6.actions) === null || _pluginInjectionApi$d7 === void 0 ? void 0 : _pluginInjectionApi$d7.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
292
+ if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.actions) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
293
293
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
294
294
  sendPasteAnalyticsEvent(view, event, slice, {
295
295
  type: PasteTypes.richText
@@ -344,7 +344,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
344
344
  if (handlePasteIntoCaptionWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
345
345
  return true;
346
346
  }
347
- if (handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d8 = pluginInjectionApi.dependencies.list) === null || _pluginInjectionApi$d8 === void 0 ? void 0 : _pluginInjectionApi$d8.actions.findRootParentListNode)(state, dispatch)) {
347
+ if (handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$l = pluginInjectionApi.list) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.findRootParentListNode)(state, dispatch)) {
348
348
  return true;
349
349
  }
350
350
  if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && handlePasteNonNestableBlockNodesIntoListWithAnalytics(view, event, slice)(state, dispatch)) {
@@ -74,13 +74,13 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
74
74
  key: pluginKey,
75
75
  state: {
76
76
  init: (_, state) => {
77
- var _api$dependencies$foc, _api$dependencies$foc2;
78
- return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus) === null || _api$dependencies$foc === void 0 ? void 0 : (_api$dependencies$foc2 = _api$dependencies$foc.sharedState.currentState()) === null || _api$dependencies$foc2 === void 0 ? void 0 : _api$dependencies$foc2.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
77
+ var _api$focus, _api$focus$sharedStat;
78
+ return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
79
79
  },
80
80
  apply: (tr, _oldPluginState, _oldEditorState, newEditorState) => {
81
- var _api$dependencies$foc3, _api$dependencies$foc4;
81
+ var _api$focus2, _api$focus2$sharedSta;
82
82
  const meta = tr.getMeta(pluginKey);
83
- const isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc3 = api.dependencies.focus) === null || _api$dependencies$foc3 === void 0 ? void 0 : (_api$dependencies$foc4 = _api$dependencies$foc3.sharedState.currentState()) === null || _api$dependencies$foc4 === void 0 ? void 0 : _api$dependencies$foc4.hasFocus);
83
+ const isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$focus2 = api.focus) === null || _api$focus2 === void 0 ? void 0 : (_api$focus2$sharedSta = _api$focus2.sharedState.currentState()) === null || _api$focus2$sharedSta === void 0 ? void 0 : _api$focus2$sharedSta.hasFocus);
84
84
  if (meta) {
85
85
  if (meta.removePlaceholder) {
86
86
  return emptyPlaceholder;
@@ -94,13 +94,13 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
94
94
  },
95
95
  props: {
96
96
  decorations(editorState) {
97
- var _api$dependencies$com;
97
+ var _api$composition;
98
98
  const {
99
99
  hasPlaceholder,
100
100
  placeholderText,
101
101
  pos
102
102
  } = getPlaceholderState(editorState);
103
- const compositionPluginState = api === null || api === void 0 ? void 0 : (_api$dependencies$com = api.dependencies.composition) === null || _api$dependencies$com === void 0 ? void 0 : _api$dependencies$com.sharedState.currentState();
103
+ const compositionPluginState = api === null || api === void 0 ? void 0 : (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
104
104
  if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
105
105
  return createPlaceholderDecoration(editorState, placeholderText, pos);
106
106
  }
@@ -109,7 +109,10 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
109
109
  }
110
110
  });
111
111
  }
112
- const placeholderPlugin = (options, api) => ({
112
+ const placeholderPlugin = ({
113
+ config: options,
114
+ api
115
+ }) => ({
113
116
  name: 'placeholder',
114
117
  pmPlugins() {
115
118
  return [{
@@ -124,7 +124,9 @@ export function createPlugin(dispatch, options) {
124
124
  }
125
125
  });
126
126
  }
127
- const basePlaceholderTextPlugin = options => ({
127
+ const basePlaceholderTextPlugin = ({
128
+ config: options
129
+ }) => ({
128
130
  name: 'placeholderText',
129
131
  nodes() {
130
132
  return [{
@@ -192,12 +194,12 @@ const decorateWithPluginOptions = (plugin, options, api) => {
192
194
  label: ""
193
195
  }),
194
196
  action(insert, state) {
195
- var _api$dependencies$ana;
197
+ var _api$analytics;
196
198
  const tr = state.tr;
197
199
  tr.setMeta(pluginKey, {
198
200
  showInsertPanelAt: tr.selection.anchor
199
201
  });
200
- 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({
202
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent({
201
203
  action: ACTION.INSERTED,
202
204
  actionSubject: ACTION_SUBJECT.DOCUMENT,
203
205
  actionSubjectId: ACTION_SUBJECT_ID.PLACEHOLDER_TEXT,
@@ -212,5 +214,11 @@ const decorateWithPluginOptions = (plugin, options, api) => {
212
214
  };
213
215
  return plugin;
214
216
  };
215
- const placeholderTextPlugin = (options, api) => decorateWithPluginOptions(basePlaceholderTextPlugin(options, api), options, api);
217
+ const placeholderTextPlugin = ({
218
+ config: options = {},
219
+ api
220
+ }) => decorateWithPluginOptions(basePlaceholderTextPlugin({
221
+ config: options,
222
+ api
223
+ }), options, api);
216
224
  export default placeholderTextPlugin;
@@ -6,7 +6,9 @@ import { search } from './search';
6
6
  import ModalElementBrowser from './ui/ModalElementBrowser';
7
7
  import { openElementBrowserModal, insertItem } from './commands';
8
8
  import { memoProcessQuickInsertItems, getQuickInsertSuggestions } from '@atlaskit/editor-common/quick-insert';
9
- const quickInsertPlugin = options => ({
9
+ const quickInsertPlugin = ({
10
+ config: options
11
+ }) => ({
10
12
  name: 'quickInsert',
11
13
  pmPlugins(defaultItems) {
12
14
  return [{
@@ -5,9 +5,11 @@ import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
5
5
  import { IconDivider } from '@atlaskit/editor-common/quick-insert';
6
6
  import inputRulePlugin from './pm-plugins/input-rule';
7
7
  import keymapPlugin from './pm-plugins/keymap';
8
- const rulePlugin = (_, api) => {
9
- var _api$dependencies, _api$dependencies$fea;
10
- const 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()) || {};
8
+ const rulePlugin = ({
9
+ api
10
+ }) => {
11
+ var _api$featureFlags;
12
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
11
13
  return {
12
14
  name: 'rule',
13
15
  nodes() {
@@ -47,7 +47,9 @@ const analyticsPayload = state => ({
47
47
  eventType: EVENT_TYPE.UI
48
48
  }
49
49
  });
50
- const saveOnEnterPlugin = onSave => ({
50
+ const saveOnEnterPlugin = ({
51
+ config: onSave
52
+ }) => ({
51
53
  name: 'saveOnEnter',
52
54
  pmPlugins() {
53
55
  return [{
@@ -2,7 +2,9 @@ import { createPlugin } from './pm-plugins/selection-main';
2
2
  import selectionKeymapPlugin from './pm-plugins/keymap';
3
3
  import gapCursorPlugin from './pm-plugins/gap-cursor-main';
4
4
  import gapCursorKeymapPlugin from './pm-plugins/gap-cursor-keymap';
5
- export const selectionPlugin = options => ({
5
+ export const selectionPlugin = ({
6
+ config: options
7
+ }) => ({
6
8
  name: 'selection',
7
9
  pmPlugins() {
8
10
  return [{
@@ -10,7 +10,9 @@ import { keymapPlugin } from './keymap';
10
10
  import createStatusPlugin from './plugin';
11
11
  import { pluginKey } from './plugin-key';
12
12
  import StatusPicker from './ui/statusPicker';
13
- const baseStatusPlugin = options => ({
13
+ const baseStatusPlugin = ({
14
+ config: options
15
+ }) => ({
14
16
  name: 'status',
15
17
  nodes() {
16
18
  return [{
@@ -84,7 +86,7 @@ const baseStatusPlugin = options => ({
84
86
  }
85
87
  });
86
88
  const decorateWithPluginOptions = (plugin, options) => {
87
- if (options.menuDisabled === true) {
89
+ if ((options === null || options === void 0 ? void 0 : options.menuDisabled) === true) {
88
90
  return plugin;
89
91
  }
90
92
  plugin.pluginsOptions = {
@@ -112,5 +114,11 @@ const decorateWithPluginOptions = (plugin, options) => {
112
114
  };
113
115
  return plugin;
114
116
  };
115
- const statusPlugin = (options, api) => decorateWithPluginOptions(baseStatusPlugin(options, api), options);
117
+ const statusPlugin = ({
118
+ config: options,
119
+ api
120
+ }) => decorateWithPluginOptions(baseStatusPlugin({
121
+ config: options,
122
+ api
123
+ }), options);
116
124
  export default statusPlugin;
@@ -36,7 +36,9 @@ const analyticsPayload = state => ({
36
36
  eventType: EVENT_TYPE.UI
37
37
  }
38
38
  });
39
- const submitEditorPlugin = onSave => ({
39
+ const submitEditorPlugin = ({
40
+ config: onSave
41
+ }) => ({
40
42
  name: 'submitEditor',
41
43
  pmPlugins() {
42
44
  return [{
@@ -28,10 +28,12 @@ const addItem = (insert, listType, schema) => ({
28
28
  })));
29
29
  };
30
30
  const tasksAndDecisionsPlugin = ({
31
- allowNestedTasks,
32
- consumeTabs,
33
- useLongPressSelection
34
- } = {}) => ({
31
+ config: {
32
+ allowNestedTasks,
33
+ consumeTabs,
34
+ useLongPressSelection
35
+ } = {}
36
+ }) => ({
35
37
  name: 'taskDecision',
36
38
  nodes() {
37
39
  return [{
@@ -9,9 +9,12 @@ const pluginConfig = textColorConfig => {
9
9
  }
10
10
  return textColorConfig;
11
11
  };
12
- const textColorPlugin = (textColorConfig, api) => {
13
- var _api$dependencies, _api$dependencies$fea;
14
- const 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()) || {};
12
+ const textColorPlugin = ({
13
+ config: textColorConfig,
14
+ api
15
+ }) => {
16
+ var _api$featureFlags;
17
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
15
18
  return {
16
19
  name: 'textColor',
17
20
  marks() {
@@ -5,11 +5,15 @@ import { ToolbarSize } from '../../ui/Toolbar/types';
5
5
  import { createPlugin as indentationButtonsPlugin } from './pm-plugins/indentation-buttons';
6
6
  import { pluginKey as indentationButtonPluginKey } from './pm-plugins/indentation-buttons';
7
7
  const toolbarListsIndentationPlugin = ({
8
- showIndentationButtons,
9
- allowHeadingAndParagraphIndentation
10
- }, api) => {
11
- var _api$dependencies$fea;
12
- const 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()) || {};
8
+ config,
9
+ api
10
+ }) => {
11
+ var _api$featureFlags;
12
+ const {
13
+ showIndentationButtons = false,
14
+ allowHeadingAndParagraphIndentation = false
15
+ } = config !== null && config !== void 0 ? config : {};
16
+ const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
13
17
  return {
14
18
  name: 'toolbarListsIndentation',
15
19
  getSharedState(editorState) {
@@ -21,7 +21,7 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
21
21
  // not use the indentation mark.
22
22
  // Check for lists before paragraphs and headings in case
23
23
  // the selection is in a list nested in a layout column.
24
- if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState.tr)) {
24
+ if (api !== null && api !== void 0 && api.list.actions.isInsideListItem(editorState.tr)) {
25
25
  const {
26
26
  indentLevel,
27
27
  itemIndex
@@ -8,10 +8,10 @@ export const onItemActivated = pluginInjectionApi => ({
8
8
  }) => {
9
9
  switch (buttonName) {
10
10
  case 'bullet_list':
11
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.toggleBulletList(INPUT_METHOD.TOOLBAR));
11
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleBulletList(INPUT_METHOD.TOOLBAR));
12
12
  break;
13
13
  case 'ordered_list':
14
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.toggleOrderedList(INPUT_METHOD.TOOLBAR));
14
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleOrderedList(INPUT_METHOD.TOOLBAR));
15
15
  break;
16
16
  case 'indent':
17
17
  {
@@ -21,7 +21,7 @@ export const onItemActivated = pluginInjectionApi => ({
21
21
  indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
22
22
  }
23
23
  if (node === 'list') {
24
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.indentList(INPUT_METHOD.TOOLBAR));
24
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(INPUT_METHOD.TOOLBAR));
25
25
  }
26
26
  if (node === 'taskList') {
27
27
  indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -36,7 +36,7 @@ export const onItemActivated = pluginInjectionApi => ({
36
36
  outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
37
37
  }
38
38
  if (node === 'list') {
39
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.outdentList(INPUT_METHOD.TOOLBAR));
39
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(INPUT_METHOD.TOOLBAR));
40
40
  }
41
41
  if (node === 'taskList') {
42
42
  outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -111,7 +111,9 @@ const TypeAheadMenu = /*#__PURE__*/React.memo(({
111
111
  *
112
112
  *
113
113
  */
114
- const typeAheadPlugin = options => {
114
+ const typeAheadPlugin = ({
115
+ config: options
116
+ }) => {
115
117
  const fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
116
118
  const popupMountRef = {
117
119
  current: null