@atlaskit/editor-core 188.5.0 → 188.6.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 (150) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/labs/next/presets/default.js +2 -2
  3. package/dist/cjs/labs/next/presets/universal.js +1 -6
  4. package/dist/cjs/plugins/expand/index.js +0 -2
  5. package/dist/cjs/plugins/expand/nodeviews/index.js +37 -13
  6. package/dist/cjs/plugins/index.js +0 -7
  7. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +30 -29
  8. package/dist/cjs/plugins/status/actions.js +14 -11
  9. package/dist/cjs/plugins/status/index.js +17 -8
  10. package/dist/cjs/plugins/status/keymap.js +1 -1
  11. package/dist/cjs/plugins/status/ui/statusPicker.js +2 -2
  12. package/dist/cjs/ui/Addon/click-area-helper.js +9 -11
  13. package/dist/cjs/ui/ContentStyles/index.js +13 -13
  14. package/dist/cjs/utils/selection.js +12 -14
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/es2019/labs/next/presets/default.js +1 -1
  17. package/dist/es2019/labs/next/presets/universal.js +1 -6
  18. package/dist/es2019/plugins/expand/index.js +0 -2
  19. package/dist/es2019/plugins/expand/nodeviews/index.js +37 -13
  20. package/dist/es2019/plugins/index.js +0 -1
  21. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -3
  22. package/dist/es2019/plugins/status/actions.js +3 -2
  23. package/dist/es2019/plugins/status/index.js +91 -80
  24. package/dist/es2019/plugins/status/keymap.js +1 -1
  25. package/dist/es2019/plugins/status/ui/statusPicker.js +1 -1
  26. package/dist/es2019/ui/Addon/click-area-helper.js +4 -6
  27. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  28. package/dist/es2019/utils/selection.js +2 -17
  29. package/dist/es2019/version-wrapper.js +1 -1
  30. package/dist/esm/labs/next/presets/default.js +1 -1
  31. package/dist/esm/labs/next/presets/universal.js +1 -6
  32. package/dist/esm/plugins/expand/index.js +0 -2
  33. package/dist/esm/plugins/expand/nodeviews/index.js +37 -13
  34. package/dist/esm/plugins/index.js +0 -1
  35. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +30 -29
  36. package/dist/esm/plugins/status/actions.js +14 -11
  37. package/dist/esm/plugins/status/index.js +17 -8
  38. package/dist/esm/plugins/status/keymap.js +1 -1
  39. package/dist/esm/plugins/status/ui/statusPicker.js +1 -1
  40. package/dist/esm/ui/Addon/click-area-helper.js +4 -6
  41. package/dist/esm/ui/ContentStyles/index.js +1 -1
  42. package/dist/esm/utils/selection.js +2 -13
  43. package/dist/esm/version-wrapper.js +1 -1
  44. package/dist/types/labs/next/presets/default.d.ts +22 -8
  45. package/dist/types/plugins/expand/index.d.ts +1 -1
  46. package/dist/types/plugins/expand/nodeviews/index.d.ts +3 -2
  47. package/dist/types/plugins/index.d.ts +0 -1
  48. package/dist/types/plugins/insert-block/types.d.ts +3 -1
  49. package/dist/types/plugins/status/actions.d.ts +4 -2
  50. package/dist/types/plugins/status/index.d.ts +12 -3
  51. package/dist/types/plugins/status/nodeviews/status.d.ts +1 -1
  52. package/dist/types/plugins/status/plugin.d.ts +1 -1
  53. package/dist/types/utils/selection.d.ts +1 -4
  54. package/package.json +4 -3
  55. package/dist/cjs/plugins/selection/actions.js +0 -11
  56. package/dist/cjs/plugins/selection/commands.js +0 -257
  57. package/dist/cjs/plugins/selection/gap-cursor/actions.js +0 -272
  58. package/dist/cjs/plugins/selection/gap-cursor/direction.js +0 -23
  59. package/dist/cjs/plugins/selection/gap-cursor/selection.js +0 -30
  60. package/dist/cjs/plugins/selection/gap-cursor/styles.js +0 -17
  61. package/dist/cjs/plugins/selection/gap-cursor/utils/is-ignored.js +0 -12
  62. package/dist/cjs/plugins/selection/gap-cursor/utils/is-valid-target-node.js +0 -12
  63. package/dist/cjs/plugins/selection/gap-cursor/utils/place-gap-cursor.js +0 -103
  64. package/dist/cjs/plugins/selection/gap-cursor/utils.js +0 -137
  65. package/dist/cjs/plugins/selection/gap-cursor-selection.js +0 -37
  66. package/dist/cjs/plugins/selection/index.js +0 -65
  67. package/dist/cjs/plugins/selection/plugin-factory.js +0 -49
  68. package/dist/cjs/plugins/selection/pm-plugins/events/create-selection-between.js +0 -92
  69. package/dist/cjs/plugins/selection/pm-plugins/events/keydown.js +0 -115
  70. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-keymap.js +0 -46
  71. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +0 -160
  72. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-plugin-key.js +0 -8
  73. package/dist/cjs/plugins/selection/pm-plugins/keymap.js +0 -16
  74. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +0 -104
  75. package/dist/cjs/plugins/selection/reducer.js +0 -26
  76. package/dist/cjs/plugins/selection/types.js +0 -20
  77. package/dist/cjs/plugins/selection/utils.js +0 -280
  78. package/dist/cjs/selection-api/api.js +0 -27
  79. package/dist/es2019/plugins/selection/actions.js +0 -5
  80. package/dist/es2019/plugins/selection/commands.js +0 -250
  81. package/dist/es2019/plugins/selection/gap-cursor/actions.js +0 -270
  82. package/dist/es2019/plugins/selection/gap-cursor/direction.js +0 -15
  83. package/dist/es2019/plugins/selection/gap-cursor/selection.js +0 -1
  84. package/dist/es2019/plugins/selection/gap-cursor/styles.js +0 -145
  85. package/dist/es2019/plugins/selection/gap-cursor/utils/is-ignored.js +0 -1
  86. package/dist/es2019/plugins/selection/gap-cursor/utils/is-valid-target-node.js +0 -1
  87. package/dist/es2019/plugins/selection/gap-cursor/utils/place-gap-cursor.js +0 -94
  88. package/dist/es2019/plugins/selection/gap-cursor/utils.js +0 -124
  89. package/dist/es2019/plugins/selection/gap-cursor-selection.js +0 -2
  90. package/dist/es2019/plugins/selection/index.js +0 -51
  91. package/dist/es2019/plugins/selection/plugin-factory.js +0 -43
  92. package/dist/es2019/plugins/selection/pm-plugins/events/create-selection-between.js +0 -89
  93. package/dist/es2019/plugins/selection/pm-plugins/events/keydown.js +0 -112
  94. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-keymap.js +0 -40
  95. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +0 -158
  96. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-plugin-key.js +0 -2
  97. package/dist/es2019/plugins/selection/pm-plugins/keymap.js +0 -10
  98. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +0 -97
  99. package/dist/es2019/plugins/selection/reducer.js +0 -18
  100. package/dist/es2019/plugins/selection/types.js +0 -9
  101. package/dist/es2019/plugins/selection/utils.js +0 -233
  102. package/dist/es2019/selection-api/api.js +0 -20
  103. package/dist/esm/plugins/selection/actions.js +0 -5
  104. package/dist/esm/plugins/selection/commands.js +0 -251
  105. package/dist/esm/plugins/selection/gap-cursor/actions.js +0 -266
  106. package/dist/esm/plugins/selection/gap-cursor/direction.js +0 -15
  107. package/dist/esm/plugins/selection/gap-cursor/selection.js +0 -1
  108. package/dist/esm/plugins/selection/gap-cursor/styles.js +0 -10
  109. package/dist/esm/plugins/selection/gap-cursor/utils/is-ignored.js +0 -1
  110. package/dist/esm/plugins/selection/gap-cursor/utils/is-valid-target-node.js +0 -1
  111. package/dist/esm/plugins/selection/gap-cursor/utils/place-gap-cursor.js +0 -97
  112. package/dist/esm/plugins/selection/gap-cursor/utils.js +0 -128
  113. package/dist/esm/plugins/selection/gap-cursor-selection.js +0 -2
  114. package/dist/esm/plugins/selection/index.js +0 -58
  115. package/dist/esm/plugins/selection/plugin-factory.js +0 -43
  116. package/dist/esm/plugins/selection/pm-plugins/events/create-selection-between.js +0 -86
  117. package/dist/esm/plugins/selection/pm-plugins/events/keydown.js +0 -110
  118. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-keymap.js +0 -40
  119. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +0 -154
  120. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-plugin-key.js +0 -2
  121. package/dist/esm/plugins/selection/pm-plugins/keymap.js +0 -10
  122. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +0 -98
  123. package/dist/esm/plugins/selection/reducer.js +0 -19
  124. package/dist/esm/plugins/selection/types.js +0 -9
  125. package/dist/esm/plugins/selection/utils.js +0 -241
  126. package/dist/esm/selection-api/api.js +0 -21
  127. package/dist/types/plugins/selection/actions.d.ts +0 -17
  128. package/dist/types/plugins/selection/commands.d.ts +0 -10
  129. package/dist/types/plugins/selection/gap-cursor/actions.d.ts +0 -25
  130. package/dist/types/plugins/selection/gap-cursor/direction.d.ts +0 -10
  131. package/dist/types/plugins/selection/gap-cursor/selection.d.ts +0 -1
  132. package/dist/types/plugins/selection/gap-cursor/styles.d.ts +0 -2
  133. package/dist/types/plugins/selection/gap-cursor/utils/is-ignored.d.ts +0 -1
  134. package/dist/types/plugins/selection/gap-cursor/utils/is-valid-target-node.d.ts +0 -1
  135. package/dist/types/plugins/selection/gap-cursor/utils/place-gap-cursor.d.ts +0 -2
  136. package/dist/types/plugins/selection/gap-cursor/utils.d.ts +0 -8
  137. package/dist/types/plugins/selection/gap-cursor-selection.d.ts +0 -2
  138. package/dist/types/plugins/selection/index.d.ts +0 -13
  139. package/dist/types/plugins/selection/plugin-factory.d.ts +0 -2
  140. package/dist/types/plugins/selection/pm-plugins/events/create-selection-between.d.ts +0 -4
  141. package/dist/types/plugins/selection/pm-plugins/events/keydown.d.ts +0 -2
  142. package/dist/types/plugins/selection/pm-plugins/gap-cursor-keymap.d.ts +0 -2
  143. package/dist/types/plugins/selection/pm-plugins/gap-cursor-main.d.ts +0 -6
  144. package/dist/types/plugins/selection/pm-plugins/gap-cursor-plugin-key.d.ts +0 -2
  145. package/dist/types/plugins/selection/pm-plugins/keymap.d.ts +0 -3
  146. package/dist/types/plugins/selection/pm-plugins/selection-main.d.ts +0 -7
  147. package/dist/types/plugins/selection/reducer.d.ts +0 -3
  148. package/dist/types/plugins/selection/types.d.ts +0 -12
  149. package/dist/types/plugins/selection/utils.d.ts +0 -58
  150. package/dist/types/selection-api/api.d.ts +0 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 188.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#41341](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41341) [`bd128fb1cfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd128fb1cfb) - Decouple status plugin from editor-core. Add new actions for updating status.
