@atlaskit/editor-common 84.3.2 → 84.5.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 (47) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cjs/keymaps/index.js +15 -4
  3. package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +20 -13
  4. package/dist/cjs/link/ConfigureLinkOverlay/index.js +4 -2
  5. package/dist/cjs/link/types.js +1 -0
  6. package/dist/cjs/media-single/utils.js +2 -2
  7. package/dist/cjs/messages/block-controls.js +24 -0
  8. package/dist/cjs/messages/index.js +7 -0
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/es2019/keymaps/index.js +10 -0
  12. package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +11 -2
  13. package/dist/es2019/link/ConfigureLinkOverlay/index.js +4 -2
  14. package/dist/es2019/link/types.js +1 -0
  15. package/dist/es2019/media-single/utils.js +3 -3
  16. package/dist/es2019/messages/block-controls.js +18 -0
  17. package/dist/es2019/messages/index.js +1 -0
  18. package/dist/es2019/monitoring/error.js +1 -1
  19. package/dist/es2019/ui/DropList/index.js +1 -1
  20. package/dist/esm/keymaps/index.js +11 -0
  21. package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +13 -5
  22. package/dist/esm/link/ConfigureLinkOverlay/index.js +4 -2
  23. package/dist/esm/link/types.js +1 -0
  24. package/dist/esm/media-single/utils.js +3 -3
  25. package/dist/esm/messages/block-controls.js +18 -0
  26. package/dist/esm/messages/index.js +1 -0
  27. package/dist/esm/monitoring/error.js +1 -1
  28. package/dist/esm/ui/DropList/index.js +1 -1
  29. package/dist/types/collab/index.d.ts +1 -0
  30. package/dist/types/keymaps/index.d.ts +8 -0
  31. package/dist/types/link/ConfigureLinkOverlay/Dropdown.d.ts +3 -2
  32. package/dist/types/link/ConfigureLinkOverlay/index.d.ts +6 -1
  33. package/dist/types/link/types.d.ts +3 -1
  34. package/dist/types/media-single/utils.d.ts +2 -1
  35. package/dist/types/messages/block-controls.d.ts +17 -0
  36. package/dist/types/messages/index.d.ts +1 -0
  37. package/dist/types/ui/MediaSingle/index.d.ts +2 -0
  38. package/dist/types-ts4.5/collab/index.d.ts +1 -0
  39. package/dist/types-ts4.5/keymaps/index.d.ts +8 -0
  40. package/dist/types-ts4.5/link/ConfigureLinkOverlay/Dropdown.d.ts +3 -2
  41. package/dist/types-ts4.5/link/ConfigureLinkOverlay/index.d.ts +6 -1
  42. package/dist/types-ts4.5/link/types.d.ts +3 -1
  43. package/dist/types-ts4.5/media-single/utils.d.ts +2 -1
  44. package/dist/types-ts4.5/messages/block-controls.d.ts +17 -0
  45. package/dist/types-ts4.5/messages/index.d.ts +1 -0
  46. package/dist/types-ts4.5/ui/MediaSingle/index.d.ts +2 -0
  47. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 84.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#119314](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119314)
8
+ [`e7b05702b37eb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e7b05702b37eb) -
9
+ Include session id in the activity join/ack data
10
+ - [#119163](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119163)
11
+ [`45ae1b9a97c16`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/45ae1b9a97c16) -
12
+ [ux] Added onDropdownChange prop to overlay in editor-common. Used this prop to keep link
13
+ configure overlay open when dropdown is open, and hide overlay when dropdown is hidden.
14
+
15
+ ## 84.4.2
16
+
17
+ ### Patch Changes
18
+
19
+ - [#118866](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/118866)
20
+ [`77bd34b00632f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77bd34b00632f) -
21
+ [ux] [ED-23873] Add tooltip to drag handle
22
+
23
+ ## 84.4.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
29
+ ## 84.4.0
30
+
31
+ ### Minor Changes
32
+
33
+ - [#118748](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/118748)
34
+ [`10bb9e2def098`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10bb9e2def098) -
35
+ [ux] Reduce media single max width padding for all editors except full page
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies
40
+
3
41
  ## 84.3.2
4
42
 
5
43
  ### Patch Changes
@@ -71,7 +71,7 @@ Object.defineProperty(exports, "RIGHT", {
71
71
  return _consts.RIGHT;
72
72
  }
73
73
  });
