@atlaskit/editor-core 187.30.7 → 187.30.9

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 (37) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/plugins/media/toolbar/index.js +5 -15
  3. package/dist/cjs/plugins/media/toolbar/utils.js +10 -2
  4. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
  5. package/dist/cjs/plugins/paste/pm-plugins/clipboard-text-serializer.js +3 -1
  6. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  7. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +1 -2
  8. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -2
  9. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/plugins/media/toolbar/index.js +7 -16
  12. package/dist/es2019/plugins/media/toolbar/utils.js +7 -0
  13. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
  14. package/dist/es2019/plugins/paste/pm-plugins/clipboard-text-serializer.js +3 -1
  15. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  16. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +1 -2
  17. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -2
  18. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/plugins/media/toolbar/index.js +7 -17
  21. package/dist/esm/plugins/media/toolbar/utils.js +7 -0
  22. package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
  23. package/dist/esm/plugins/paste/pm-plugins/clipboard-text-serializer.js +3 -1
  24. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
  25. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +1 -2
  26. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -2
  27. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/labs/next/presets/default.d.ts +4 -0
  30. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
  31. package/dist/types/plugins/paste/pm-plugins/clipboard-text-serializer.d.ts +1 -1
  32. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +1 -3
  33. package/dist/types-ts4.5/labs/next/presets/default.d.ts +4 -0
  34. package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -0
  35. package/dist/types-ts4.5/plugins/paste/pm-plugins/clipboard-text-serializer.d.ts +1 -1
  36. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +1 -3
  37. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.30.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4795a87a349`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4795a87a349) - Migrating some actions of `editor-plugin-list` to commands. Adding sharedState for `editor-plugin-text-formatting`.
8
+ - [`1f40b8ca01b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1f40b8ca01b) - [ux] ED-16028 Serializing mention text during copy
9
+ - [`a34c6ca52c2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a34c6ca52c2) - [ux] [ED-19442] - Modified images and mentions icons and added dark mode
10
+ - Updated dependencies
11
+
12
+ ## 187.30.8
13
+
14
+ ### Patch Changes
15
+
16
+ - [`04a2b9f4cfe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04a2b9f4cfe) - fix convert pixels in nested table when media single node does not have width
17
+ - [`edeab2d50b2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edeab2d50b2) - Fix analytics event for image resizing and relative snaps
18
+ - Updated dependencies
19
+
3
20
  ## 187.30.7
4
21
 
5
22
  ### Patch Changes
@@ -268,7 +268,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
268
268
  type: 'custom',
269
269
  fallback: [],
270
270
  render: function render(editorView) {
271
- var _widthPlugin$sharedSt2, _widthPlugin$sharedSt3;
271
+ var _widthPlugin$sharedSt2;
272
272
  if (!editorView) {
273
273
  return null;
274
274
  }
@@ -279,15 +279,11 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
279
279
  return null;
280
280
  }
281
281
  var contentWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || _editorSharedStyles.akEditorDefaultLayoutWidth;
282
- var containerWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt3 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt3 === void 0 ? void 0 : _widthPlugin$sharedSt3.width) || _editorSharedStyles.akEditorFullWidthLayoutWidth;
283
282
  var selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
284
283
  if (!selectedMediaNode) {
285
284
  return null;
286
285
  }
287
- var _selectedMediaSingleN = selectedMediaSingleNode.node.attrs,
288
- singleMediaWidth = _selectedMediaSingleN.width,
289
- widthType = _selectedMediaSingleN.widthType,
290
- layout = _selectedMediaSingleN.layout;
286
+ var widthType = selectedMediaSingleNode.node.attrs.widthType;
291
287
  var _selectedMediaNode$at = selectedMediaNode.attrs,
292
288
  mediaWidth = _selectedMediaNode$at.width,
293
289
  mediaHeight = _selectedMediaNode$at.height;
@@ -296,15 +292,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
296
292
  var isVideoFile = (0, _mediaSingle.isVideo)(selectedMediaNode.attrs.__fileMimeType);
297
293
  var minWidth = (0, _mediaSingle2.calcMinWidth)(isVideoFile, maxWidthForNestedNode || contentWidth);
298
294
  var isLegacy = widthType !== 'pixel';
299
- var pixelWidth = (0, _mediaSingle2.calcMediaSinglePixelWidth)({
300
- width: singleMediaWidth,
301
- widthType: widthType,
302
- origWidth: mediaWidth || _mediaSingle2.DEFAULT_IMAGE_WIDTH,
303
- layout: layout,
304
- contentWidth: (0, _mediaSingle2.getMaxWidthForNestedNode)(editorView, selectedMediaSingleNode.pos) || contentWidth,
305
- containerWidth: containerWidth,
306
- gutterOffset: _mediaSingle2.MEDIA_SINGLE_GUTTER_SIZE
307
- });
295
+ var pixelWidth = (0, _utils2.getPixelWidthOfElement)(editorView, selectedMediaSingleNode.pos + 1,
296
+ // get pos of media node
297
+ mediaWidth || _mediaSingle2.DEFAULT_IMAGE_WIDTH);
308
298
  return /*#__PURE__*/_react.default.createElement(_PixelEntry.PixelEntry, {
309
299
  intl: intl,
310
300
  width: pluginState.isResizing ? pluginState.resizingWidth : pixelWidth,
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.removeMediaGroupNode = exports.getSelectedMediaSingle = exports.getSelectedMediaContainerNodeAttrs = exports.downloadMedia = void 0;
7
+ exports.removeMediaGroupNode = exports.getSelectedMediaSingle = exports.getSelectedMediaContainerNodeAttrs = exports.getPixelWidthOfElement = exports.downloadMedia = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _mediaClient = require("@atlaskit/media-client");
@@ -73,4 +73,12 @@ var getSelectedMediaSingle = function getSelectedMediaSingle(state) {
73
73
  var mediaSingle = state.schema.nodes.mediaSingle;
74
74
  return (0, _utils.findSelectedNodeOfType)(mediaSingle)(state.selection) || (0, _utils.findParentNodeOfType)(mediaSingle)(state.selection);
75
75
  };
76
- exports.getSelectedMediaSingle = getSelectedMediaSingle;
76
+ exports.getSelectedMediaSingle = getSelectedMediaSingle;
77
+ var getPixelWidthOfElement = function getPixelWidthOfElement(editorView, pos, mediaWidth) {
78
+ var domNode = editorView.nodeDOM(pos);
79
+ if (domNode instanceof HTMLElement) {
80
+ return domNode.offsetWidth;
81
+ }
82
+ return mediaWidth;
83
+ };
84
+ exports.getPixelWidthOfElement = getPixelWidthOfElement;
@@ -185,8 +185,10 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
185
185
  var _findClosestSnap = (0, _guideline.findClosestSnap)(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, _mediaSingle.MEDIA_SINGLE_SNAP_GAP),
186
186
  gap = _findClosestSnap.gap,
187
187
  activeGuidelineKeys = _findClosestSnap.keys;
188
- _this.lastSnappedGuidelineKeys = activeGuidelineKeys;
189
188
  var relativeGuidelines = activeGuidelineKeys.length ? [] : _this.getRelativeGuides();
189
+ _this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(function (rg) {
190
+ return rg.key;
191
+ });
190
192
  _this.displayGuideline([].concat((0, _toConsumableArray2.default)((0, _guideline.getGuidelinesWithHighlights)(gap, _mediaSingle.MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines)), (0, _toConsumableArray2.default)(relativeGuidelines)));
191
193
  }
192
194
  });
@@ -7,7 +7,7 @@ exports.clipboardTextSerializer = clipboardTextSerializer;
7
7
  /**
8
8
  * Returns a plain text serialization of a given slice. This is used for populating the plain text
9
9
  * section of the clipboard on copy.
10
- * The current implementation is bare bones - only inlineCards and blockCards are tested (they
10
+ * The current implementation is bare bones - only inlineCards, blockCards and mentions are tested (they
11
11
  * previously were empty on plain text copy).
12
12
  * Unknown nodes are passed to node.textBetween().
13
13
  *
@@ -32,6 +32,8 @@ function clipboardTextSerializer(slice) {
32
32
  text += node.attrs.url;
33
33
  } else if (node.type.name === 'blockCard') {
34
34
  text += node.attrs.url;
35
+ } else if (node.type.name === 'mention') {
36
+ text += node.attrs.text;
35
37
  } else {
36
38
  text += node.textBetween(0, node.content.size, '\n\n');
37
39
  }
@@ -26,7 +26,7 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
26
26
  // not use the indentation mark.
27
27
  // Check for lists before paragraphs and headings in case
28
28
  // the selection is in a list nested in a layout column.
29
- if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState)) {
29
+ if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState.tr)) {
30
30
  var _getListItemAttribute = (0, _lists.getListItemAttributes)(selection.$head),
31
31
  indentLevel = _getListItemAttribute.indentLevel,
32
32
  itemIndex = _getListItemAttribute.itemIndex;
@@ -48,8 +48,7 @@ function Toolbar(props) {
48
48
  return function (event) {
49
49
  return onItemActivated({
50
50
  editorView: props.editorView,
51
- buttonName: buttonName,
52
- featureFlags: props.featureFlags
51
+ buttonName: buttonName
53
52
  });
54
53
  };
55
54
  };
@@ -63,8 +63,7 @@ function ToolbarDropdown(props) {
63
63
  setIsDropdownOpen(!shouldCloseMenu);
64
64
  return onItemActivated({
65
65
  editorView: props.editorView,
66
- buttonName: item.value.name,
67
- featureFlags: props.featureFlags
66
+ buttonName: item.value.name
68
67
  });
69
68
  };
70
69
  return (0, _react.jsx)("span", {
@@ -11,14 +11,13 @@ var _indentationButtons = require("../pm-plugins/indentation-buttons");
11
11
  var onItemActivated = function onItemActivated(pluginInjectionApi) {
12
12
  return function (_ref) {
13
13
  var buttonName = _ref.buttonName,
14
- editorView = _ref.editorView,
15
- featureFlags = _ref.featureFlags;
14
+ editorView = _ref.editorView;
16
15
  switch (buttonName) {
17
16
  case 'bullet_list':
18
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleBulletList(editorView, _analytics.INPUT_METHOD.TOOLBAR);
17
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.toggleBulletList(_analytics.INPUT_METHOD.TOOLBAR));
19
18
  break;
20
19
  case 'ordered_list':
21
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleOrderedList(editorView, _analytics.INPUT_METHOD.TOOLBAR);
20
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.toggleOrderedList(_analytics.INPUT_METHOD.TOOLBAR));
22
21
  break;
23
22
  case 'indent':
24
23
  {
@@ -28,7 +27,7 @@ var onItemActivated = function onItemActivated(pluginInjectionApi) {
28
27
  (0, _commands.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
29
28
  }
30
29
  if (node === 'list') {
31
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.indentList(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
30
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.indentList(_analytics.INPUT_METHOD.TOOLBAR));
32
31
  }
33
32
  if (node === 'taskList') {
34
33
  (0, _keymaps.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -43,7 +42,7 @@ var onItemActivated = function onItemActivated(pluginInjectionApi) {
43
42
  (0, _commands.getOutdentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
44
43
  }
45
44
  if (_node === 'list') {
46
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.outdentList(_analytics.INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
45
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.commands.outdentList(_analytics.INPUT_METHOD.TOOLBAR));
47
46
  }
48
47
  if (_node === 'taskList') {
49
48
  (0, _keymaps.getUnindentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.30.7";
9
+ var version = "187.30.9";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -18,7 +18,7 @@ import { messages } from '@atlaskit/media-ui';
18
18
  import { cardMessages } from '@atlaskit/editor-common/messages';
19
19
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
20
20
  import { FilePreviewItem } from './filePreviewItem';
21
- import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode } from './utils';
21
+ import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode, getPixelWidthOfElement } from './utils';
22
22
  import { isVideo } from '../utils/media-single';
23
23
  import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
24
24
  import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
@@ -26,7 +26,7 @@ import ImageBorderItem from '../ui/ImageBorder';
26
26
  import { currentMediaNodeBorderMark } from '../utils/current-media-node';
27
27
  import { shouldShowImageBorder } from './imageBorder';
28
28
  import { PixelEntry } from '../ui/PixelEntry';
29
- import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, MEDIA_SINGLE_GUTTER_SIZE, calcMediaSinglePixelWidth, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
29
+ import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, calcMinWidth, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
30
30
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
31
31
  const remove = (state, dispatch) => {
32
32
  if (dispatch) {
@@ -270,7 +270,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
270
270
  type: 'custom',
271
271
  fallback: [],
272
272
  render: editorView => {
273
- var _widthPlugin$sharedSt2, _widthPlugin$sharedSt3;
273
+ var _widthPlugin$sharedSt2;
274
274
  if (!editorView) {
275
275
  return null;
276
276
  }
@@ -283,15 +283,12 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
283
283
  return null;
284
284
  }
285
285
  const contentWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || akEditorDefaultLayoutWidth;
286
- const containerWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt3 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt3 === void 0 ? void 0 : _widthPlugin$sharedSt3.width) || akEditorFullWidthLayoutWidth;
287
286
  const selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
288
287
  if (!selectedMediaNode) {
289
288
  return null;
290
289
  }
291
290
  const {
292
- width: singleMediaWidth,
293
- widthType,
294
- layout
291
+ widthType
295
292
  } = selectedMediaSingleNode.node.attrs;
296
293
  const {
297
294
  width: mediaWidth,
@@ -302,15 +299,9 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
302
299
  const isVideoFile = isVideo(selectedMediaNode.attrs.__fileMimeType);
303
300
  const minWidth = calcMinWidth(isVideoFile, maxWidthForNestedNode || contentWidth);
304
301
  const isLegacy = widthType !== 'pixel';
305
- const pixelWidth = calcMediaSinglePixelWidth({
306
- width: singleMediaWidth,
307
- widthType,
308
- origWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
309
- layout,
310
- contentWidth: getMaxWidthForNestedNode(editorView, selectedMediaSingleNode.pos) || contentWidth,
311
- containerWidth,
312
- gutterOffset: MEDIA_SINGLE_GUTTER_SIZE
313
- });
302
+ const pixelWidth = getPixelWidthOfElement(editorView, selectedMediaSingleNode.pos + 1,
303
+ // get pos of media node
304
+ mediaWidth || DEFAULT_IMAGE_WIDTH);
314
305
  return /*#__PURE__*/React.createElement(PixelEntry, {
315
306
  intl: intl,
316
307
  width: pluginState.isResizing ? pluginState.resizingWidth : pixelWidth,
@@ -46,4 +46,11 @@ export const getSelectedMediaSingle = state => {
46
46
  mediaSingle
47
47
  } = state.schema.nodes;
48
48
  return findSelectedNodeOfType(mediaSingle)(state.selection) || findParentNodeOfType(mediaSingle)(state.selection);
49
+ };
50
+ export const getPixelWidthOfElement = (editorView, pos, mediaWidth) => {
51
+ const domNode = editorView.nodeDOM(pos);
52
+ if (domNode instanceof HTMLElement) {
53
+ return domNode.offsetWidth;
54
+ }
55
+ return mediaWidth;
49
56
  };
@@ -167,8 +167,8 @@ class ResizableMediaSingleNext extends React.Component {
167
167
  gap,
168
168
  keys: activeGuidelineKeys
169
169
  } = findClosestSnap(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, MEDIA_SINGLE_SNAP_GAP);
170
- this.lastSnappedGuidelineKeys = activeGuidelineKeys;
171
170
  const relativeGuidelines = activeGuidelineKeys.length ? [] : this.getRelativeGuides();
171
+ this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(rg => rg.key);
172
172
  this.displayGuideline([...getGuidelinesWithHighlights(gap, MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines), ...relativeGuidelines]);
173
173
  }
174
174
  });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns a plain text serialization of a given slice. This is used for populating the plain text
3
3
  * section of the clipboard on copy.
4
- * The current implementation is bare bones - only inlineCards and blockCards are tested (they
4
+ * The current implementation is bare bones - only inlineCards, blockCards and mentions are tested (they
5
5
  * previously were empty on plain text copy).
6
6
  * Unknown nodes are passed to node.textBetween().
7
7
  *
@@ -26,6 +26,8 @@ export function clipboardTextSerializer(slice) {
26
26
  text += node.attrs.url;
27
27
  } else if (node.type.name === 'blockCard') {
28
28
  text += node.attrs.url;
29
+ } else if (node.type.name === 'mention') {
30
+ text += node.attrs.text;
29
31
  } else {
30
32
  text += node.textBetween(0, node.content.size, '\n\n');
31
33
  }
@@ -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)) {
24
+ if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState.tr)) {
25
25
  const {
26
26
  indentLevel,
27
27
  itemIndex
@@ -38,8 +38,7 @@ export function Toolbar(props) {
38
38
  const isOutdentButtonFocused = document.activeElement === outdentButtonRef.current;
39
39
  const handleOnItemActivated = buttonName => event => onItemActivated({
40
40
  editorView: props.editorView,
41
- buttonName,
42
- featureFlags: props.featureFlags
41
+ buttonName
43
42
  });
44
43
  useEffect(() => {
45
44
  if (isIndentButtonFocused && indentDisabled && outdentButtonRef.current) {
@@ -51,8 +51,7 @@ export function ToolbarDropdown(props) {
51
51
  setIsDropdownOpen(!shouldCloseMenu);
52
52
  return onItemActivated({
53
53
  editorView: props.editorView,
54
- buttonName: item.value.name,
55
- featureFlags: props.featureFlags
54
+ buttonName: item.value.name
56
55
  });
57
56
  };
58
57
  return jsx("span", {
@@ -4,15 +4,14 @@ import { INPUT_METHOD } from '../../analytics';
4
4
  import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
5
5
  export const onItemActivated = pluginInjectionApi => ({
6
6
  buttonName,
7
- editorView,
8
- featureFlags
7
+ editorView
9
8
  }) => {
10
9
  switch (buttonName) {
11
10
  case 'bullet_list':
12
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
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));
13
12
  break;
14
13
  case 'ordered_list':
15
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleOrderedList(editorView, INPUT_METHOD.TOOLBAR);
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));
16
15
  break;
17
16
  case 'indent':
18
17
  {
@@ -22,7 +21,7 @@ export const onItemActivated = pluginInjectionApi => ({
22
21
  indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
23
22
  }
24
23
  if (node === 'list') {
25
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.indentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
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));
26
25
  }
27
26
  if (node === 'taskList') {
28
27
  indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -37,7 +36,7 @@ export const onItemActivated = pluginInjectionApi => ({
37
36
  outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
38
37
  }
39
38
  if (node === 'list') {
40
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
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));
41
40
  }
42
41
  if (node === 'taskList') {
43
42
  outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.30.7";
2
+ export const version = "187.30.9";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -22,7 +22,7 @@ import { messages } from '@atlaskit/media-ui';
22
22
  import { cardMessages } from '@atlaskit/editor-common/messages';
23
23
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
24
24
  import { FilePreviewItem } from './filePreviewItem';
25
- import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode } from './utils';
25
+ import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode, getPixelWidthOfElement } from './utils';
26
26
  import { isVideo } from '../utils/media-single';
27
27
  import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
28
28
  import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
@@ -30,7 +30,7 @@ import ImageBorderItem from '../ui/ImageBorder';
30
30
  import { currentMediaNodeBorderMark } from '../utils/current-media-node';
31
31
  import { shouldShowImageBorder } from './imageBorder';
32
32
  import { PixelEntry } from '../ui/PixelEntry';
33
- import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, MEDIA_SINGLE_GUTTER_SIZE, calcMediaSinglePixelWidth, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
33
+ import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, calcMinWidth, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
34
34
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
35
35
  var remove = function remove(state, dispatch) {
36
36
  if (dispatch) {
@@ -261,7 +261,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
261
261
  type: 'custom',
262
262
  fallback: [],
263
263
  render: function render(editorView) {
264
- var _widthPlugin$sharedSt2, _widthPlugin$sharedSt3;
264
+ var _widthPlugin$sharedSt2;
265
265
  if (!editorView) {
266
266
  return null;
267
267
  }
@@ -272,15 +272,11 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
272
272
  return null;
273
273
  }
274
274
  var contentWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || akEditorDefaultLayoutWidth;
275
- var containerWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt3 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt3 === void 0 ? void 0 : _widthPlugin$sharedSt3.width) || akEditorFullWidthLayoutWidth;
276
275
  var selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
277
276
  if (!selectedMediaNode) {
278
277
  return null;
279
278
  }
280
- var _selectedMediaSingleN = selectedMediaSingleNode.node.attrs,
281
- singleMediaWidth = _selectedMediaSingleN.width,
282
- widthType = _selectedMediaSingleN.widthType,
283
- layout = _selectedMediaSingleN.layout;
279
+ var widthType = selectedMediaSingleNode.node.attrs.widthType;
284
280
  var _selectedMediaNode$at = selectedMediaNode.attrs,
285
281
  mediaWidth = _selectedMediaNode$at.width,
286
282
  mediaHeight = _selectedMediaNode$at.height;
@@ -289,15 +285,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
289
285
  var isVideoFile = isVideo(selectedMediaNode.attrs.__fileMimeType);
290
286
  var minWidth = calcMinWidth(isVideoFile, maxWidthForNestedNode || contentWidth);
291
287
  var isLegacy = widthType !== 'pixel';
292
- var pixelWidth = calcMediaSinglePixelWidth({
293
- width: singleMediaWidth,
294
- widthType: widthType,
295
- origWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
296
- layout: layout,
297
- contentWidth: getMaxWidthForNestedNode(editorView, selectedMediaSingleNode.pos) || contentWidth,
298
- containerWidth: containerWidth,
299
- gutterOffset: MEDIA_SINGLE_GUTTER_SIZE
300
- });
288
+ var pixelWidth = getPixelWidthOfElement(editorView, selectedMediaSingleNode.pos + 1,
289
+ // get pos of media node
290
+ mediaWidth || DEFAULT_IMAGE_WIDTH);
301
291
  return /*#__PURE__*/React.createElement(PixelEntry, {
302
292
  intl: intl,
303
293
  width: pluginState.isResizing ? pluginState.resizingWidth : pixelWidth,
@@ -62,4 +62,11 @@ export var removeMediaGroupNode = function removeMediaGroupNode(state) {
62
62
  export var getSelectedMediaSingle = function getSelectedMediaSingle(state) {
63
63
  var mediaSingle = state.schema.nodes.mediaSingle;
64
64
  return findSelectedNodeOfType(mediaSingle)(state.selection) || findParentNodeOfType(mediaSingle)(state.selection);
65
+ };
66
+ export var getPixelWidthOfElement = function getPixelWidthOfElement(editorView, pos, mediaWidth) {
67
+ var domNode = editorView.nodeDOM(pos);
68
+ if (domNode instanceof HTMLElement) {
69
+ return domNode.offsetWidth;
70
+ }
71
+ return mediaWidth;
65
72
  };
@@ -178,8 +178,10 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
178
178
  var _findClosestSnap = findClosestSnap(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, MEDIA_SINGLE_SNAP_GAP),
179
179
  gap = _findClosestSnap.gap,
180
180
  activeGuidelineKeys = _findClosestSnap.keys;
181
- _this.lastSnappedGuidelineKeys = activeGuidelineKeys;
182
181
  var relativeGuidelines = activeGuidelineKeys.length ? [] : _this.getRelativeGuides();
182
+ _this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(function (rg) {
183
+ return rg.key;
184
+ });
183
185
  _this.displayGuideline([].concat(_toConsumableArray(getGuidelinesWithHighlights(gap, MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines)), _toConsumableArray(relativeGuidelines)));
184
186
  }
185
187
  });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Returns a plain text serialization of a given slice. This is used for populating the plain text
3
3
  * section of the clipboard on copy.
4
- * The current implementation is bare bones - only inlineCards and blockCards are tested (they
4
+ * The current implementation is bare bones - only inlineCards, blockCards and mentions are tested (they
5
5
  * previously were empty on plain text copy).
6
6
  * Unknown nodes are passed to node.textBetween().
7
7
  *
@@ -26,6 +26,8 @@ export function clipboardTextSerializer(slice) {
26
26
  text += node.attrs.url;
27
27
  } else if (node.type.name === 'blockCard') {
28
28
  text += node.attrs.url;
29
+ } else if (node.type.name === 'mention') {
30
+ text += node.attrs.text;
29
31
  } else {
30
32
  text += node.textBetween(0, node.content.size, '\n\n');
31
33
  }
@@ -19,7 +19,7 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
19
19
  // not use the indentation mark.
20
20
  // Check for lists before paragraphs and headings in case
21
21
  // the selection is in a list nested in a layout column.
22
- if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState)) {
22
+ if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState.tr)) {
23
23
  var _getListItemAttribute = getListItemAttributes(selection.$head),
24
24
  indentLevel = _getListItemAttribute.indentLevel,
25
25
  itemIndex = _getListItemAttribute.itemIndex;
@@ -37,8 +37,7 @@ export function Toolbar(props) {
37
37
  return function (event) {
38
38
  return onItemActivated({
39
39
  editorView: props.editorView,
40
- buttonName: buttonName,
41
- featureFlags: props.featureFlags
40
+ buttonName: buttonName
42
41
  });
43
42
  };
44
43
  };
@@ -55,8 +55,7 @@ export function ToolbarDropdown(props) {
55
55
  setIsDropdownOpen(!shouldCloseMenu);
56
56
  return onItemActivated({
57
57
  editorView: props.editorView,
58
- buttonName: item.value.name,
59
- featureFlags: props.featureFlags
58
+ buttonName: item.value.name
60
59
  });
61
60
  };
62
61
  return jsx("span", {
@@ -5,14 +5,13 @@ import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentat
5
5
  export var onItemActivated = function onItemActivated(pluginInjectionApi) {
6
6
  return function (_ref) {
7
7
  var buttonName = _ref.buttonName,
8
- editorView = _ref.editorView,
9
- featureFlags = _ref.featureFlags;
8
+ editorView = _ref.editorView;
10
9
  switch (buttonName) {
11
10
  case 'bullet_list':
12
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
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));
13
12
  break;
14
13
  case 'ordered_list':
15
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleOrderedList(editorView, INPUT_METHOD.TOOLBAR);
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));
16
15
  break;
17
16
  case 'indent':
18
17
  {
@@ -22,7 +21,7 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
22
21
  indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
23
22
  }
24
23
  if (node === 'list') {
25
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.indentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
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));
26
25
  }
27
26
  if (node === 'taskList') {
28
27
  indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -37,7 +36,7 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
37
36
  outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
38
37
  }
39
38
  if (_node === 'list') {
40
- pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
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));
41
40
  }
42
41
  if (_node === 'taskList') {
43
42
  outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.30.7";
2
+ export var version = "187.30.9";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -284,6 +284,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
284
284
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
285
285
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
286
286
  };
287
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
287
288
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
288
289
  pluginConfiguration: TextFormattingOptions | undefined;
289
290
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
@@ -324,6 +325,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
324
325
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
325
326
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
326
327
  };
328
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
327
329
  }>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
328
330
  pluginConfiguration: HyperlinkPluginOptions | undefined;
329
331
  dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
@@ -669,6 +671,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
669
671
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
670
672
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
671
673
  };
674
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
672
675
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
673
676
  pluginConfiguration: TextFormattingOptions | undefined;
674
677
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
@@ -709,6 +712,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
709
712
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
710
713
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
711
714
  };
715
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
712
716
  }>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
713
717
  pluginConfiguration: HyperlinkPluginOptions | undefined;
714
718
  dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
@@ -1,7 +1,9 @@
1
1
  import type { MediaBaseAttributes } from '@atlaskit/adf-schema';
2
2
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { MediaPluginState } from '../pm-plugins/types';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
5
  export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
5
6
  export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
6
7
  export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
7
8
  export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils/dist/types").FindResult;
9
+ export declare const getPixelWidthOfElement: (editorView: EditorView, pos: number, mediaWidth: number) => number;
@@ -2,7 +2,7 @@ import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
2
  /**
3
3
  * Returns a plain text serialization of a given slice. This is used for populating the plain text
4
4
  * section of the clipboard on copy.
5
- * The current implementation is bare bones - only inlineCards and blockCards are tested (they
5
+ * The current implementation is bare bones - only inlineCards, blockCards and mentions are tested (they
6
6
  * previously were empty on plain text copy).
7
7
  * Unknown nodes are passed to node.textBetween().
8
8
  *
@@ -1,10 +1,8 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
2
  import type { ButtonName } from '../types';
4
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
4
  import type toolbarListsIndentationPlugin from '../index';
6
- export declare const onItemActivated: (pluginInjectionApi: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined) => ({ buttonName, editorView, featureFlags, }: {
7
- featureFlags: FeatureFlags;
5
+ export declare const onItemActivated: (pluginInjectionApi: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined) => ({ buttonName, editorView, }: {
8
6
  buttonName: ButtonName;
9
7
  editorView: EditorView;
10
8
  }) => void;
@@ -341,6 +341,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
341
341
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
342
342
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
343
343
  };
344
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
344
345
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
345
346
  pluginConfiguration: TextFormattingOptions | undefined;
346
347
  dependencies: [
@@ -387,6 +388,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
387
388
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
388
389
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
389
390
  };
391
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
390
392
  }>,
391
393
  (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
392
394
  pluginConfiguration: HyperlinkPluginOptions | undefined;
@@ -806,6 +808,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
806
808
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
807
809
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
808
810
  };
811
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
809
812
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
810
813
  pluginConfiguration: TextFormattingOptions | undefined;
811
814
  dependencies: [
@@ -852,6 +855,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
852
855
  toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
853
856
  toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkEditorCommand;
854
857
  };
858
+ sharedState: import("@atlaskit/editor-common/types").TextFormattingState | undefined;
855
859
  }>,
856
860
  (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
857
861
  pluginConfiguration: HyperlinkPluginOptions | undefined;
@@ -1,7 +1,9 @@
1
1
  import type { MediaBaseAttributes } from '@atlaskit/adf-schema';
2
2
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { MediaPluginState } from '../pm-plugins/types';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
5
  export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
5
6
  export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
6
7
  export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
7
8
  export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils/dist/types").FindResult;
9
+ export declare const getPixelWidthOfElement: (editorView: EditorView, pos: number, mediaWidth: number) => number;
@@ -2,7 +2,7 @@ import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
2
  /**
3
3
  * Returns a plain text serialization of a given slice. This is used for populating the plain text
4
4
  * section of the clipboard on copy.
5
- * The current implementation is bare bones - only inlineCards and blockCards are tested (they
5
+ * The current implementation is bare bones - only inlineCards, blockCards and mentions are tested (they
6
6
  * previously were empty on plain text copy).
7
7
  * Unknown nodes are passed to node.textBetween().
8
8
  *
@@ -1,10 +1,8 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
2
  import type { ButtonName } from '../types';
4
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
4
  import type toolbarListsIndentationPlugin from '../index';
6
- export declare const onItemActivated: (pluginInjectionApi: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined) => ({ buttonName, editorView, featureFlags, }: {
7
- featureFlags: FeatureFlags;
5
+ export declare const onItemActivated: (pluginInjectionApi: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined) => ({ buttonName, editorView, }: {
8
6
  buttonName: ButtonName;
9
7
  editorView: EditorView;
10
8
  }) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.30.7",
3
+ "version": "187.30.9",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -74,9 +74,9 @@
74
74
  "@atlaskit/editor-plugin-guideline": "^0.4.0",
75
75
  "@atlaskit/editor-plugin-hyperlink": "^0.3.0",
76
76
  "@atlaskit/editor-plugin-image-upload": "^0.1.0",
77
- "@atlaskit/editor-plugin-list": "^1.0.0",
77
+ "@atlaskit/editor-plugin-list": "^1.1.0",
78
78
  "@atlaskit/editor-plugin-table": "^2.10.0",
79
- "@atlaskit/editor-plugin-text-formatting": "^0.2.0",
79
+ "@atlaskit/editor-plugin-text-formatting": "^0.3.0",
80
80
  "@atlaskit/editor-plugin-type-ahead": "^0.1.0",
81
81
  "@atlaskit/editor-plugin-width": "^0.1.0",
82
82
  "@atlaskit/editor-prosemirror": "1.1.0",
@@ -104,7 +104,7 @@
104
104
  "@atlaskit/radio": "^5.6.0",
105
105
  "@atlaskit/section-message": "^6.4.0",
106
106
  "@atlaskit/select": "^16.5.0",
107
- "@atlaskit/smart-card": "^26.15.0",
107
+ "@atlaskit/smart-card": "^26.16.0",
108
108
  "@atlaskit/smart-user-picker": "^6.3.0",
109
109
  "@atlaskit/spinner": "^15.5.0",
110
110
  "@atlaskit/status": "^1.3.0",