8
+
9
+ ## 188.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#40750](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40750) [`fc19a7b9edd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc19a7b9edd) - [ED-19875] Extraction of Editor Core's Selection Plugin into independent package '@atlaskit/editor-plugin-selection'.
14
+ - Updated dependencies
15
+
3
16
  ## 188.5.0
4
17
 
5
18
  ### Minor Changes
@@ -29,7 +29,7 @@ var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
29
29
  var _annotation = _interopRequireDefault(require("../../../plugins/annotation"));
30
30
  var _editorPluginComposition = require("@atlaskit/editor-plugin-composition");
31
31
  var _editorPluginQuickInsert = require("@atlaskit/editor-plugin-quick-insert");
32
- var _selection = _interopRequireDefault(require("../../../plugins/selection"));
32
+ var _editorPluginSelection = require("@atlaskit/editor-plugin-selection");
33
33
  var _codeBlock = _interopRequireDefault(require("../../../plugins/code-block"));
34
34
  var _undoRedo = _interopRequireDefault(require("../../../plugins/undo-redo"));
35
35
  var _editorPluginDecorations = require("@atlaskit/editor-plugin-decorations");
@@ -77,7 +77,7 @@ function createDefaultPreset(options) {
77
77
  return builder;
78
78
  }).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_editorPluginQuickInsert.quickInsertPlugin, options.quickInsert]).add([_typeAhead.default, options.typeAhead || {
79
79
  createAnalyticsEvent: options.createAnalyticsEvent
80
- }]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_selection.default, options.selection]).add([_codeBlock.default, options.codeBlock || {
80
+ }]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_editorPluginSelection.selectionPlugin, options.selection]).add([_codeBlock.default, options.codeBlock || {
81
81
  appearance: 'full-page'
82
82
  }]);