74
- exports.ToolTipContent = void 0;
74
+ exports.TooltipContentWithMultipleShortcuts = exports.ToolTipContent = void 0;
75
75
  Object.defineProperty(exports, "UP", {
76
76
  enumerable: true,
77
77
  get: function get() {
@@ -82,7 +82,7 @@ exports.backspace = exports.altPaste = exports.alignRight = exports.alignLeft =
82
82
  exports.bindKeymapArrayWithCommand = bindKeymapArrayWithCommand;
83
83
  exports.bindKeymapWithCommand = bindKeymapWithCommand;
84
84
  exports.bindKeymapWithEditorCommand = bindKeymapWithEditorCommand;
85
- exports.find = exports.escape = exports.enter = exports.deleteRow = exports.deleteKey = exports.deleteColumn = exports.decreaseMediaSize = exports.cut = exports.ctrlBackSpace = exports.copy = exports.clearFormatting = void 0;
85
+ exports.find = exports.escape = exports.enter = exports.dragToMoveUp = exports.dragToMoveDown = exports.deleteRow = exports.deleteKey = exports.deleteColumn = exports.decreaseMediaSize = exports.cut = exports.ctrlBackSpace = exports.copy = exports.clearFormatting = void 0;
86
86
  exports.findKeyMapForBrowser = findKeyMapForBrowser;
87
87
  exports.findKeymapByDescription = findKeymapByDescription;
88
88
  exports.findShortcutByDescription = findShortcutByDescription;
@@ -100,8 +100,8 @@ Object.defineProperty(exports, "keymap", {
100
100
  exports.makeKeyMapArrayWithCommon = makeKeyMapArrayWithCommon;
101
101
  exports.makeKeyMapWithCommon = makeKeyMapWithCommon;
102
102
  exports.makeKeymap = makeKeymap;
103
- exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
104
- exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = void 0;
103
+ exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
104
+ exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = void 0;
105
105
  exports.tooltip = tooltip;
106
106
  exports.undo = void 0;
107
107
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -208,6 +208,8 @@ var decreaseMediaSize = exports.decreaseMediaSize = makeKeyMapWithCommon('increa
208
208
  var activateVideoControls = exports.activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
209
209
  var toggleHighlightPalette = exports.toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palette', 'Mod-Alt-b');
210
210
  var focusToContextMenuTrigger = exports.focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
211
+ var dragToMoveUp = exports.dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Alt-Shift-ArrowUp');
212
+ var dragToMoveDown = exports.dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Alt-Shift-ArrowDown');
211
213
  var arrowKeysMap = {
212
214
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
213
215
  ARROWLEFT: "\u2190",
@@ -255,6 +257,15 @@ var ToolTipContent = exports.ToolTipContent = /*#__PURE__*/_react.default.memo(f
255
257
  css: tooltipShortcutStyle
256
258
  }, shortcut)) : null;
257
259
  });
260
+ var TooltipContentWithMultipleShortcuts = exports.TooltipContentWithMultipleShortcuts = /*#__PURE__*/_react.default.memo(function (_ref2) {
261
+ var helpDescriptors = _ref2.helpDescriptors;
262
+ var keymapCount = helpDescriptors.length;
263
+ return (0, _react2.jsx)(_react.Fragment, null, helpDescriptors.map(function (descriptor, index) {
264
+ return (0, _react2.jsx)(_react.Fragment, {
265
+ key: index
266
+ }, (0, _react2.jsx)(ToolTipContent, descriptor), " ", index < keymapCount - 1 && (0, _react2.jsx)("br", null));
267
+ }));
268
+ });
258
269
  function findKeymapByDescription(description) {
259
270
  var matches = ALL.filter(function (keymap) {
260
271
  return keymap.description.toUpperCase() === description.toUpperCase();
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _react = require("@emotion/react");
11
+ var _react = require("react");
12
+ var _react2 = require("@emotion/react");
12
13
  var _reactIntlNext = require("react-intl-next");
13
14
  var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
14
15
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
@@ -22,32 +23,38 @@ var _excluded = ["triggerRef"];
22
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
25
  var Dropdown = function Dropdown(_ref) {
25
- var testId = _ref.testId;
26
+ var testId = _ref.testId,
27
+ onDropdownChange = _ref.onDropdownChange;
26
28
  var _useIntl = (0, _reactIntlNext.useIntl)(),
27
29
  formatMessage = _useIntl.formatMessage;
28
30
  var configureLinkLabel = formatMessage(_messages.cardMessages.inlineConfigureLink);
29
31
  var goToLinkLabel = formatMessage(_messages.cardMessages.inlineGoToLink);
30
- return (0, _react.jsx)(_dropdownMenu.default, {
31
- trigger: function trigger(_ref2) {
32
- var triggerRef = _ref2.triggerRef,
33
- props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
34
- return (0, _react.jsx)(_StyledButton.StyledButton, (0, _extends2.default)({
32
+ var onOpenChange = (0, _react.useCallback)(function (_ref2) {
33
+ var isOpen = _ref2.isOpen;
34
+ onDropdownChange === null || onDropdownChange === void 0 || onDropdownChange(isOpen);
35
+ }, [onDropdownChange]);
36
+ return (0, _react2.jsx)(_dropdownMenu.default, {
37
+ trigger: function trigger(_ref3) {
38
+ var triggerRef = _ref3.triggerRef,
39
+ props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
40
+ return (0, _react2.jsx)(_StyledButton.StyledButton, (0, _extends2.default)({
35
41
  innerRef: triggerRef
36
42
  }, props, {
37
- iconBefore: (0, _react.jsx)(_chevronDown.default, {
43
+ iconBefore: (0, _react2.jsx)(_chevronDown.default, {
38
44
  label: configureLinkLabel,
39
45
  size: 'small'
40
46
  })
41
47
  }));
42
48
  },
43
- testId: "".concat(testId, "-dropdown")
44
- }, (0, _react.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react.jsx)(_dropdownMenu.DropdownItem, {
45
- elemBefore: (0, _react.jsx)(_shortcut.default, {
49
+ testId: "".concat(testId, "-dropdown"),
50
+ onOpenChange: onOpenChange
51
+ }, (0, _react2.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
52
+ elemBefore: (0, _react2.jsx)(_shortcut.default, {
46
53
  label: goToLinkLabel,
47
54
  size: 'medium'
48
55
  })
49
- }, goToLinkLabel), (0, _react.jsx)(_dropdownMenu.DropdownItem, {
50
- elemBefore: (0, _react.jsx)(_preferences.default, {
56
+ }, goToLinkLabel), (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
57
+ elemBefore: (0, _react2.jsx)(_preferences.default, {
51
58
  label: configureLinkLabel,
52
59
  size: 'medium'
53
60
  })
@@ -37,7 +37,8 @@ var OverlayButton = exports.OverlayButton = function OverlayButton(_ref) {
37
37
  _ref$testId = _ref.testId,
38
38
  testId = _ref$testId === void 0 ? 'link-configure-overlay-button' : _ref$testId,
39
39
  _ref$targetElementPos = _ref.targetElementPos,
40
- targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos;
40
+ targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos,
41
+ onDropdownChange = _ref.onDropdownChange;
41
42
  var _useIntl = (0, _reactIntlNext.useIntl)(),
42
43
  formatMessage = _useIntl.formatMessage;
43
44
  var configureLinkLabel = formatMessage(_messages.cardMessages.inlineConfigureLink);
@@ -82,7 +83,8 @@ var OverlayButton = exports.OverlayButton = function OverlayButton(_ref) {
82
83
  css: buttonWrapperStyles,
83
84
  "data-testid": testId
84
85
  }, showDropdown ? (0, _react2.jsx)(_Dropdown.default, {
85
- testId: testId
86
+ testId: testId,
87
+ onDropdownChange: onDropdownChange
86
88
  }) : (0, _react2.jsx)(_tooltip.default, {
87
89
  content: configureLinkLabel,
88
90
  hideTooltipOnClick: true,
@@ -11,6 +11,7 @@ var LinkAction = exports.LinkAction = /*#__PURE__*/function (LinkAction) {
11
11
  LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
12
12
  LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
13
13
  LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
14
+ LinkAction["SET_CONFIGURE_DROPDOWN_OPEN"] = "SET_CONFIGURE_DROPDOWN_OPEN";
14
15
  return LinkAction;
15
16
  }({});
16
17
  var InsertStatus = exports.InsertStatus = /*#__PURE__*/function (InsertStatus) {
@@ -101,8 +101,8 @@ var calcLegacyWideWidth = function calcLegacyWideWidth(containerWidth, origWidth
101
101
  * Calculate maximum width allowed for media single node in fix-width editor in new experience
102
102
  * @param containerWidth width of editor container
103
103
  */
104
- var calcMediaSingleMaxWidth = exports.calcMediaSingleMaxWidth = function calcMediaSingleMaxWidth(containerWidth) {
105
- var fullWidthPadding = (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2;
104
+ var calcMediaSingleMaxWidth = exports.calcMediaSingleMaxWidth = function calcMediaSingleMaxWidth(containerWidth, editorAppearance) {
105
+ var fullWidthPadding = editorAppearance === 'full-page' ? (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 : _editorSharedStyles.akEditorGutterPadding * 2;
106
106
  return Math.min(containerWidth - fullWidthPadding, _editorSharedStyles.akEditorFullWidthLayoutWidth);
107
107
  };
108
108
 
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
9
+ dragToMove: {
10
+ id: 'fabric.editor.blockControlDragHandleUsageInfo',
11
+ defaultMessage: 'Drag to move',
12
+ description: 'Use drag handle to move content'
13
+ },
14
+ moveUp: {
15
+ id: 'fabric.editor.blockControlMoveUp',
16
+ defaultMessage: 'Move up',
17
+ description: 'Moves selected content up'
18
+ },
19
+ moveDown: {
20
+ id: 'fabric.editor.blockControlMoveDown',
21
+ defaultMessage: 'Move down',
22
+ description: 'Moves selected content down'
23
+ }
24
+ });
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "avatarGroupMessages", {
21
21
  return _avatarGroup.avatarGroupMessages;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "blockControlsMessages", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _blockControls.messages;
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "blockTypeMessages", {
25
31
  enumerable: true,
26
32
  get: function get() {
@@ -215,6 +221,7 @@ var _panel = require("./panel");
215
221
  var _mentions = require("./mentions");
216
222
  var _helpDialog = require("./help-dialog");
217
223
  var _highlight = require("./highlight");
224
+ var _blockControls = require("./block-controls");
218
225
  var _default = exports.default = (0, _reactIntlNext.defineMessages)({
219
226
  layoutFixedWidth: {
220
227
  id: 'fabric.editor.layoutFixedWidth',
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "84.3.2";
20
+ var packageVersion = "84.5.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  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); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "84.3.2";
23
+ var packageVersion = "84.5.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -96,6 +96,8 @@ export const decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mo
96
96
  export const activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
97
97
  export const toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palette', 'Mod-Alt-b');
98
98
  export const focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
99
+ export const dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Alt-Shift-ArrowUp');
100
+ export const dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Alt-Shift-ArrowDown');
99
101
  const arrowKeysMap = {
100
102
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
101
103
  ARROWLEFT: '\u2190',
@@ -144,6 +146,14 @@ export const ToolTipContent = /*#__PURE__*/React.memo(({
144
146
  css: tooltipShortcutStyle
145
147
  }, shortcut)) : null;
146
148
  });
149
+ export const TooltipContentWithMultipleShortcuts = /*#__PURE__*/React.memo(({
150
+ helpDescriptors
151
+ }) => {
152
+ const keymapCount = helpDescriptors.length;
153
+ return jsx(Fragment, null, helpDescriptors.map((descriptor, index) => jsx(Fragment, {
154
+ key: index
155
+ }, jsx(ToolTipContent, descriptor), " ", index < keymapCount - 1 && jsx("br", null))));
156
+ });
147
157
  export function findKeymapByDescription(description) {
148
158
  const matches = ALL.filter(keymap => keymap.description.toUpperCase() === description.toUpperCase());
149
159
  return matches[0];
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
+ import { useCallback } from 'react';
4
+
3
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { jsx } from '@emotion/react';
5
7
  import { useIntl } from 'react-intl-next';
@@ -10,13 +12,19 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
10
12
  import { cardMessages as messages } from '../../messages';
11
13
  import { StyledButton } from './StyledButton';
12
14
  const Dropdown = ({
13
- testId
15
+ testId,
16
+ onDropdownChange
14
17
  }) => {
15
18
  const {
16
19
  formatMessage
17
20
  } = useIntl();
18
21
  const configureLinkLabel = formatMessage(messages.inlineConfigureLink);
19
22
  const goToLinkLabel = formatMessage(messages.inlineGoToLink);
23
+ const onOpenChange = useCallback(({
24
+ isOpen
25
+ }) => {
26
+ onDropdownChange === null || onDropdownChange === void 0 ? void 0 : onDropdownChange(isOpen);
27
+ }, [onDropdownChange]);
20
28
  return jsx(DropdownMenu, {
21
29
  trigger: ({
22
30
  triggerRef,
@@ -29,7 +37,8 @@ const Dropdown = ({
29
37
  size: 'small'
30
38
  })
31
39
  })),
32
- testId: `${testId}-dropdown`
40
+ testId: `${testId}-dropdown`,
41
+ onOpenChange: onOpenChange
33
42
  }, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
34
43
  elemBefore: jsx(ShortcutIcon, {
35
44
  label: goToLinkLabel,
@@ -25,7 +25,8 @@ const showDropdownThresholdPx = 50;
25
25
  export const OverlayButton = ({
26
26
  editorView,
27
27
  testId = 'link-configure-overlay-button',
28
- targetElementPos = 0
28
+ targetElementPos = 0,
29
+ onDropdownChange
29
30
  }) => {
30
31
  var _docNode$nodeSize;
31
32
  const {
@@ -72,7 +73,8 @@ export const OverlayButton = ({
72
73
  css: buttonWrapperStyles,
73
74
  "data-testid": testId
74
75
  }, showDropdown ? jsx(Dropdown, {
75
- testId: testId
76
+ testId: testId,
77
+ onDropdownChange: onDropdownChange
76
78
  }) : jsx(Tooltip, {
77
79
  content: configureLinkLabel,
78
80
  hideTooltipOnClick: true,
@@ -5,6 +5,7 @@ export let LinkAction = /*#__PURE__*/function (LinkAction) {
5
5
  LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
6
6
  LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
7
7
  LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
8
+ LinkAction["SET_CONFIGURE_DROPDOWN_OPEN"] = "SET_CONFIGURE_DROPDOWN_OPEN";
8
9
  return LinkAction;
9
10
  }({});
10
11
  export let InsertStatus = /*#__PURE__*/function (InsertStatus) {
@@ -1,5 +1,5 @@
1
1
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
2
+ import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
3
3
  import { floatingLayouts, isRichMediaInsideOfBlockNode } from '../utils/rich-media-utils';
4
4
  import { DEFAULT_IMAGE_WIDTH, DEFAULT_ROUNDING_INTERVAL, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, wrappedLayouts } from './constants';
5
5
 
@@ -89,8 +89,8 @@ const calcLegacyWideWidth = (containerWidth, origWidth, contentWidth) => {
89
89
  * Calculate maximum width allowed for media single node in fix-width editor in new experience
90
90
  * @param containerWidth width of editor container
91
91
  */
92
- export const calcMediaSingleMaxWidth = containerWidth => {
93
- const fullWidthPadding = akEditorGutterPaddingDynamic() * 2;
92
+ export const calcMediaSingleMaxWidth = (containerWidth, editorAppearance) => {
93
+ const fullWidthPadding = editorAppearance === 'full-page' ? akEditorGutterPaddingDynamic() * 2 : akEditorGutterPadding * 2;
94
94
  return Math.min(containerWidth - fullWidthPadding, akEditorFullWidthLayoutWidth);
95
95
  };
96
96
 
@@ -0,0 +1,18 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ dragToMove: {
4
+ id: 'fabric.editor.blockControlDragHandleUsageInfo',
5
+ defaultMessage: 'Drag to move',
6
+ description: 'Use drag handle to move content'
7
+ },
8
+ moveUp: {
9
+ id: 'fabric.editor.blockControlMoveUp',
10
+ defaultMessage: 'Move up',
11
+ description: 'Moves selected content up'
12
+ },
13
+ moveDown: {
14
+ id: 'fabric.editor.blockControlMoveDown',
15
+ defaultMessage: 'Move down',
16
+ description: 'Moves selected content down'
17
+ }
18
+ });
@@ -29,6 +29,7 @@ export { panelMessages } from './panel';
29
29
  export { mentionMessages } from './mentions';
30
30
  export { helpDialogMessages } from './help-dialog';
31
31
  export { highlightMessages } from './highlight';
32
+ export { messages as blockControlsMessages } from './block-controls';
32
33
  export default defineMessages({
33
34
  layoutFixedWidth: {
34
35
  id: 'fabric.editor.layoutFixedWidth',
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "84.3.2";
4
+ const packageVersion = "84.5.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -9,7 +9,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
9
9
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "84.3.2";
12
+ const packageVersion = "84.5.0";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -97,6 +97,8 @@ export var decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-
97
97
  export var activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
98
98
  export var toggleHighlightPalette = makeKeyMapWithCommon('Toggle Highlight Palette', 'Mod-Alt-b');
99
99
  export var focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table context menu trigger', 'Shift-F10');
100
+ export var dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Alt-Shift-ArrowUp');
101
+ export var dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Alt-Shift-ArrowDown');
100
102
  var arrowKeysMap = {
101
103
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
102
104
  ARROWLEFT: "\u2190",
@@ -144,6 +146,15 @@ export var ToolTipContent = /*#__PURE__*/React.memo(function (_ref) {
144
146
  css: tooltipShortcutStyle
145
147
  }, shortcut)) : null;
146
148
  });
149
+ export var TooltipContentWithMultipleShortcuts = /*#__PURE__*/React.memo(function (_ref2) {
150
+ var helpDescriptors = _ref2.helpDescriptors;
151
+ var keymapCount = helpDescriptors.length;
152
+ return jsx(Fragment, null, helpDescriptors.map(function (descriptor, index) {
153
+ return jsx(Fragment, {
154
+ key: index
155
+ }, jsx(ToolTipContent, descriptor), " ", index < keymapCount - 1 && jsx("br", null));
156
+ }));
157
+ });
147
158
  export function findKeymapByDescription(description) {
148
159
  var matches = ALL.filter(function (keymap) {
149
160
  return keymap.description.toUpperCase() === description.toUpperCase();
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["triggerRef"];
4
4
  /** @jsx jsx */
5
+ import { useCallback } from 'react';
6
+
5
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
8
  import { jsx } from '@emotion/react';
7
9
  import { useIntl } from 'react-intl-next';
@@ -12,15 +14,20 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
12
14
  import { cardMessages as messages } from '../../messages';
13
15
  import { StyledButton } from './StyledButton';
14
16
  var Dropdown = function Dropdown(_ref) {
15
- var testId = _ref.testId;
17
+ var testId = _ref.testId,
18
+ onDropdownChange = _ref.onDropdownChange;
16
19
  var _useIntl = useIntl(),
17
20
  formatMessage = _useIntl.formatMessage;
18
21
  var configureLinkLabel = formatMessage(messages.inlineConfigureLink);
19
22
  var goToLinkLabel = formatMessage(messages.inlineGoToLink);
23
+ var onOpenChange = useCallback(function (_ref2) {
24
+ var isOpen = _ref2.isOpen;
25
+ onDropdownChange === null || onDropdownChange === void 0 || onDropdownChange(isOpen);
26
+ }, [onDropdownChange]);
20
27
  return jsx(DropdownMenu, {
21
- trigger: function trigger(_ref2) {
22
- var triggerRef = _ref2.triggerRef,
23
- props = _objectWithoutProperties(_ref2, _excluded);
28
+ trigger: function trigger(_ref3) {
29
+ var triggerRef = _ref3.triggerRef,
30
+ props = _objectWithoutProperties(_ref3, _excluded);
24
31
  return jsx(StyledButton, _extends({
25
32
  innerRef: triggerRef
26
33
  }, props, {
@@ -30,7 +37,8 @@ var Dropdown = function Dropdown(_ref) {
30
37
  })
31
38
  }));
32
39
  },
33
- testId: "".concat(testId, "-dropdown")
40
+ testId: "".concat(testId, "-dropdown"),
41
+ onOpenChange: onOpenChange
34
42
  }, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
35
43
  elemBefore: jsx(ShortcutIcon, {
36
44
  label: goToLinkLabel,
@@ -29,7 +29,8 @@ export var OverlayButton = function OverlayButton(_ref) {
29
29
  _ref$testId = _ref.testId,
30
30
  testId = _ref$testId === void 0 ? 'link-configure-overlay-button' : _ref$testId,
31
31
  _ref$targetElementPos = _ref.targetElementPos,
32
- targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos;
32
+ targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos,
33
+ onDropdownChange = _ref.onDropdownChange;
33
34
  var _useIntl = useIntl(),
34
35
  formatMessage = _useIntl.formatMessage;
35
36
  var configureLinkLabel = formatMessage(cardMessages.inlineConfigureLink);
@@ -74,7 +75,8 @@ export var OverlayButton = function OverlayButton(_ref) {
74
75
  css: buttonWrapperStyles,
75
76
  "data-testid": testId
76
77
  }, showDropdown ? jsx(Dropdown, {
77
- testId: testId
78
+ testId: testId,
79
+ onDropdownChange: onDropdownChange
78
80
  }) : jsx(Tooltip, {
79
81
  content: configureLinkLabel,
80
82
  hideTooltipOnClick: true,
@@ -5,6 +5,7 @@ export var LinkAction = /*#__PURE__*/function (LinkAction) {
5
5
  LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
6
6
  LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
7
7
  LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
8
+ LinkAction["SET_CONFIGURE_DROPDOWN_OPEN"] = "SET_CONFIGURE_DROPDOWN_OPEN";
8
9
  return LinkAction;
9
10
  }({});
10
11
  export var InsertStatus = /*#__PURE__*/function (InsertStatus) {
@@ -1,5 +1,5 @@
1
1
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
2
+ import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
3
3
  import { floatingLayouts, isRichMediaInsideOfBlockNode } from '../utils/rich-media-utils';
4
4
  import { DEFAULT_IMAGE_WIDTH, DEFAULT_ROUNDING_INTERVAL, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, wrappedLayouts } from './constants';
5
5
 
@@ -92,8 +92,8 @@ var calcLegacyWideWidth = function calcLegacyWideWidth(containerWidth, origWidth
92
92
  * Calculate maximum width allowed for media single node in fix-width editor in new experience
93
93
  * @param containerWidth width of editor container
94
94
  */
95
- export var calcMediaSingleMaxWidth = function calcMediaSingleMaxWidth(containerWidth) {
96
- var fullWidthPadding = akEditorGutterPaddingDynamic() * 2;
95
+ export var calcMediaSingleMaxWidth = function calcMediaSingleMaxWidth(containerWidth, editorAppearance) {
96
+ var fullWidthPadding = editorAppearance === 'full-page' ? akEditorGutterPaddingDynamic() * 2 : akEditorGutterPadding * 2;
97
97
  return Math.min(containerWidth - fullWidthPadding, akEditorFullWidthLayoutWidth);
98
98
  };
99
99
 
@@ -0,0 +1,18 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var messages = defineMessages({
3
+ dragToMove: {
4
+ id: 'fabric.editor.blockControlDragHandleUsageInfo',
5
+ defaultMessage: 'Drag to move',
6
+ description: 'Use drag handle to move content'
7
+ },
8
+ moveUp: {
9
+ id: 'fabric.editor.blockControlMoveUp',
10
+ defaultMessage: 'Move up',
11
+ description: 'Moves selected content up'
12
+ },
13
+ moveDown: {
14
+ id: 'fabric.editor.blockControlMoveDown',
15
+ defaultMessage: 'Move down',
16
+ description: 'Moves selected content down'
17
+ }
18
+ });
@@ -29,6 +29,7 @@ export { panelMessages } from './panel';
29
29
  export { mentionMessages } from './mentions';
30
30
  export { helpDialogMessages } from './help-dialog';
31
31
  export { highlightMessages } from './highlight';
32
+ export { messages as blockControlsMessages } from './block-controls';
32
33
  export default defineMessages({
33
34
  layoutFixedWidth: {
34
35
  id: 'fabric.editor.layoutFixedWidth',
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "84.3.2";
10
+ var packageVersion = "84.5.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
17
17
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
18
18
  import Layer from '../Layer';
19
19
  var packageName = "@atlaskit/editor-common";
20
- var packageVersion = "84.3.2";
20
+ var packageVersion = "84.5.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -288,6 +288,7 @@ export interface CollabSendableSelection {
288
288
  export type Activity = 'VIEWING' | 'EDITING';
289
289
  export type CollabActivityData = {
290
290
  activity: Activity;
291
+ sessionId: string;
291
292
  userId?: string;
292
293
  };
293
294
  export type CollabActivityJoinPayload = CollabActivityData & {
@@ -91,12 +91,20 @@ export declare const decreaseMediaSize: Keymap;
91
91
  export declare const activateVideoControls: Keymap;
92
92
  export declare const toggleHighlightPalette: Keymap;
93
93
  export declare const focusToContextMenuTrigger: Keymap;
94
+ export declare const dragToMoveUp: Keymap;
95
+ export declare const dragToMoveDown: Keymap;
94
96
  export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
95
97
  export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
96
98
  description?: string | React.ReactNode;
97
99
  keymap?: Keymap | undefined;
98
100
  shortcutOverride?: string | undefined;
99
101
  }) => jsx.JSX.Element | null>;
102
+ export declare const TooltipContentWithMultipleShortcuts: React.MemoExoticComponent<({ helpDescriptors, }: {
103
+ helpDescriptors: {
104
+ description?: string | React.ReactNode;
105
+ keymap?: Keymap;
106
+ }[];
107
+ }) => jsx.JSX.Element>;
100
108
  export declare function findKeymapByDescription(description: string): Keymap | undefined;
101
109
  export declare function findShortcutByDescription(description: string): string | undefined;
102
110
  export declare function findShortcutByKeymap(keymap: Keymap): string | undefined;
@@ -1,7 +1,8 @@
1
- /** @jsx jsx */
2
1
  import { jsx } from '@emotion/react';
2
+ export type OnDropdownChange = (isOpen: boolean) => void;
3
3
  export type DropdownProps = {
4
4
  testId: string;
5
+ onDropdownChange?: OnDropdownChange;
5
6
  };
6
- declare const Dropdown: ({ testId }: DropdownProps) => jsx.JSX.Element;
7
+ declare const Dropdown: ({ testId, onDropdownChange }: DropdownProps) => jsx.JSX.Element;
7
8
  export default Dropdown;
@@ -1,8 +1,13 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import { type OnDropdownChange } from './Dropdown';
3
4
  export interface OverlayButtonProps {
4
5
  editorView: EditorView;
5
6
  testId?: string;
6
7
  targetElementPos?: number;
8
+ /**
9
+ * Called when the dropdown is open/closed with isOpen state as true and false respectively.
10
+ */
11
+ onDropdownChange?: OnDropdownChange;
7
12
  }
8
- export declare const OverlayButton: ({ editorView, testId, targetElementPos, }: OverlayButtonProps) => jsx.JSX.Element | null;
13
+ export declare const OverlayButton: ({ editorView, testId, targetElementPos, onDropdownChange, }: OverlayButtonProps) => jsx.JSX.Element | null;
@@ -8,7 +8,8 @@ export declare enum LinkAction {
8
8
  SELECTION_CHANGE = "SELECTION_CHANGE",
9
9
  INSERT_LINK_TOOLBAR = "INSERT",
10
10
  EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR",
11
- SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS"
11
+ SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS",
12
+ SET_CONFIGURE_DROPDOWN_OPEN = "SET_CONFIGURE_DROPDOWN_OPEN"
12
13
  }
13
14
  export declare enum InsertStatus {
14
15
  EDIT_LINK_TOOLBAR = "EDIT",
@@ -41,4 +42,5 @@ export interface HyperlinkState {
41
42
  editorAppearance?: EditorAppearance;
42
43
  configureButtonTargetPos?: number;
43
44
  decorations?: DecorationSet;
45
+ configureDropdownOpen?: boolean;
44
46
  }
@@ -2,6 +2,7 @@ import type { RichMediaLayout } from '@atlaskit/adf-schema';
2
2
  import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { EditorAppearance } from '../types';
5
6
  /**
6
7
  * Convert media node width to pixel
7
8
  *
@@ -40,7 +41,7 @@ export declare const calcMediaSinglePixelWidth: ({ width, widthType, origWidth,
40
41
  * Calculate maximum width allowed for media single node in fix-width editor in new experience
41
42
  * @param containerWidth width of editor container
42
43
  */
43
- export declare const calcMediaSingleMaxWidth: (containerWidth: number) => number;
44
+ export declare const calcMediaSingleMaxWidth: (containerWidth: number, editorAppearance?: EditorAppearance) => number;
44
45
  /**
45
46
  * Calculate initial media single pixel width.
46
47
  * Make it fall between max width and min width
@@ -0,0 +1,17 @@
1
+ export declare const messages: {
2
+ dragToMove: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ moveUp: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ moveDown: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ };
@@ -28,6 +28,7 @@ export { panelMessages } from './panel';
28
28
  export { mentionMessages } from './mentions';
29
29
  export { helpDialogMessages } from './help-dialog';
30
30
  export { highlightMessages } from './highlight';
31
+ export { messages as blockControlsMessages } from './block-controls';
31
32
  declare const _default: {
32
33
  layoutFixedWidth: {
33
34
  id: string;
@@ -2,6 +2,7 @@
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
+ import type { EditorAppearance } from '../../types';
5
6
  import type { MediaSingleSize, MediaSingleWidthType } from './types';
6
7
  export interface Props {
7
8
  children: React.ReactNode;
@@ -25,6 +26,7 @@ export interface Props {
25
26
  handleMediaSingleRef?: React.RefObject<HTMLDivElement>;
26
27
  isInsideOfInlineExtension?: boolean;
27
28
  dataAttributes?: Record<string, any>;
29
+ editorAppearance?: EditorAppearance;
28
30
  }
29
31
  export type { MediaSingleWidthType, MediaSingleSize };
30
32
  export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, size, className, children: propsChildren, nodeType, fullWidthMode, lineLength: editorWidth, hasFallbackContainer, handleMediaSingleRef, isInsideOfInlineExtension, dataAttributes, }: Props): jsx.JSX.Element;
@@ -288,6 +288,7 @@ export interface CollabSendableSelection {
288
288
  export type Activity = 'VIEWING' | 'EDITING';
289
289
  export type CollabActivityData = {
290
290
  activity: Activity;
291
+ sessionId: string;
291
292
  userId?: string;
292
293
  };
293
294
  export type CollabActivityJoinPayload = CollabActivityData & {
@@ -91,12 +91,20 @@ export declare const decreaseMediaSize: Keymap;
91
91
  export declare const activateVideoControls: Keymap;
92
92
  export declare const toggleHighlightPalette: Keymap;
93
93
  export declare const focusToContextMenuTrigger: Keymap;
94
+ export declare const dragToMoveUp: Keymap;
95
+ export declare const dragToMoveDown: Keymap;
94
96
  export declare function tooltip(keymap?: Keymap, description?: string): string | undefined;
95
97
  export declare const ToolTipContent: React.MemoExoticComponent<({ description, shortcutOverride, keymap, }: {
96
98
  description?: string | React.ReactNode;
97
99
  keymap?: Keymap | undefined;
98
100
  shortcutOverride?: string | undefined;
99
101
  }) => jsx.JSX.Element | null>;
102
+ export declare const TooltipContentWithMultipleShortcuts: React.MemoExoticComponent<({ helpDescriptors, }: {
103
+ helpDescriptors: {
104
+ description?: string | React.ReactNode;
105
+ keymap?: Keymap;
106
+ }[];
107
+ }) => jsx.JSX.Element>;
100
108
  export declare function findKeymapByDescription(description: string): Keymap | undefined;
101
109
  export declare function findShortcutByDescription(description: string): string | undefined;
102
110
  export declare function findShortcutByKeymap(keymap: Keymap): string | undefined;
@@ -1,7 +1,8 @@
1
- /** @jsx jsx */
2
1
  import { jsx } from '@emotion/react';
2
+ export type OnDropdownChange = (isOpen: boolean) => void;
3
3
  export type DropdownProps = {
4
4
  testId: string;
5
+ onDropdownChange?: OnDropdownChange;
5
6
  };
6
- declare const Dropdown: ({ testId }: DropdownProps) => jsx.JSX.Element;
7
+ declare const Dropdown: ({ testId, onDropdownChange }: DropdownProps) => jsx.JSX.Element;
7
8
  export default Dropdown;
@@ -1,8 +1,13 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import { type OnDropdownChange } from './Dropdown';
3
4
  export interface OverlayButtonProps {
4
5
  editorView: EditorView;
5
6
  testId?: string;
6
7
  targetElementPos?: number;
8
+ /**
9
+ * Called when the dropdown is open/closed with isOpen state as true and false respectively.
10
+ */
11
+ onDropdownChange?: OnDropdownChange;
7
12
  }
8
- export declare const OverlayButton: ({ editorView, testId, targetElementPos, }: OverlayButtonProps) => jsx.JSX.Element | null;
13
+ export declare const OverlayButton: ({ editorView, testId, targetElementPos, onDropdownChange, }: OverlayButtonProps) => jsx.JSX.Element | null;
@@ -8,7 +8,8 @@ export declare enum LinkAction {
8
8
  SELECTION_CHANGE = "SELECTION_CHANGE",
9
9
  INSERT_LINK_TOOLBAR = "INSERT",
10
10
  EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR",
11
- SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS"
11
+ SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS",
12
+ SET_CONFIGURE_DROPDOWN_OPEN = "SET_CONFIGURE_DROPDOWN_OPEN"
12
13
  }
13
14
  export declare enum InsertStatus {
14
15
  EDIT_LINK_TOOLBAR = "EDIT",
@@ -41,4 +42,5 @@ export interface HyperlinkState {
41
42
  editorAppearance?: EditorAppearance;
42
43
  configureButtonTargetPos?: number;
43
44
  decorations?: DecorationSet;
45
+ configureDropdownOpen?: boolean;
44
46
  }
@@ -2,6 +2,7 @@ import type { RichMediaLayout } from '@atlaskit/adf-schema';
2
2
  import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { EditorAppearance } from '../types';
5
6
  /**
6
7
  * Convert media node width to pixel
7
8
  *
@@ -40,7 +41,7 @@ export declare const calcMediaSinglePixelWidth: ({ width, widthType, origWidth,
40
41
  * Calculate maximum width allowed for media single node in fix-width editor in new experience
41
42
  * @param containerWidth width of editor container
42
43
  */
43
- export declare const calcMediaSingleMaxWidth: (containerWidth: number) => number;
44
+ export declare const calcMediaSingleMaxWidth: (containerWidth: number, editorAppearance?: EditorAppearance) => number;
44
45
  /**
45
46
  * Calculate initial media single pixel width.
46
47
  * Make it fall between max width and min width
@@ -0,0 +1,17 @@
1
+ export declare const messages: {
2
+ dragToMove: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ moveUp: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ moveDown: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ };
@@ -28,6 +28,7 @@ export { panelMessages } from './panel';
28
28
  export { mentionMessages } from './mentions';
29
29
  export { helpDialogMessages } from './help-dialog';
30
30
  export { highlightMessages } from './highlight';
31
+ export { messages as blockControlsMessages } from './block-controls';
31
32
  declare const _default: {
32
33
  layoutFixedWidth: {
33
34
  id: string;
@@ -2,6 +2,7 @@
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
+ import type { EditorAppearance } from '../../types';
5
6
  import type { MediaSingleSize, MediaSingleWidthType } from './types';
6
7
  export interface Props {
7
8
  children: React.ReactNode;
@@ -25,6 +26,7 @@ export interface Props {
25
26
  handleMediaSingleRef?: React.RefObject<HTMLDivElement>;
26
27
  isInsideOfInlineExtension?: boolean;
27
28
  dataAttributes?: Record<string, any>;
29
+ editorAppearance?: EditorAppearance;
28
30
  }
29
31
  export type { MediaSingleWidthType, MediaSingleSize };
30
32
  export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, size, className, children: propsChildren, nodeType, fullWidthMode, lineLength: editorWidth, hasFallbackContainer, handleMediaSingleRef, isInsideOfInlineExtension, dataAttributes, }: Props): jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "84.3.2",
3
+ "version": "84.5.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -104,7 +104,7 @@
104
104
  "@atlaskit/analytics-next": "^9.3.0",
105
105
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
106
106
  "@atlaskit/atlassian-context": "^0.0.0",
107
- "@atlaskit/button": "^18.2.0",
107
+ "@atlaskit/button": "^18.3.0",
108
108
  "@atlaskit/code": "^15.4.0",
109
109
  "@atlaskit/codemod-utils": "^4.2.0",
110
110
  "@atlaskit/custom-steps": "^0.4.0",
@@ -112,7 +112,7 @@
112
112
  "@atlaskit/editor-json-transformer": "^8.15.0",
113
113
  "@atlaskit/editor-palette": "1.6.0",
114
114
  "@atlaskit/editor-prosemirror": "4.0.1",
115
- "@atlaskit/editor-shared-styles": "^2.12.0",
115
+ "@atlaskit/editor-shared-styles": "^2.13.0",
116
116
  "@atlaskit/editor-tables": "^2.7.0",
117
117
  "@atlaskit/emoji": "^67.6.0",
118
118
  "@atlaskit/icon": "^22.6.0",
@@ -126,11 +126,11 @@
126
126
  "@atlaskit/media-file-preview": "^0.5.0",
127
127
  "@atlaskit/media-picker": "^66.4.0",
128
128
  "@atlaskit/media-ui": "^25.10.0",
129
- "@atlaskit/media-viewer": "48.6.10",
129
+ "@atlaskit/media-viewer": "48.6.11",
130
130
  "@atlaskit/mention": "^23.2.0",
131
131
  "@atlaskit/menu": "^2.7.0",
132
132
  "@atlaskit/platform-feature-flags": "^0.3.0",
133
- "@atlaskit/primitives": "^10.1.0",
133
+ "@atlaskit/primitives": "^11.0.0",
134
134
  "@atlaskit/profilecard": "^19.15.0",
135
135
  "@atlaskit/section-message": "^6.5.0",
136
136
  "@atlaskit/smart-card": "^27.9.0",