@atlaskit/editor-core 187.19.0 → 187.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/plugins/media/index.js +4 -3
  3. package/dist/cjs/plugins/media/pm-plugins/alt-text/commands.js +10 -7
  4. package/dist/cjs/plugins/media/pm-plugins/alt-text/keymap.js +2 -2
  5. package/dist/cjs/plugins/media/pm-plugins/main.js +9 -9
  6. package/dist/cjs/plugins/media/toolbar/alt-text.js +2 -2
  7. package/dist/cjs/plugins/media/toolbar/index.js +12 -11
  8. package/dist/cjs/plugins/media/utils/media-single.js +13 -13
  9. package/dist/cjs/plugins/paste/handlers.js +2 -2
  10. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +2 -2
  11. package/dist/cjs/plugins/paste/pm-plugins/main.js +4 -4
  12. package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
  13. package/dist/cjs/plugins/selection/gap-cursor/utils/place-gap-cursor.js +3 -3
  14. package/dist/cjs/plugins/selection/gap-cursor/utils.js +6 -3
  15. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +3 -3
  16. package/dist/cjs/version-wrapper.js +1 -1
  17. package/dist/cjs/version.json +1 -1
  18. package/dist/es2019/plugins/media/index.js +6 -3
  19. package/dist/es2019/plugins/media/pm-plugins/alt-text/commands.js +3 -2
  20. package/dist/es2019/plugins/media/pm-plugins/alt-text/keymap.js +2 -2
  21. package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
  22. package/dist/es2019/plugins/media/toolbar/alt-text.js +2 -2
  23. package/dist/es2019/plugins/media/toolbar/index.js +12 -11
  24. package/dist/es2019/plugins/media/utils/media-single.js +7 -8
  25. package/dist/es2019/plugins/paste/handlers.js +2 -3
  26. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  27. package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -4
  28. package/dist/es2019/plugins/selection/gap-cursor/styles.js +2 -1
  29. package/dist/es2019/plugins/selection/gap-cursor/utils/place-gap-cursor.js +4 -4
  30. package/dist/es2019/plugins/selection/gap-cursor/utils.js +5 -2
  31. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +4 -4
  32. package/dist/es2019/version-wrapper.js +1 -1
  33. package/dist/es2019/version.json +1 -1
  34. package/dist/esm/plugins/media/index.js +4 -3
  35. package/dist/esm/plugins/media/pm-plugins/alt-text/commands.js +10 -7
  36. package/dist/esm/plugins/media/pm-plugins/alt-text/keymap.js +2 -2
  37. package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
  38. package/dist/esm/plugins/media/toolbar/alt-text.js +2 -2
  39. package/dist/esm/plugins/media/toolbar/index.js +12 -11
  40. package/dist/esm/plugins/media/utils/media-single.js +7 -7
  41. package/dist/esm/plugins/paste/handlers.js +2 -3
  42. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  43. package/dist/esm/plugins/paste/pm-plugins/main.js +4 -4
  44. package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
  45. package/dist/esm/plugins/selection/gap-cursor/utils/place-gap-cursor.js +4 -4
  46. package/dist/esm/plugins/selection/gap-cursor/utils.js +5 -2
  47. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +4 -4
  48. package/dist/esm/version-wrapper.js +1 -1
  49. package/dist/esm/version.json +1 -1
  50. package/dist/types/plugins/media/pm-plugins/alt-text/commands.d.ts +2 -1
  51. package/dist/types/plugins/media/pm-plugins/alt-text/keymap.d.ts +2 -1
  52. package/dist/types/plugins/media/toolbar/alt-text.d.ts +2 -1
  53. package/dist/types/plugins/media/utils/media-single.d.ts +3 -3
  54. package/dist/types/plugins/paste/handlers.d.ts +2 -1
  55. package/dist/types/plugins/paste/index.d.ts +3 -1
  56. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +2 -1
  57. package/dist/types/plugins/selection/gap-cursor/utils.d.ts +1 -1
  58. package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/commands.d.ts +2 -1
  59. package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/keymap.d.ts +2 -1
  60. package/dist/types-ts4.5/plugins/media/toolbar/alt-text.d.ts +2 -1
  61. package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +3 -3
  62. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -1
  63. package/dist/types-ts4.5/plugins/paste/index.d.ts +3 -1
  64. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +2 -1
  65. package/dist/types-ts4.5/plugins/selection/gap-cursor/utils.d.ts +1 -1
  66. package/package.json +1 -1
  67. package/report.api.md +1 -0
  68. package/tmp/api-report-tmp.d.ts +1 -1