83
83
  return preset;
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = createUniversalPreset;
8
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _api = require("../../../selection-api/api");
11
10
  var _plugins = require("../../../plugins");
12
11
  var _date = require("../../../plugins/date");
13
12
  var _editorPluginCaption = require("@atlaskit/editor-plugin-caption");
@@ -50,7 +49,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
50
49
  var getEditorFeatureFlags = function getEditorFeatureFlags() {
51
50
  return featureFlags;
52
51
  };
53
- var editorSelectionAPI = (0, _api.createEditorSelectionAPI)();
54
52
  var defaultPreset = (0, _default.createDefaultPreset)(_objectSpread(_objectSpread({}, props), {}, {
55
53
  createAnalyticsEvent: createAnalyticsEvent
56
54
  }));
@@ -120,7 +118,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
120
118
  allowDropzoneDropLine: isFullPage,
121
119
  allowMediaSingleEditable: !isMobile,
122
120
  allowRemoteDimensionsFetch: !isMobile,
123
- editorSelectionAPI: editorSelectionAPI,
124
121
  // This is a wild one. I didnt quite understand what the code was doing
125
122
  // so a bit of guess for now.
126
123
  allowMarkingUploadsAsIncomplete: isMobile,
@@ -168,7 +165,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
168
165
  allowContextualMenu: !isMobile,
169
166
  fullWidthEnabled: appearance === 'full-width',
170
167
  wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
171
- editorSelectionAPI: editorSelectionAPI,
172
168
  getEditorFeatureFlags: getEditorFeatureFlags
173
169
  }]);
174
170
  }
@@ -209,8 +205,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
209
205
  disableLayout: true
210
206
  },
211
207
  allowMediaGroup: false,
212
- isCopyPasteEnabled: true,
213
- editorSelectionAPI: editorSelectionAPI
208
+ isCopyPasteEnabled: true
214
209
  }]);
215
210
  }
216
211
  return builder;
@@ -24,8 +24,6 @@ var _commands = require("./commands");
24
24
  var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
25
25
  var _utils = require("@atlaskit/editor-common/utils");
26
26
  var _pluginFactory = require("./pm-plugins/plugin-factory");
27
- // TO-DO: replace with editor-plugin-selection
28
-
29
27
  var expandPlugin = function expandPlugin(_ref) {
30
28
  var _api$featureFlags;
31
29
  var _ref$config = _ref.config,
@@ -69,8 +69,12 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
69
69
  state = _this$view.state,
70
70
  dispatch = _this$view.dispatch;
71
71
  if (_this.selectNearNode) {
72
- var _this$api;
73
- (_this$api = _this.api) === null || _this$api === void 0 || _this$api.core.actions.execute(_this.selectNearNode(_selection.RelativeSelectionPos.Start));
72
+ var tr = _this.selectNearNode({
73
+ selectionRelativeToNode: _selection.RelativeSelectionPos.Start
74
+ })(state);
75
+ if (dispatch) {
76
+ dispatch(tr);
77
+ }
74
78
  }
75
79
  var pos = _this.getPos();
76
80
  if (typeof pos === 'number') {
@@ -280,11 +284,18 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
280
284
  selectionStart = _this$input4.selectionStart,
281
285
  selectionEnd = _this$input4.selectionEnd;
282
286
  if (selectionStart === selectionEnd && selectionStart === value.length) {
283
- var _this$api2;
284
287
  event.preventDefault();
285
- var state = _this.view.state;
288
+ var _this$view8 = _this.view,
289
+ state = _this$view8.state,
290
+ dispatch = _this$view8.dispatch;
286
291
  _this.view.focus();
287
- (_this$api2 = _this.api) === null || _this$api2 === void 0 || _this$api2.core.actions.execute(_this.selectNearNode(_selection.RelativeSelectionPos.End, _state.NodeSelection.create(state.doc, pos)));
292
+ var tr = _this.selectNearNode({
293
+ selectionRelativeToNode: _selection.RelativeSelectionPos.End,
294
+ selection: _state.NodeSelection.create(state.doc, pos)
295
+ })(state);
296
+ if (dispatch) {
297
+ dispatch(tr);
298
+ }
288
299
  }
289
300
  });
290
301
  (0, _defineProperty2.default)(this, "handleArrowLeftFromTitle", function (event) {
@@ -299,19 +310,31 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
299
310
  selectionStart = _this$input5.selectionStart,
300
311
  selectionEnd = _this$input5.selectionEnd;
301
312
  if (selectionStart === selectionEnd && selectionStart === 0) {
302
- var _this$api3;
313
+ var _this$api;
303
314
  event.preventDefault();
304
- var state = _this.view.state;
315
+ var _this$view9 = _this.view,
316
+ state = _this$view9.state,
317
+ dispatch = _this$view9.dispatch;
305
318
  _this.view.focus();
306
- var selectionSharedState = ((_this$api3 = _this.api) === null || _this$api3 === void 0 ? void 0 : _this$api3.selection.sharedState.currentState()) || {};
319
+ var selectionSharedState = ((_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.selection) === null || _this$api === void 0 ? void 0 : _this$api.sharedState.currentState()) || {};
307
320
  // selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
308
321
  // This is a special case where we want to bypass node selection and jump straight to gap cursor
309
322
  if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
310
- var _this$api4;
311
- (_this$api4 = _this.api) === null || _this$api4 === void 0 || _this$api4.core.actions.execute(_this.selectNearNode(undefined, new _selection.GapCursorSelection(state.doc.resolve(pos), _selection.Side.LEFT)));
323
+ var tr = _this.selectNearNode({
324
+ selectionRelativeToNode: undefined,
325
+ selection: new _selection.GapCursorSelection(state.doc.resolve(pos), _selection.Side.LEFT)
326
+ })(state);
327
+ if (dispatch) {
328
+ dispatch(tr);
329
+ }
312
330
  } else {
313
- var _this$api5;
314
- (_this$api5 = _this.api) === null || _this$api5 === void 0 || _this$api5.core.actions.execute(_this.selectNearNode(_selection.RelativeSelectionPos.Start, _state.NodeSelection.create(state.doc, pos)));
331
+ var _tr = _this.selectNearNode({
332
+ selectionRelativeToNode: _selection.RelativeSelectionPos.Start,
333
+ selection: _state.NodeSelection.create(state.doc, pos)
334
+ })(state);
335
+ if (dispatch) {
336
+ dispatch(_tr);
337
+ }
315
338
  }
316
339
  }
317
340
  });
@@ -453,6 +476,7 @@ function _default(_ref2) {
453
476
  featureFlags = _ref2.featureFlags,
454
477
  api = _ref2.api;
455
478
  return function (node, view, getPos) {
456
- return new ExpandNodeView(node, view, getPos, getIntl, isMobile, featureFlags, api === null || api === void 0 ? void 0 : api.selection.commands.selectNearNode, api);
479
+ var _api$selection;
480
+ return new ExpandNodeView(node, view, getPos, getIntl, isMobile, featureFlags, api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || (_api$selection = _api$selection.actions) === null || _api$selection === void 0 ? void 0 : _api$selection.selectNearNode, api);
457
481
  };
458
482
  }
@@ -221,12 +221,6 @@ Object.defineProperty(exports, "scrollIntoViewPlugin", {
221
221
  return _scrollIntoView.default;
222
222
  }
223
223
  });