@@ -102,7 +102,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
102
102
  }
103
103
  },
104
104
  handlePaste: function handlePaste(view, rawEvent, slice) {
105
- var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3;
105
+ var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$d4, _pluginInjectionApi$d5;
106
106
  var event = rawEvent;
107
107
  if (!event.clipboardData) {
108
108
  return false;
@@ -266,7 +266,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
266
266
  if (handleCodeBlockWithAnalytics(view, event, slice, text)(state, dispatch)) {
267
267
  return true;
268
268
  }
269
- if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText)(state, dispatch, view)) {
269
+ if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.analytics) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.actions)(state, dispatch, view)) {
270
270
  return true;
271
271
  }
272
272
  if (handleSelectedTableWithAnalytics(view, event, slice)(state, dispatch)) {
@@ -299,7 +299,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
299
299
 
300
300
  // finally, handle rich-text copy-paste
301
301
  if (isRichText) {
302
- var _pluginInjectionApi$d4, _pluginInjectionApi$d5;
302
+ var _pluginInjectionApi$d6, _pluginInjectionApi$d7;
303
303
  // linkify the text where possible
304
304
  slice = linkifyContent(state.schema)(slice);
305
305
  if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
@@ -307,7 +307,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
307
307
  }
308
308
 
309
309
  // run macro autoconvert prior to other conversions
310
- if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.actions) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
310
+ if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : (_pluginInjectionApi$d7 = _pluginInjectionApi$d6.actions) === null || _pluginInjectionApi$d7 === void 0 ? void 0 : _pluginInjectionApi$d7.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
311
311
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
312
312
  sendPasteAnalyticsEvent(view, event, slice, {
313
313
  type: PasteTypes.richText
@@ -7,4 +7,4 @@ var gapCursor = '.ProseMirror-gapcursor';
7
7
  var prosemirrorwidget = '.ProseMirror-widget';
8
8
  var wrapLeft = '[layout="wrap-left"]';
9
9
  var wrapRight = '[layout="wrap-right"]';
10
- export var gapCursorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* =============== GAP CURSOR ================== */\n .ProseMirror {\n &.", " {\n caret-color: transparent;\n }\n\n ", " {\n display: none;\n pointer-events: none;\n position: relative;\n\n & span {\n caret-color: transparent;\n position: absolute;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n & span::after {\n animation: 1s ", " step-end infinite;\n border-left: 1px solid;\n content: '';\n display: block;\n position: absolute;\n top: 0;\n height: 100%;\n }\n &.-left span::after {\n left: -3px;\n }\n &.-right span::after {\n right: -3px;\n }\n & span[layout='full-width'],\n & span[layout='wide'] {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n &", " {\n float: right;\n }\n\n /* fix vertical alignment of gap cursor */\n &:first-of-type + ul,\n &:first-of-type + span + ul,\n &:first-of-type + ol,\n &:first-of-type + span + ol,\n &:first-of-type + pre,\n &:first-of-type + span + pre,\n &:first-of-type + blockquote,\n &:first-of-type + span + blockquote {\n margin-top: 0;\n }\n }\n &.ProseMirror-focused ", " {\n display: block;\n border-color: transparent;\n }\n }\n\n /* This hack below is for two images aligned side by side */\n ", "", " + span + ", ",\n ", "", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " {\n clear: none;\n }\n\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div {\n margin-right: 0;\n margin-left: 0;\n margin-bottom: 0;\n }\n\n ", " + ", ",\n ", " + ", " {\n float: left;\n }\n\n ", " + ", " + span + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after {\n visibility: hidden;\n display: block;\n font-size: 0;\n content: ' ';\n clear: both;\n height: 0;\n }\n\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + *,\n ", " + ", " + span + * {\n margin-top: 0;\n }\n"])), hideCaretModifier, gapCursor, gapCursorBlink, wrapRight, gapCursor, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, wrapLeft, gapCursor, wrapRight, gapCursor, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, prosemirrorwidget, gapCursor, prosemirrorwidget, gapCursor);
10
+ export var gapCursorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* =============== GAP CURSOR ================== */\n .ProseMirror {\n &.", " {\n caret-color: transparent;\n }\n\n ", " {\n display: none;\n pointer-events: none;\n position: relative;\n\n & span {\n caret-color: transparent;\n position: absolute;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n & span::after {\n animation: 1s ", " step-end infinite;\n border-left: 1px solid;\n content: '';\n display: block;\n position: absolute;\n top: 0;\n height: 100%;\n }\n &.-left span::after {\n left: -3px;\n }\n &.-right span::after {\n right: -3px;\n }\n & span[layout='full-width'],\n & span[layout='wide'],\n & span[layout='fixed-width'] {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n &", " {\n float: right;\n }\n\n /* fix vertical alignment of gap cursor */\n &:first-of-type + ul,\n &:first-of-type + span + ul,\n &:first-of-type + ol,\n &:first-of-type + span + ol,\n &:first-of-type + pre,\n &:first-of-type + span + pre,\n &:first-of-type + blockquote,\n &:first-of-type + span + blockquote {\n margin-top: 0;\n }\n }\n &.ProseMirror-focused ", " {\n display: block;\n border-color: transparent;\n }\n }\n\n /* This hack below is for two images aligned side by side */\n ", "", " + span + ", ",\n ", "", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " + ", ",\n ", " + ", " + span ", ",\n ", " + ", " + ", ",\n ", " + ", " + span + ", ",\n ", " + ", " {\n clear: none;\n }\n\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div,\n ", " + ", " + ", " > div,\n ", " + ", " + span + ", " > div {\n margin-right: 0;\n margin-left: 0;\n margin-bottom: 0;\n }\n\n ", " + ", ",\n ", " + ", " {\n float: left;\n }\n\n ", " + ", " + span + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after,\n ", " + ", " + ", "::after,\n ", " + ", " + span + ", "::after {\n visibility: hidden;\n display: block;\n font-size: 0;\n content: ' ';\n clear: both;\n height: 0;\n }\n\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + ", " + *,\n ", " + ", " + ", " + span + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + span + ", " + *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + ", " + * > *,\n ", " + ", " + ", " + span + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + span + ", " + * > *,\n ", " + ", " + *,\n ", " + ", " + span + * {\n margin-top: 0;\n }\n"])), hideCaretModifier, gapCursor, gapCursorBlink, wrapRight, gapCursor, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapRight, wrapLeft, gapCursor, wrapRight, gapCursor, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, wrapRight, gapCursor, wrapLeft, wrapLeft, gapCursor, wrapRight, wrapRight, gapCursor, wrapLeft, gapCursor, wrapLeft, wrapRight, gapCursor, wrapRight, wrapLeft, prosemirrorwidget, gapCursor, prosemirrorwidget, gapCursor);
@@ -1,5 +1,5 @@
1
1
  import _toArray from "@babel/runtime/helpers/toArray";
2
- import { getBreakoutModeFromTargetNode, isLeftCursor } from '../utils';
2
+ import { getLayoutModeFromTargetNode, isLeftCursor } from '../utils';
3
3
  import { Side } from '../selection';
4
4
 
5
5
  /**
@@ -79,9 +79,9 @@ export var toDOM = function toDOM(view, getPos) {
79
79
  if (nodeStart !== 0 || node && node.type.name === 'table') {
80
80
  gapCursor.style.marginTop = style.getPropertyValue('margin-top');
81
81
  }
82
- var breakoutMode = node && getBreakoutModeFromTargetNode(node);
83
- if (breakoutMode) {
84
- gapCursor.setAttribute('layout', breakoutMode);
82
+ var layoutMode = node && getLayoutModeFromTargetNode(node);
83
+ if (layoutMode) {
84
+ gapCursor.setAttribute('layout', layoutMode);
85
85
  gapCursor.style.width = "".concat(measureWidth(style), "px");
86
86
  } else {
87
87
  mutateElementStyle(gapCursor, style, selection.side);
@@ -58,7 +58,7 @@ export var isTextBlockNearPos = function isTextBlockNearPos(doc, schema, $pos, d
58
58
  }
59
59
  return false;
60
60
  };
61
- export function getBreakoutModeFromTargetNode(node) {
61
+ export function getLayoutModeFromTargetNode(node) {
62
62
  var layout;
63
63
  if (node.attrs.layout) {
64
64
  layout = node.attrs.layout;
@@ -72,7 +72,10 @@ export function getBreakoutModeFromTargetNode(node) {
72
72
  }
73
73
  }).attrs.mode;
74
74
  }
75
- if (['wide', 'full-width'].indexOf(layout) === -1) {
75
+ if (node.type.name === 'table' && node.attrs.width) {
76
+ layout = 'fixed-width';
77
+ }
78
+ if (['wide', 'full-width', 'fixed-width'].indexOf(layout) === -1) {
76
79
  return '';
77
80
  }
78
81
  return layout;
@@ -5,7 +5,7 @@ import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
6
6
  import { hideCaretModifier } from '../gap-cursor/styles';
7
7
  import { GapCursorSelection, JSON_ID, Side as GapCursorSide, Side } from '../gap-cursor/selection';
8
- import { getBreakoutModeFromTargetNode, isIgnoredClick } from '../gap-cursor/utils';
8
+ import { getLayoutModeFromTargetNode, isIgnoredClick } from '../gap-cursor/utils';
9
9
  import { toDOM } from '../gap-cursor/utils/place-gap-cursor';
10
10
  import { deleteNode, setGapCursorAtPos } from '../gap-cursor/actions';
11
11
  import { Direction } from '../gap-cursor/direction';
@@ -69,10 +69,10 @@ var plugin = new SafePlugin({
69
69
  }
70
70
  }
71
71
  var node = isRightCursor ? $from.nodeBefore : $from.nodeAfter;
72
- var breakoutMode = node && getBreakoutModeFromTargetNode(node);
72
+ var layoutMode = node && getLayoutModeFromTargetNode(node);
73
73
  return DecorationSet.create(doc, [Decoration.widget(position, toDOM, {
74
- key: "".concat(JSON_ID, "-").concat(side, "-").concat(breakoutMode),
75
- side: breakoutMode ? -1 : 0
74
+ key: "".concat(JSON_ID, "-").concat(side, "-").concat(layoutMode),
75
+ side: layoutMode ? -1 : 0
76
76
  })]);
77
77
  }
78
78
  return null;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.19.0";
2
+ export var version = "187.19.1";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.19.0",
3
+ "version": "187.19.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
2
  export declare const closeMediaAltTextMenu: import("@atlaskit/editor-common/types").Command;
2
- export declare const openMediaAltTextMenu: import("../../../..").Command;
3
+ export declare const openMediaAltTextMenu: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
3
4
  export declare const updateAltText: (newAltText: string) => import("@atlaskit/editor-common/types").Command;
@@ -1,3 +1,4 @@
1
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- export default function keymapPlugin(schema: Schema): SafePlugin;
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ export default function keymapPlugin(schema: Schema, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined): SafePlugin;
@@ -4,7 +4,8 @@ import type { Command } from '../../../types';
4
4
  import type { MediaToolbarBaseConfig } from '../types';
5
5
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
7
- export declare const altTextButton: (intl: IntlShape, state: EditorState) => FloatingToolbarButton<Command>;
7
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
8
+ export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => FloatingToolbarButton<Command>;
8
9
  export declare const altTextEditComponent: (options?: AltTextToolbarOptions) => FloatingToolbarCustom<Command>;
9
10
  export interface AltTextToolbarOptions {
10
11
  altTextValidator?: (value: string) => string[];
@@ -3,7 +3,7 @@ import { Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { MediaState } from '../types';
6
- import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
6
+ import type { InputMethodInsertMedia, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
7
  import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
8
8
  export interface MediaSingleState extends MediaState {
9
9
  dimensions: {
@@ -14,8 +14,8 @@ export interface MediaSingleState extends MediaState {
14
14
  contextId?: string;
15
15
  }
16
16
  export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
17
- export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
18
- export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined) => boolean;
17
+ export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
18
+ export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
19
19
  export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
20
20
  export declare function transformSliceForMedia(slice: Slice, schema: Schema): (selection: Selection) => Slice;
21
21
  export declare function isCaptionNode(editorView: EditorView): boolean;
@@ -5,6 +5,7 @@ import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extens
5
5
  import type { Command } from '../../types';
6
6
  import type { InputMethodInsertMedia } from '../analytics';
7
7
  import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
8
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
8
9
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
9
10
  export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
10
11
  export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice): Command;
@@ -14,7 +15,7 @@ export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEv
14
15
  export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
15
16
  export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
16
17
  export declare function handleCodeBlock(text: string): Command;
17
- export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia): (slice: Slice) => Command;
18
+ export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined): (slice: Slice) => Command;
18
19
  export declare function handleExpandPasteInTable(slice: Slice): Command;
19
20
  export declare function handleMarkdown(markdownSlice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, from?: number, to?: number): Command;
20
21
  export declare function handleParagraphBlockMarks(state: EditorState, slice: Slice): Slice;
@@ -4,6 +4,7 @@ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
4
  import type { cardPlugin } from '@atlaskit/editor-plugin-card';
5
5
  import type betterTypeHistoryPlugin from '../better-type-history';
6
6
  import type listPlugin from '../list';
7
+ import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
8
  export type PastePluginOptions = {
8
9
  cardOptions?: CardOptions;
9
10
  sanitizePrivateContent?: boolean;
@@ -14,7 +15,8 @@ declare const pastePlugin: NextEditorPlugin<'paste', {
14
15
  typeof featureFlagsPlugin,
15
16
  OptionalPlugin<typeof listPlugin>,
16
17
  typeof betterTypeHistoryPlugin,
17
- OptionalPlugin<typeof cardPlugin>
18
+ OptionalPlugin<typeof cardPlugin>,
19
+ OptionalPlugin<typeof analyticsPlugin>
18
20
  ];
19
21
  }>;
20
22
  export default pastePlugin;
@@ -3,6 +3,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Slice, Fragment, Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
5
5
  import type pastePlugin from '../';
6
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
7
  type PasteContext = {
7
8
  type: PasteType;
8
9
  asPlain?: boolean;
@@ -24,7 +25,7 @@ export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, eve
24
25
  export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
25
26
  export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
26
27
  export declare const handleCodeBlockWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
27
- export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
28
+ export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
28
29
  export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
29
30
  export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
31
  export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
@@ -3,5 +3,5 @@ import { Side } from './selection';
3
3
  export declare const isLeftCursor: (side: Side) => side is Side.LEFT;
4
4
  export declare function getMediaNearPos(doc: PMNode, $pos: ResolvedPos, schema: Schema, dir?: number): PMNode | null;
5
5
  export declare const isTextBlockNearPos: (doc: PMNode, schema: Schema, $pos: ResolvedPos, dir: number) => boolean;
6
- export declare function getBreakoutModeFromTargetNode(node: PMNode): string;
6
+ export declare function getLayoutModeFromTargetNode(node: PMNode): string;
7
7
  export declare const isIgnoredClick: (elem: HTMLElement) => boolean;
@@ -1,3 +1,4 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
2
  export declare const closeMediaAltTextMenu: import("@atlaskit/editor-common/types").Command;
2
- export declare const openMediaAltTextMenu: import("../../../..").Command;
3
+ export declare const openMediaAltTextMenu: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
3
4
  export declare const updateAltText: (newAltText: string) => import("@atlaskit/editor-common/types").Command;
@@ -1,3 +1,4 @@
1
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- export default function keymapPlugin(schema: Schema): SafePlugin;
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ export default function keymapPlugin(schema: Schema, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined): SafePlugin;
@@ -4,7 +4,8 @@ import type { Command } from '../../../types';
4
4
  import type { MediaToolbarBaseConfig } from '../types';
5
5
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
7
- export declare const altTextButton: (intl: IntlShape, state: EditorState) => FloatingToolbarButton<Command>;
7
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
8
+ export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => FloatingToolbarButton<Command>;
8
9
  export declare const altTextEditComponent: (options?: AltTextToolbarOptions) => FloatingToolbarCustom<Command>;
9
10
  export interface AltTextToolbarOptions {
10
11
  altTextValidator?: (value: string) => string[];
@@ -3,7 +3,7 @@ import { Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { MediaState } from '../types';
6
- import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
6
+ import type { InputMethodInsertMedia, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
7
  import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
8
8
  export interface MediaSingleState extends MediaState {
9
9
  dimensions: {
@@ -14,8 +14,8 @@ export interface MediaSingleState extends MediaState {
14
14
  contextId?: string;
15
15
  }
16
16
  export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
17
- export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
18
- export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined) => boolean;
17
+ export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
18
+ export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
19
19
  export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
20
20
  export declare function transformSliceForMedia(slice: Slice, schema: Schema): (selection: Selection) => Slice;
21
21
  export declare function isCaptionNode(editorView: EditorView): boolean;
@@ -5,6 +5,7 @@ import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extens
5
5
  import type { Command } from '../../types';
6
6
  import type { InputMethodInsertMedia } from '../analytics';
7
7
  import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
8
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
8
9
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
9
10
  export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
10
11
  export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice): Command;
@@ -14,7 +15,7 @@ export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEv
14
15
  export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
15
16
  export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
16
17
  export declare function handleCodeBlock(text: string): Command;
17
- export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia): (slice: Slice) => Command;
18
+ export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined): (slice: Slice) => Command;
18
19
  export declare function handleExpandPasteInTable(slice: Slice): Command;
19
20
  export declare function handleMarkdown(markdownSlice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, from?: number, to?: number): Command;
20
21
  export declare function handleParagraphBlockMarks(state: EditorState, slice: Slice): Slice;
@@ -4,6 +4,7 @@ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
4
  import type { cardPlugin } from '@atlaskit/editor-plugin-card';
5
5
  import type betterTypeHistoryPlugin from '../better-type-history';
6
6
  import type listPlugin from '../list';
7
+ import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
8
  export type PastePluginOptions = {
8
9
  cardOptions?: CardOptions;
9
10
  sanitizePrivateContent?: boolean;
@@ -14,7 +15,8 @@ declare const pastePlugin: NextEditorPlugin<'paste', {
14
15
  typeof featureFlagsPlugin,
15
16
  OptionalPlugin<typeof listPlugin>,
16
17
  typeof betterTypeHistoryPlugin,
17
- OptionalPlugin<typeof cardPlugin>
18
+ OptionalPlugin<typeof cardPlugin>,
19
+ OptionalPlugin<typeof analyticsPlugin>
18
20
  ];
19
21
  }>;
20
22
  export default pastePlugin;
@@ -3,6 +3,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Slice, Fragment, Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
5
5
  import type pastePlugin from '../';
6
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
7
  type PasteContext = {
7
8
  type: PasteType;
8
9
  asPlain?: boolean;
@@ -24,7 +25,7 @@ export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, eve
24
25
  export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
25
26
  export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
26
27
  export declare const handleCodeBlockWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
27
- export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
28
+ export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
28
29
  export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
29
30
  export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
31
  export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
@@ -3,5 +3,5 @@ import { Side } from './selection';
3
3
  export declare const isLeftCursor: (side: Side) => side is Side.LEFT;
4
4
  export declare function getMediaNearPos(doc: PMNode, $pos: ResolvedPos, schema: Schema, dir?: number): PMNode | null;
5
5
  export declare const isTextBlockNearPos: (doc: PMNode, schema: Schema, $pos: ResolvedPos, dir: number) => boolean;
6
- export declare function getBreakoutModeFromTargetNode(node: PMNode): string;
6
+ export declare function getLayoutModeFromTargetNode(node: PMNode): string;
7
7
  export declare const isIgnoredClick: (elem: HTMLElement) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.19.0",
3
+ "version": "187.19.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -1170,6 +1170,7 @@ export const insertMediaSingleNode: (
1170
1170
  alignLeftOnInsert?: boolean,
1171
1171
  newInsertionBehaviour?: boolean,
1172
1172
  widthPluginState?: WidthPluginState | undefined,
1173
+ editorAnalyticsAPI?: EditorAnalyticsAPI | undefined,
1173
1174
  ) => boolean;
1174
1175
 
1175
1176
  // @public (undocumented)
@@ -1046,7 +1046,7 @@ type InsertItemProps = {
1046
1046
  };
1047
1047
 
1048
1048
  // @public (undocumented)
1049
- export const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined) => boolean;
1049
+ export const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
1050
1050
 
1051
1051
  // @public (undocumented)
1052
1052
  export const insertTaskDecisionCommand: (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | InsertBlockInputMethodToolbar, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;