224
- Object.defineProperty(exports, "selectionPlugin", {
225
- enumerable: true,
226
- get: function get() {
227
- return _selection.default;
228
- }
229
- });
230
224
  Object.defineProperty(exports, "statusPlugin", {
231
225
  enumerable: true,
232
226
  get: function get() {
@@ -312,7 +306,6 @@ var _expand = _interopRequireWildcard(require("./expand"));
312
306
  var _scrollIntoView = _interopRequireDefault(require("./scroll-into-view"));
313
307
  var _mobileDimensions = _interopRequireDefault(require("./mobile-dimensions"));
314
308
  var _findReplace = _interopRequireDefault(require("./find-replace"));
315
- var _selection = _interopRequireDefault(require("./selection"));
316
309
  var _mobileSelection = _interopRequireDefault(require("./mobile-selection"));
317
310
  var _undoRedo = _interopRequireDefault(require("./undo-redo"));
318
311
  var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
@@ -26,7 +26,6 @@ var _actions = require("../../../placeholder-text/actions");
26
26
  var _actions2 = require("../../../layout/actions");
27
27
  var _commands = require("../../../tasks-and-decisions/commands");
28
28
  var _commands2 = require("../../../expand/commands");
29
- var _actions3 = require("../../../status/actions");
30
29
  var _analytics = require("@atlaskit/editor-common/analytics");
31
30
  var _messages = require("./messages");
32
31
  var _createItems3 = require("./create-items");
@@ -220,14 +219,16 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
220
219
  return true;
221
220
  });
222
221
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createStatus", function (inputMethod) {
223
- var editorView = _this.props.editorView;
224
- (0, _actions3.updateStatusWithAnalytics)(inputMethod)(editorView.state, editorView.dispatch);
225
- return true;
222
+ var _pluginInjectionApi$s, _pluginInjectionApi$s2;
223
+ var _this$props4 = _this.props,
224
+ pluginInjectionApi = _this$props4.pluginInjectionApi,
225
+ editorView = _this$props4.editorView;
226
+ return (_pluginInjectionApi$s = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$s2 = pluginInjectionApi.status) === null || _pluginInjectionApi$s2 === void 0 || (_pluginInjectionApi$s2 = _pluginInjectionApi$s2.actions) === null || _pluginInjectionApi$s2 === void 0 ? void 0 : _pluginInjectionApi$s2.updateStatus(inputMethod)(editorView.state, editorView.dispatch)) !== null && _pluginInjectionApi$s !== void 0 ? _pluginInjectionApi$s : false;
226
227
  });
227
228
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openMediaPicker", function (inputMethod) {
228
- var _this$props4 = _this.props,
229
- onShowMediaPicker = _this$props4.onShowMediaPicker,
230
- dispatchAnalyticsEvent = _this$props4.dispatchAnalyticsEvent;
229
+ var _this$props5 = _this.props,
230
+ onShowMediaPicker = _this$props5.onShowMediaPicker,
231
+ dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent;
231
232
  if (onShowMediaPicker) {
232
233
  onShowMediaPicker();
233
234
  if (dispatchAnalyticsEvent) {
@@ -255,11 +256,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
255
256
  });
256
257
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertHorizontalRule", function (inputMethod) {
257
258
  var _pluginInjectionApi$r, _pluginInjectionApi$r2;
258
- var _this$props5 = _this.props,
259
- _this$props5$editorVi = _this$props5.editorView,
260
- state = _this$props5$editorVi.state,
261
- dispatch = _this$props5$editorVi.dispatch,
262
- pluginInjectionApi = _this$props5.pluginInjectionApi;
259
+ var _this$props6 = _this.props,
260
+ _this$props6$editorVi = _this$props6.editorView,
261
+ state = _this$props6$editorVi.state,
262
+ dispatch = _this$props6$editorVi.dispatch,
263
+ pluginInjectionApi = _this$props6.pluginInjectionApi;
263
264
  return (_pluginInjectionApi$r = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$r2 = pluginInjectionApi.rule) === null || _pluginInjectionApi$r2 === void 0 ? void 0 : _pluginInjectionApi$r2.actions.insertHorizontalRule(inputMethod)(state, dispatch)) !== null && _pluginInjectionApi$r !== void 0 ? _pluginInjectionApi$r : false;
264
265
  });
265
266
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertExpand", function () {
@@ -270,9 +271,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
270
271
  });
271
272
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertBlockType", function (itemName) {
272
273
  return function () {
273
- var _this$props6 = _this.props,
274
- editorView = _this$props6.editorView,
275
- onInsertBlockType = _this$props6.onInsertBlockType;
274
+ var _this$props7 = _this.props,
275
+ editorView = _this$props7.editorView,
276
+ onInsertBlockType = _this$props7.onInsertBlockType;
276
277
  var state = editorView.state,
277
278
  dispatch = editorView.dispatch;
278
279
  onInsertBlockType(itemName)(state, dispatch);
@@ -295,11 +296,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
295
296
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onItemActivated", function (_ref2) {
296
297
  var item = _ref2.item,
297
298
  inputMethod = _ref2.inputMethod;
298
- var _this$props7 = _this.props,
299
- editorView = _this$props7.editorView,
300
- editorActions = _this$props7.editorActions,
301
- handleImageUpload = _this$props7.handleImageUpload,
302
- expandEnabled = _this$props7.expandEnabled;
299
+ var _this$props8 = _this.props,
300
+ editorView = _this$props8.editorView,
301
+ editorActions = _this$props8.editorActions,
302
+ handleImageUpload = _this$props8.handleImageUpload,
303
+ expandEnabled = _this$props8.expandEnabled;
303
304
 
304
305
  // need to do this before inserting nodes so scrollIntoView works properly
305
306
  if (!editorView.hasFocus()) {
@@ -415,12 +416,12 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
415
416
  key: "renderPopup",
416
417
  value: function renderPopup() {
417
418
  var emojiPickerOpen = this.state.emojiPickerOpen;
418
- var _this$props8 = this.props,
419
- popupsMountPoint = _this$props8.popupsMountPoint,
420
- popupsBoundariesElement = _this$props8.popupsBoundariesElement,
421
- popupsScrollableElement = _this$props8.popupsScrollableElement,
422
- emojiProvider = _this$props8.emojiProvider,
423
- replacePlusMenuWithElementBrowser = _this$props8.replacePlusMenuWithElementBrowser;
419
+ var _this$props9 = this.props,
420
+ popupsMountPoint = _this$props9.popupsMountPoint,
421
+ popupsBoundariesElement = _this$props9.popupsBoundariesElement,
422
+ popupsScrollableElement = _this$props9.popupsScrollableElement,
423
+ emojiProvider = _this$props9.emojiProvider,
424
+ replacePlusMenuWithElementBrowser = _this$props9.replacePlusMenuWithElementBrowser;
424
425
  var dropdownEmoji = this.state.dropdownItems.some(function (_ref4) {
425
426
  var name = _ref4.value.name;
426
427
  return name === 'emoji';
@@ -457,9 +458,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
457
458
  buttons = _this$state.buttons,
458
459
  dropdownItems = _this$state.dropdownItems,
459
460
  emojiPickerOpen = _this$state.emojiPickerOpen;
460
- var _this$props9 = this.props,
461
- isDisabled = _this$props9.isDisabled,
462
- isReducedSpacing = _this$props9.isReducedSpacing;
461
+ var _this$props10 = this.props,
462
+ isDisabled = _this$props10.isDisabled,
463
+ isReducedSpacing = _this$props10.isReducedSpacing;
463
464
  if (buttons.length === 0 && dropdownItems.length === 0) {
464
465
  return null;
465
466
  }
@@ -9,7 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _adfSchema = require("@atlaskit/adf-schema");
12
- var _analytics = require("../analytics");
12
+ var _analytics = require("@atlaskit/editor-common/analytics");
13
+ var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
13
14
  var _pluginKey = require("./plugin-key");
14
15
  var _utils = require("@atlaskit/editor-prosemirror/utils");
15
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -78,16 +79,18 @@ var updateStatus = exports.updateStatus = function updateStatus(status) {
78
79
  return false;
79
80
  };
80
81
  };
81
- var updateStatusWithAnalytics = exports.updateStatusWithAnalytics = function updateStatusWithAnalytics(inputMethod, status) {
82
- return (0, _analytics.withAnalytics)({
83
- action: _analytics.ACTION.INSERTED,
84
- actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
85
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.STATUS,
86
- attributes: {
87
- inputMethod: inputMethod
88
- },
89
- eventType: _analytics.EVENT_TYPE.TRACK
90
- })(updateStatus(status));
82
+ var updateStatusWithAnalytics = exports.updateStatusWithAnalytics = function updateStatusWithAnalytics(editorAnalyticsAPI) {
83
+ return function (inputMethod, status) {
84
+ return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
85
+ action: _analytics.ACTION.INSERTED,
86
+ actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
87
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.STATUS,
88
+ attributes: {
89
+ inputMethod: inputMethod
90
+ },
91
+ eventType: _analytics.EVENT_TYPE.TRACK
92
+ })(updateStatus(status));
93
+ };
91
94
  };
92
95
  var setStatusPickerAt = exports.setStatusPickerAt = function setStatusPickerAt(showStatusPickerAt) {
93
96
  return function (state, dispatch) {
@@ -8,8 +8,8 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _utils = require("@atlaskit/editor-prosemirror/utils");
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
- var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
12
- var _analytics = require("../analytics");
11
+ var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
12
+ var _analytics = require("@atlaskit/editor-common/analytics");
13
13
  var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
14
14
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
15
15
  var _actions = require("./actions");
@@ -18,7 +18,9 @@ var _plugin = _interopRequireDefault(require("./plugin"));
18
18
  var _pluginKey = require("./plugin-key");
19
19
  var _statusPicker = _interopRequireDefault(require("./ui/statusPicker"));
20
20
  var baseStatusPlugin = function baseStatusPlugin(_ref) {
21
- var options = _ref.config;
21
+ var _api$analytics;
22
+ var options = _ref.config,
23
+ api = _ref.api;
22
24
  return {
23
25
  name: 'status',
24
26
  nodes: function nodes() {
@@ -38,13 +40,17 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
38
40
  plugin: _keymap.keymapPlugin
39
41
  }];
40
42
  },
43
+ actions: {
44
+ commitStatusPicker: _actions.commitStatusPicker,
45
+ updateStatus: (0, _actions.updateStatusWithAnalytics)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
46
+ },
41
47
  contentComponent: function contentComponent(_ref2) {
42
48
  var editorView = _ref2.editorView,
43
49
  popupsMountPoint = _ref2.popupsMountPoint,
44
50
  popupsBoundariesElement = _ref2.popupsBoundariesElement,
45
51
  popupsScrollableElement = _ref2.popupsScrollableElement;
46
52
  var domAtPos = editorView.domAtPos.bind(editorView);
47
- return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
53
+ return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
48
54
  plugins: {
49
55
  statusState: _pluginKey.pluginKey
50
56
  },
@@ -91,7 +97,7 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
91
97
  }
92
98
  };
93
99
  };
94
- var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options) {
100
+ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options, api) {
95
101
  if ((options === null || options === void 0 ? void 0 : options.menuDisabled) === true) {
96
102
  return plugin;
97
103
  }
@@ -108,7 +114,9 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
108
114
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconStatus, null);
109
115
  },
110
116
  action: function action(insert, state) {
111
- return (0, _analytics.addAnalytics)(state, (0, _actions.createStatus)()(insert, state), {
117
+ var _api$analytics2;
118
+ var tr = (0, _actions.createStatus)()(insert, state);
119
+ api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
112
120
  action: _analytics.ACTION.INSERTED,
113
121
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
114
122
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.STATUS,
@@ -116,7 +124,8 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
116
124
  inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
117
125
  },
118
126
  eventType: _analytics.EVENT_TYPE.TRACK
119
- });
127
+ })(tr);
128
+ return tr;
120
129
  }
121
130
  }];
122
131
  }
@@ -129,6 +138,6 @@ var statusPlugin = function statusPlugin(_ref5) {
129
138
  return decorateWithPluginOptions(baseStatusPlugin({
130
139
  config: options,
131
140
  api: api
132
- }), options);
141
+ }), options, api);
133
142
  };
134
143
  var _default = exports.default = statusPlugin;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  exports.keymapPlugin = keymapPlugin;
8
8
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
9
- var _keymaps = require("../../keymaps");
9
+ var _keymaps = require("@atlaskit/editor-common/keymaps");
10
10
  var _utils = require("./utils");
11
11
  function keymapPlugin() {
12
12
  var list = {};
@@ -21,14 +21,14 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
21
  var _picker = require("@atlaskit/status/picker");
22
22
  var _constants = require("@atlaskit/theme/constants");
23
23
  var _colors = require("@atlaskit/theme/colors");
24
- var _withOuterListeners = _interopRequireDefault(require("../../../ui/with-outer-listeners"));
24
+ var _uiReact = require("@atlaskit/editor-common/ui-react");
25
25
  var _actions = require("../actions");
26
26
  var _analytics = require("../analytics");
27
27
  var _templateObject;
28
28
  /** @jsx jsx */
29
29
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
- var PopupWithListeners = (0, _withOuterListeners.default)(_ui.Popup);
31
+ var PopupWithListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_ui.Popup);
32
32
  var InputMethod = exports.InputMethod = /*#__PURE__*/function (InputMethod) {
33
33
  InputMethod["blur"] = "blur";
34
34
  InputMethod["escKey"] = "escKey";
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.clickAreaClickHandler = exports.checkForModal = void 0;
7
- var _dom = require("../../utils/dom");
8
- var _gapCursorSelection = require("../../plugins/selection/gap-cursor-selection");
9
- var _commands = require("../../commands");
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
+ var _selection = require("@atlaskit/editor-common/selection");
9
+ var _commands = require("@atlaskit/editor-common/commands");
10
10
  // we ignore all of the clicks made inside <div class="ak-editor-content-area" /> (but not clicks on the node itself)
11
11
  var insideContentArea = function insideContentArea(ref) {
12
12
  while (ref) {
@@ -60,17 +60,17 @@ var clickAreaClickHandler = exports.clickAreaClickHandler = function clickAreaCl
60
60
  // which doesn't pass the check !contentArea.contains(event.target)
61
61
  var isInputClicked = target.nodeName === 'INPUT';
62
62
  // @see ED-5126
63
- var isPopupClicked = !!(0, _dom.closestElement)(target, '[data-editor-popup]');
63
+ var isPopupClicked = !!(0, _utils.closestElement)(target, '[data-editor-popup]');
64
64
  // Fixes issue when using a textarea for editor title in full page editor doesn't let user focus it.
65
65
  var isTextAreaClicked = target.nodeName === 'TEXTAREA';
66
- var isBreadcrumbClicked = !!(0, _dom.closestElement)(target, 'nav[aria-label="Breadcrumbs"]');
66
+ var isBreadcrumbClicked = !!(0, _utils.closestElement)(target, 'nav[aria-label="Breadcrumbs"]');
67
67
  var selection = window.getSelection();
68
- var isEditorPopupTextSelected = (selection === null || selection === void 0 ? void 0 : selection.type) === 'Range' && (0, _dom.closestElement)(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
68
+ var isEditorPopupTextSelected = (selection === null || selection === void 0 ? void 0 : selection.type) === 'Range' && (0, _utils.closestElement)(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
69
69
 
70
70
  // This is a super workaround to find when events are coming from Confluence InlineComment modal
71
71
  // We don't own those components, so we can't change them
72
- var isEventComingFromInlineCommentPopup = Boolean((0, _dom.closestElement)(event.currentTarget, 'div[offset]')) || Boolean((0, _dom.closestElement)(target, 'div[offset]'));
73
- var isButtonClicked = Boolean((0, _dom.closestElement)(event.currentTarget, 'button')) || Boolean((0, _dom.closestElement)(target, 'button')) || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.nodeName) === 'BUTTON' || target.nodeName === 'BUTTON';
72
+ var isEventComingFromInlineCommentPopup = Boolean((0, _utils.closestElement)(event.currentTarget, 'div[offset]')) || Boolean((0, _utils.closestElement)(target, 'div[offset]'));
73
+ var isButtonClicked = Boolean((0, _utils.closestElement)(event.currentTarget, 'button')) || Boolean((0, _utils.closestElement)(target, 'button')) || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.nodeName) === 'BUTTON' || target.nodeName === 'BUTTON';
74
74
  var isTargetInsideContentArea = Boolean(isTargetChildOfContentArea);
75
75
  var isBetweenContentAreaAndEditableContent = isTargetInsideContentArea && !isTargetInsideEditableArea;
76
76
 
@@ -99,9 +99,7 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
99
99
  if (isBottomAreaClicked) {
100
100
  (0, _commands.addParagraphAtEnd)(tr);
101
101
  }
102
- if ((0, _gapCursorSelection.hasGapCursorPlugin)(state)) {
103
- (0, _gapCursorSelection.setSelectionTopLevelBlocks)(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
104
- }
102
+ (0, _selection.setSelectionTopLevelBlocks)(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
105
103
  if (!tr.docChanged && !tr.selectionSet) {
106
104
  return;
107
105
  }
@@ -13,25 +13,25 @@ var _styles = require("@atlaskit/editor-common/styles");
13
13
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
14
14
  var _mention = require("@atlaskit/editor-common/mention");
15
15
  var _styles2 = require("../../plugins/collab-edit/styles");
16
- var _styles3 = require("../../plugins/selection/gap-cursor/styles");
17
16
  var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
18
- var _styles4 = require("@atlaskit/editor-plugin-block-type/styles");
19
- var _styles5 = require("../../plugins/code-block/styles");
17
+ var _styles3 = require("@atlaskit/editor-plugin-block-type/styles");
18
+ var _styles4 = require("../../plugins/code-block/styles");
20
19
  var _media = require("./media");
21
- var _styles6 = require("../../plugins/layout/styles");
22
- var _styles7 = require("../../plugins/panel/styles");
23
- var _styles8 = require("../../plugins/fake-text-cursor/styles");
24
- var _styles9 = require("../../plugins/placeholder-text/styles");
25
- var _styles10 = require("../../plugins/extension/ui/styles");
26
- var _styles11 = require("../../plugins/expand/ui/styles");
27
- var _styles12 = require("../../plugins/find-replace/styles");
28
- var _styles13 = require("../../plugins/tasks-and-decisions/styles");
29
- var _styles14 = require("../../plugins/status/styles");
20
+ var _styles5 = require("../../plugins/layout/styles");
21
+ var _styles6 = require("../../plugins/panel/styles");
22
+ var _styles7 = require("../../plugins/fake-text-cursor/styles");
23
+ var _styles8 = require("../../plugins/placeholder-text/styles");
24
+ var _styles9 = require("../../plugins/extension/ui/styles");
25
+ var _styles10 = require("../../plugins/expand/ui/styles");
26
+ var _styles11 = require("../../plugins/find-replace/styles");
27
+ var _styles12 = require("../../plugins/tasks-and-decisions/styles");
28
+ var _styles13 = require("../../plugins/status/styles");
30
29
  var _date = require("./date");
31
30
  var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
32
31
  var _utils = require("@atlaskit/editor-common/utils");
33
32
  var _emoji = require("@atlaskit/editor-common/emoji");
34
33
  var _colors = require("@atlaskit/theme/colors");
34
+ var _selection = require("@atlaskit/editor-common/selection");
35
35
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
36
36
  /** @jsx jsx */
37
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
47
47
  var contentStyles = function contentStyles(props) {
48
48
  return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
49
49
  theme: props.theme
50
- }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles9.placeholderTextStyles, placeholderStyles, (0, _styles5.codeBlockStyles)(props), (0, _styles4.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _styles6.layoutStyles)(props), _styles2.telepointerStyle, _styles3.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles7.panelStyles)(props), _styles8.fakeCursorStyles, mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles10.extensionStyles, (0, _styles11.expandStyles)(props), _styles12.findReplaceStyles, _styles13.taskDecisionStyles, _styles14.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
50
+ }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles8.placeholderTextStyles, placeholderStyles, (0, _styles4.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _styles5.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles6.panelStyles)(props), _styles7.fakeCursorStyles, mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles9.extensionStyles, (0, _styles10.expandStyles)(props), _styles11.findReplaceStyles, _styles12.taskDecisionStyles, _styles13.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
51
51
  };
52
52
  var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
53
53
  return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
@@ -4,8 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isValidPosition = exports.duplicateSelection = void 0;
7
- exports.setAllSelection = setAllSelection;
8
- exports.setCellSelection = setCellSelection;
7
+ Object.defineProperty(exports, "setAllSelection", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _utils.setAllSelection;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "setCellSelection", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _utils.setCellSelection;
17
+ }
18
+ });
9
19
  Object.defineProperty(exports, "setNodeSelection", {
10
20
  enumerable: true,
11
21
  get: function get() {
@@ -22,18 +32,6 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
22
32
  var _state = require("@atlaskit/editor-prosemirror/state");
23
33
  var _selection = require("@atlaskit/editor-common/selection");
24
34
  var _utils = require("@atlaskit/editor-common/utils");
25
- function setAllSelection(view) {
26
- var state = view.state,
27
- dispatch = view.dispatch;
28
- var tr = state.tr.setSelection(new _state.AllSelection(view.state.doc));
29
- dispatch(tr);
30
- }
31
- function setCellSelection(view, anchor, head) {
32
- var state = view.state,
33
- dispatch = view.dispatch;
34
- dispatch(state.tr.setSelection(_cellSelection.CellSelection.create(state.doc, anchor, head)));
35
- }
36
-
37
35
  // checks if the given position is within the ProseMirror document
38
36
  var isValidPosition = exports.isValidPosition = function isValidPosition(pos, state) {
39
37
  if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "188.5.0";
8
+ var version = exports.version = "188.6.0";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -23,7 +23,7 @@ import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
23
23
  import annotationPlugin from '../../../plugins/annotation';
24
24
  import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
25
25
  import { quickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
26
- import selectionPlugin from '../../../plugins/selection';
26
+ import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
27
27
  import codeBlockPlugin from '../../../plugins/code-block';
28
28
  import undoRedoPlugin from '../../../plugins/undo-redo';
29
29
  import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';