@atlaskit/editor-common 76.27.10 → 76.29.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 (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/commands/index.js +24 -1
  3. package/dist/cjs/media-inline/constants.js +3 -1
  4. package/dist/cjs/media-inline/inline-image-wrapper.js +11 -23
  5. package/dist/cjs/media-inline/media-inline-image-card.js +5 -2
  6. package/dist/cjs/media-inline/styles.js +27 -3
  7. package/dist/cjs/monitoring/error.js +1 -1
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/es2019/commands/index.js +18 -1
  10. package/dist/es2019/media-inline/constants.js +2 -0
  11. package/dist/es2019/media-inline/inline-image-wrapper.js +16 -23
  12. package/dist/es2019/media-inline/media-inline-image-card.js +5 -2
  13. package/dist/es2019/media-inline/styles.js +32 -3
  14. package/dist/es2019/monitoring/error.js +1 -1
  15. package/dist/es2019/ui/DropList/index.js +1 -1
  16. package/dist/esm/commands/index.js +24 -1
  17. package/dist/esm/media-inline/constants.js +2 -0
  18. package/dist/esm/media-inline/inline-image-wrapper.js +13 -23
  19. package/dist/esm/media-inline/media-inline-image-card.js +5 -2
  20. package/dist/esm/media-inline/styles.js +27 -3
  21. package/dist/esm/monitoring/error.js +1 -1
  22. package/dist/esm/ui/DropList/index.js +1 -1
  23. package/dist/types/commands/index.d.ts +1 -0
  24. package/dist/types/media-inline/constants.d.ts +1 -0
  25. package/dist/types/media-inline/inline-image-wrapper.d.ts +2 -0
  26. package/dist/types/media-inline/media-inline-image-card.d.ts +4 -0
  27. package/dist/types/media-inline/styles.d.ts +5 -0
  28. package/dist/types/media-inline/types.d.ts +2 -0
  29. package/dist/types-ts4.5/commands/index.d.ts +1 -0
  30. package/dist/types-ts4.5/media-inline/constants.d.ts +1 -0
  31. package/dist/types-ts4.5/media-inline/inline-image-wrapper.d.ts +2 -0
  32. package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +4 -0
  33. package/dist/types-ts4.5/media-inline/styles.d.ts +5 -0
  34. package/dist/types-ts4.5/media-inline/types.d.ts +2 -0
  35. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 76.29.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#62560](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62560) [`5ad72b247e6a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5ad72b247e6a) - [ux] ED-20895 Added linking support for inline images
8
+
9
+ ## 76.28.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#61685](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61685) [`ac1ec9ea4cd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac1ec9ea4cd3) - [ux] Add border mark support to mediaInline in Editor/Renderer
14
+
3
15
  ## 76.27.10
4
16
 
5
17
  ### Patch Changes
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.addParagraphAtEnd = addParagraphAtEnd;
8
8
  exports.clearEditorContent = exports.changeImageAlignment = void 0;
9
9
  exports.createParagraphAtEnd = createParagraphAtEnd;
10
- exports.createToggleBlockMarkOnRange = void 0;
10
+ exports.createToggleInlineMarkOnRange = exports.createToggleBlockMarkOnRange = void 0;
11
11
  exports.findCutBefore = findCutBefore;
12
12
  Object.defineProperty(exports, "insertBlock", {
13
13
  enumerable: true,
@@ -89,6 +89,29 @@ var createToggleBlockMarkOnRange = exports.createToggleBlockMarkOnRange = functi
89
89
  return markApplied;
90
90
  };
91
91
  };
92
+ var createToggleInlineMarkOnRange = exports.createToggleInlineMarkOnRange = function createToggleInlineMarkOnRange(markType, getAttrs) {
93
+ return function (from, to, tr, state) {
94
+ var markApplied = false;
95
+ state.doc.nodesBetween(from, to, function (node, pos, parent) {
96
+ if (parent !== null && parent !== void 0 && parent.type.allowsMarkType(markType)) {
97
+ var oldMarks = node.marks.filter(function (mark) {
98
+ return mark.type === markType;
99
+ });
100
+ var _prevAttrs2 = oldMarks.length ? oldMarks[0].attrs : undefined;
101
+ var newAttrs = getAttrs(_prevAttrs2, node);
102
+ if (newAttrs !== undefined) {
103
+ tr.setNodeMarkup(pos, node.type, node.attrs, node.marks.filter(function (mark) {
104
+ return !markType.excludes(mark.type);
105
+ }).concat(newAttrs === false ? [] : markType.create(newAttrs)));
106
+ tr.setSelection(_state.NodeSelection.create(tr.doc, state.selection.from));
107
+ markApplied = true;
108
+ }
109
+ }
110
+ return;
111
+ });
112
+ return markApplied;
113
+ };
114
+ };
92
115
 
93
116
  /**
94
117
  * Toggles block mark based on the return type of `getAttrs`.
@@ -3,11 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.referenceHeights = exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_HEIGHT = void 0;
6
+ exports.referenceHeights = exports.DEFAULT_INLINE_IMAGE_BORDER_SIZE = exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_HEIGHT = void 0;
7
7
  var _typography = require("@atlaskit/theme/typography");
8
8
  var DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_WIDTH = 250;
9
9
  var DEFAULT_IMAGE_HEIGHT = exports.DEFAULT_IMAGE_HEIGHT = 200;
10
10
  var DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
11
+ var DEFAULT_INLINE_IMAGE_BORDER_SIZE = exports.DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
12
+
11
13
  /**
12
14
  * Reference Heights
13
15
  *
@@ -7,37 +7,25 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.InlineImageWrapper = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
- var _colors = require("@atlaskit/theme/colors");
11
- var _constants = require("./constants");
10
+ var _editorPalette = require("@atlaskit/editor-palette");
12
11
  var _styles = require("./styles");
13
- /** @jsx jsx */
14
-
15
- var wrapperStyle = (0, _react.css)({
16
- display: 'inline-flex',
17
- justifyContent: 'center',
18
- alignItems: 'center',
19
- verticalAlign: 'middle',
20
- overflow: 'hidden',
21
- borderRadius: "var(--ds-border-radius, 3px)",
22
- aspectRatio: "var(".concat(_styles.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(_constants.DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
23
- });
24
- var selectedStyle = (0, _react.css)({
25
- cursor: 'pointer',
26
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(_colors.B300, ")")),
27
- outline: 'none',
28
- borderColor: 'transparent'
29
- });
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
30
14
  var InlineImageWrapper = exports.InlineImageWrapper = function InlineImageWrapper(_ref) {
15
+ var _ref2;
31
16
  var children = _ref.children,
32
17
  isSelected = _ref.isSelected,
33
- aspectRatio = _ref.aspectRatio;
34
- var style = aspectRatio ? (0, _defineProperty2.default)({}, _styles.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, aspectRatio) : {};
18
+ aspectRatio = _ref.aspectRatio,
19
+ borderSize = _ref.borderSize,
20
+ borderColor = _ref.borderColor;
21
+ var borderStyleVars = borderSize && borderColor ? (_ref2 = {}, (0, _defineProperty2.default)(_ref2, _styles.INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, borderSize), (0, _defineProperty2.default)(_ref2, _styles.INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, (0, _editorPalette.hexToEditorBorderPaletteColor)(borderColor) || borderColor), _ref2) : {};
22
+ var aspectStyleVars = aspectRatio ? (0, _defineProperty2.default)({}, _styles.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, aspectRatio) : {};
35
23
  return (
36
24
  // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
37
25
  (0, _react.jsx)("span", {
38
- style: style,
26
+ style: _objectSpread(_objectSpread({}, borderStyleVars), aspectStyleVars),
39
27
  className: _styles.INLINE_IMAGE_WRAPPER_CLASS_NAME,
40
- css: [wrapperStyle, isSelected && selectedStyle],
28
+ css: [_styles.wrapperStyle, borderSize && borderColor && _styles.borderStyle, isSelected && _styles.selectedStyle],
41
29
  "data-testid": "inline-image-wrapper"
42
30
  }, children)
43
31
  );
@@ -25,7 +25,8 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
25
25
  alt = _ref.alt,
26
26
  isLazy = _ref.isLazy,
27
27
  width = _ref.width,
28
- height = _ref.height;
28
+ height = _ref.height,
29
+ border = _ref.border;
29
30
  var _useState = (0, _react.useState)(),
30
31
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
31
32
  fileState = _useState2[0],
@@ -115,7 +116,9 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
115
116
  }, [width, height, aspectRatio]);
116
117
  return (0, _react2.jsx)(_inlineImageWrapper.InlineImageWrapper, {
117
118
  isSelected: isSelected,
118
- aspectRatio: aspectRatio
119
+ aspectRatio: aspectRatio,
120
+ borderColor: border === null || border === void 0 ? void 0 : border.borderColor,
121
+ borderSize: border === null || border === void 0 ? void 0 : border.borderSize
119
122
  }, content(scaledDimension));
120
123
  };
121
124
  var MediaInlineImageCard = exports.MediaInlineImageCard = (0, _reactIntlNext.injectIntl)(MediaInlineImageCardInternal, {
@@ -4,16 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.mediaInlineImageStyles = exports.INLINE_IMAGE_WRAPPER_CLASS_NAME = exports.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = void 0;
7
+ exports.wrapperStyle = exports.selectedStyle = exports.mediaInlineImageStyles = exports.borderStyle = exports.INLINE_IMAGE_WRAPPER_CLASS_NAME = exports.INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = exports.INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = exports.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
+ var _colors = require("@atlaskit/theme/colors");
10
11
  var _constants = require("./constants");
11
12
  var _templateObject, _templateObject2;
12
13
  var INLINE_IMAGE_WRAPPER_CLASS_NAME = exports.INLINE_IMAGE_WRAPPER_CLASS_NAME = 'media-inline-image-wrapper';
13
14
  var INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = exports.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = '--editor-media-inline-image-aspect-ratio';
15
+ var INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = exports.INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = '--editor-media-inline-image-border-size';
16
+ var INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = exports.INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-image-border-color';
14
17
  var inlineImageHeight = function inlineImageHeight(height) {
15
18
  var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
16
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n > .", ",\n > .mediaInlineView-content-wrap\n > .", " {\n height: ", "px;\n transform: translateY(", "px);\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, height, margin);
19
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n > span[data-mark-type='border']\n > .mediaInlineView-content-wrap\n > .", ",\n > span[data-mark-type='border']\n > .", ",\n > .", ",\n > .mediaInlineView-content-wrap\n > .", " {\n height: ", "px;\n transform: translateY(", "px);\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, height, margin);
17
20
  };
18
21
 
19
22
  /**
@@ -22,4 +25,25 @@ var inlineImageHeight = function inlineImageHeight(height) {
22
25
  * shift in top and bottom and size adjustments to make up for lack of 1to1 size
23
26
  * mapping
24
27
  */
25
- var mediaInlineImageStyles = exports.mediaInlineImageStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n // p, h3, and action items\n .", " {\n height: ", "px;\n transform: translateY(-2px);\n }\n\n h1 {\n ", "\n }\n\n h2 {\n ", "\n }\n\n h3 {\n ", "\n }\n\n h4 {\n ", "\n }\n\n h5 {\n ", "\n }\n\n h6 {\n ", "\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, _constants.referenceHeights['p'], inlineImageHeight(_constants.referenceHeights['h1'], -3), inlineImageHeight(_constants.referenceHeights['h2'], -3), inlineImageHeight(_constants.referenceHeights['h3'], -2), inlineImageHeight(_constants.referenceHeights['h4'], -2), inlineImageHeight(_constants.referenceHeights['h5'], -2), inlineImageHeight(_constants.referenceHeights['h6'], -2));
28
+ var mediaInlineImageStyles = exports.mediaInlineImageStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n // p, h3, and action items\n .", " {\n height: ", "px;\n transform: translateY(-2px);\n }\n\n h1 {\n ", "\n }\n\n h2 {\n ", "\n }\n\n h3 {\n ", "\n }\n\n h4 {\n ", "\n }\n\n h5 {\n ", "\n }\n\n h6 {\n ", "\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, _constants.referenceHeights['p'], inlineImageHeight(_constants.referenceHeights['h1'], -3), inlineImageHeight(_constants.referenceHeights['h2'], -3), inlineImageHeight(_constants.referenceHeights['h3'], -2), inlineImageHeight(_constants.referenceHeights['h4'], -2), inlineImageHeight(_constants.referenceHeights['h5'], -2), inlineImageHeight(_constants.referenceHeights['h6'], -2));
29
+ var wrapperStyle = exports.wrapperStyle = (0, _react.css)({
30
+ display: 'inline-flex',
31
+ justifyContent: 'center',
32
+ alignItems: 'center',
33
+ verticalAlign: 'middle',
34
+ overflow: 'hidden',
35
+ borderRadius: "var(--ds-border-radius, 3px)",
36
+ aspectRatio: "var(".concat(INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(_constants.DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
37
+ });
38
+ var selectedStyle = exports.selectedStyle = (0, _react.css)({
39
+ cursor: 'pointer',
40
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(_colors.B300, ")")),
41
+ outline: 'none'
42
+ });
43
+ var borderStyle = exports.borderStyle = (0, _react.css)({
44
+ borderColor: "var(".concat(INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, ")"),
45
+ borderStyle: 'solid',
46
+ borderRadius: "calc(var(".concat(INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, ", ").concat(_constants.DEFAULT_INLINE_IMAGE_BORDER_SIZE, ") * 2px)"),
47
+ borderWidth: "calc(var(".concat(INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, ", ").concat(_constants.DEFAULT_INLINE_IMAGE_BORDER_SIZE, ") * 1px)"),
48
+ boxSizing: "border-box"
49
+ });
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "76.27.10";
19
+ var packageVersion = "76.29.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
22
22
  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); }; }
23
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "76.27.10";
25
+ var packageVersion = "76.29.0";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,4 +1,4 @@
1
- import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
1
+ import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
3
3
  export function addParagraphAtEnd(tr) {
4
4
  const {
@@ -72,6 +72,23 @@ export const createToggleBlockMarkOnRange = (markType, getAttrs, allowedBlocks)
72
72
  });
73
73
  return markApplied;
74
74
  };
75
+ export const createToggleInlineMarkOnRange = (markType, getAttrs) => (from, to, tr, state) => {
76
+ let markApplied = false;
77
+ state.doc.nodesBetween(from, to, (node, pos, parent) => {
78
+ if (parent !== null && parent !== void 0 && parent.type.allowsMarkType(markType)) {
79
+ const oldMarks = node.marks.filter(mark => mark.type === markType);
80
+ const prevAttrs = oldMarks.length ? oldMarks[0].attrs : undefined;
81
+ const newAttrs = getAttrs(prevAttrs, node);
82
+ if (newAttrs !== undefined) {
83
+ tr.setNodeMarkup(pos, node.type, node.attrs, node.marks.filter(mark => !markType.excludes(mark.type)).concat(newAttrs === false ? [] : markType.create(newAttrs)));
84
+ tr.setSelection(NodeSelection.create(tr.doc, state.selection.from));
85
+ markApplied = true;
86
+ }
87
+ }
88
+ return;
89
+ });
90
+ return markApplied;
91
+ };
75
92
 
76
93
  /**
77
94
  * Toggles block mark based on the return type of `getAttrs`.
@@ -2,6 +2,8 @@ import { headingSizes } from '@atlaskit/theme/typography';
2
2
  export const DEFAULT_IMAGE_WIDTH = 250;
3
3
  export const DEFAULT_IMAGE_HEIGHT = 200;
4
4
  export const DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
5
+ export const DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
6
+
5
7
  /**
6
8
  * Reference Heights
7
9
  *
@@ -1,38 +1,31 @@
1
1
  /** @jsx jsx */
2
2
 
3
- import { css, jsx } from '@emotion/react';
4
- import { B300 } from '@atlaskit/theme/colors';
5
- const wrapperStyle = css({
6
- display: 'inline-flex',
7
- justifyContent: 'center',
8
- alignItems: 'center',
9
- verticalAlign: 'middle',
10
- overflow: 'hidden',
11
- borderRadius: `${"var(--ds-border-radius, 3px)"}`,
12
- aspectRatio: `var(${INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY}, ${DEFAULT_INLINE_IMAGE_ASPECT_RATIO})`
13
- });
14
- import { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
15
- import { INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
16
- const selectedStyle = css({
17
- cursor: 'pointer',
18
- boxShadow: `0 0 0 1px ${`var(--ds-border-selected, ${B300})`}`,
19
- outline: 'none',
20
- borderColor: 'transparent'
21
- });
3
+ import { jsx } from '@emotion/react';
4
+ import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
5
+ import { borderStyle, INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, INLINE_IMAGE_WRAPPER_CLASS_NAME, selectedStyle, wrapperStyle } from './styles';
22
6
  export const InlineImageWrapper = ({
23
7
  children,
24
8
  isSelected,
25
- aspectRatio
9
+ aspectRatio,
10
+ borderSize,
11
+ borderColor
26
12
  }) => {
27
- const style = aspectRatio ? {
13
+ const borderStyleVars = borderSize && borderColor ? {
14
+ [INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY]: borderSize,
15
+ [INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY]: hexToEditorBorderPaletteColor(borderColor) || borderColor
16
+ } : {};
17
+ const aspectStyleVars = aspectRatio ? {
28
18
  [INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY]: aspectRatio
29
19
  } : {};
30
20
  return (
31
21
  // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
32
22
  jsx("span", {
33
- style: style,
23
+ style: {
24
+ ...borderStyleVars,
25
+ ...aspectStyleVars
26
+ },
34
27
  className: INLINE_IMAGE_WRAPPER_CLASS_NAME,
35
- css: [wrapperStyle, isSelected && selectedStyle],
28
+ css: [wrapperStyle, borderSize && borderColor && borderStyle, isSelected && selectedStyle],
36
29
  "data-testid": "inline-image-wrapper"
37
30
  }, children)
38
31
  );
@@ -17,7 +17,8 @@ export const MediaInlineImageCardInternal = ({
17
17
  alt,
18
18
  isLazy,
19
19
  width,
20
- height
20
+ height,
21
+ border
21
22
  }) => {
22
23
  const [fileState, setFileState] = useState();
23
24
  const [subscribeError, setSubscribeError] = useState();
@@ -101,7 +102,9 @@ export const MediaInlineImageCardInternal = ({
101
102
  }, [width, height, aspectRatio]);
102
103
  return jsx(InlineImageWrapper, {
103
104
  isSelected: isSelected,
104
- aspectRatio: aspectRatio
105
+ aspectRatio: aspectRatio,
106
+ borderColor: border === null || border === void 0 ? void 0 : border.borderColor,
107
+ borderSize: border === null || border === void 0 ? void 0 : border.borderSize
105
108
  }, content(scaledDimension));
106
109
  };
107
110
  export const MediaInlineImageCard = injectIntl(MediaInlineImageCardInternal, {
@@ -1,9 +1,17 @@
1
1
  import { css } from '@emotion/react';
2
- import { referenceHeights } from './constants';
2
+ import { B300 } from '@atlaskit/theme/colors';
3
+ import { DEFAULT_INLINE_IMAGE_ASPECT_RATIO, DEFAULT_INLINE_IMAGE_BORDER_SIZE, referenceHeights } from './constants';
3
4
  export const INLINE_IMAGE_WRAPPER_CLASS_NAME = 'media-inline-image-wrapper';
4
5
  export const INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = '--editor-media-inline-image-aspect-ratio';
6
+ export const INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = '--editor-media-inline-image-border-size';
7
+ export const INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-image-border-color';
5
8
  const inlineImageHeight = (height, margin = 0) => css`
6
- > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
9
+ > span[data-mark-type='border']
10
+ > .mediaInlineView-content-wrap
11
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
12
+ > span[data-mark-type='border']
13
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
14
+ > .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
7
15
  > .mediaInlineView-content-wrap
8
16
  > .${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
9
17
  height: ${height}px;
@@ -47,4 +55,25 @@ export const mediaInlineImageStyles = css`
47
55
  h6 {
48
56
  ${inlineImageHeight(referenceHeights['h6'], -2)}
49
57
  }
50
- `;
58
+ `;
59
+ export const wrapperStyle = css({
60
+ display: 'inline-flex',
61
+ justifyContent: 'center',
62
+ alignItems: 'center',
63
+ verticalAlign: 'middle',
64
+ overflow: 'hidden',
65
+ borderRadius: `${"var(--ds-border-radius, 3px)"}`,
66
+ aspectRatio: `var(${INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY}, ${DEFAULT_INLINE_IMAGE_ASPECT_RATIO})`
67
+ });
68
+ export const selectedStyle = css({
69
+ cursor: 'pointer',
70
+ boxShadow: `0 0 0 1px ${`var(--ds-border-selected, ${B300})`}`,
71
+ outline: 'none'
72
+ });
73
+ export const borderStyle = css({
74
+ borderColor: `var(${INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY})`,
75
+ borderStyle: 'solid',
76
+ borderRadius: `calc(var(${INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY}, ${DEFAULT_INLINE_IMAGE_BORDER_SIZE}) * 2px)`,
77
+ borderWidth: `calc(var(${INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY}, ${DEFAULT_INLINE_IMAGE_BORDER_SIZE}) * 1px)`,
78
+ boxSizing: `border-box`
79
+ });
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "76.27.10";
3
+ const packageVersion = "76.29.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "76.27.10";
10
+ const packageVersion = "76.29.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
4
+ import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
6
6
  export function addParagraphAtEnd(tr) {
7
7
  var paragraph = tr.doc.type.schema.nodes.paragraph,
@@ -69,6 +69,29 @@ export var createToggleBlockMarkOnRange = function createToggleBlockMarkOnRange(
69
69
  return markApplied;
70
70
  };
71
71
  };
72
+ export var createToggleInlineMarkOnRange = function createToggleInlineMarkOnRange(markType, getAttrs) {
73
+ return function (from, to, tr, state) {
74
+ var markApplied = false;
75
+ state.doc.nodesBetween(from, to, function (node, pos, parent) {
76
+ if (parent !== null && parent !== void 0 && parent.type.allowsMarkType(markType)) {
77
+ var oldMarks = node.marks.filter(function (mark) {
78
+ return mark.type === markType;
79
+ });
80
+ var _prevAttrs2 = oldMarks.length ? oldMarks[0].attrs : undefined;
81
+ var newAttrs = getAttrs(_prevAttrs2, node);
82
+ if (newAttrs !== undefined) {
83
+ tr.setNodeMarkup(pos, node.type, node.attrs, node.marks.filter(function (mark) {
84
+ return !markType.excludes(mark.type);
85
+ }).concat(newAttrs === false ? [] : markType.create(newAttrs)));
86
+ tr.setSelection(NodeSelection.create(tr.doc, state.selection.from));
87
+ markApplied = true;
88
+ }
89
+ }
90
+ return;
91
+ });
92
+ return markApplied;
93
+ };
94
+ };
72
95
 
73
96
  /**
74
97
  * Toggles block mark based on the return type of `getAttrs`.
@@ -2,6 +2,8 @@ import { headingSizes } from '@atlaskit/theme/typography';
2
2
  export var DEFAULT_IMAGE_WIDTH = 250;
3
3
  export var DEFAULT_IMAGE_HEIGHT = 200;
4
4
  export var DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
5
+ export var DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
6
+
5
7
  /**
6
8
  * Reference Heights
7
9
  *
@@ -1,36 +1,26 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2
4
  /** @jsx jsx */
3
5
 
4
- import { css, jsx } from '@emotion/react';
5
- import { B300 } from '@atlaskit/theme/colors';
6
- var wrapperStyle = css({
7
- display: 'inline-flex',
8
- justifyContent: 'center',
9
- alignItems: 'center',
10
- verticalAlign: 'middle',
11
- overflow: 'hidden',
12
- borderRadius: "var(--ds-border-radius, 3px)",
13
- aspectRatio: "var(".concat(INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
14
- });
15
- import { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
16
- import { INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
17
- var selectedStyle = css({
18
- cursor: 'pointer',
19
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")")),
20
- outline: 'none',
21
- borderColor: 'transparent'
22
- });
6
+ import { jsx } from '@emotion/react';
7
+ import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
8
+ import { borderStyle, INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, INLINE_IMAGE_WRAPPER_CLASS_NAME, selectedStyle, wrapperStyle } from './styles';
23
9
  export var InlineImageWrapper = function InlineImageWrapper(_ref) {
10
+ var _ref2;
24
11
  var children = _ref.children,
25
12
  isSelected = _ref.isSelected,
26
- aspectRatio = _ref.aspectRatio;
27
- var style = aspectRatio ? _defineProperty({}, INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, aspectRatio) : {};
13
+ aspectRatio = _ref.aspectRatio,
14
+ borderSize = _ref.borderSize,
15
+ borderColor = _ref.borderColor;
16
+ var borderStyleVars = borderSize && borderColor ? (_ref2 = {}, _defineProperty(_ref2, INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, borderSize), _defineProperty(_ref2, INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, hexToEditorBorderPaletteColor(borderColor) || borderColor), _ref2) : {};
17
+ var aspectStyleVars = aspectRatio ? _defineProperty({}, INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, aspectRatio) : {};
28
18
  return (
29
19
  // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
30
20
  jsx("span", {
31
- style: style,
21
+ style: _objectSpread(_objectSpread({}, borderStyleVars), aspectStyleVars),
32
22
  className: INLINE_IMAGE_WRAPPER_CLASS_NAME,
33
- css: [wrapperStyle, isSelected && selectedStyle],
23
+ css: [wrapperStyle, borderSize && borderColor && borderStyle, isSelected && selectedStyle],
34
24
  "data-testid": "inline-image-wrapper"
35
25
  }, children)
36
26
  );
@@ -18,7 +18,8 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
18
18
  alt = _ref.alt,
19
19
  isLazy = _ref.isLazy,
20
20
  width = _ref.width,
21
- height = _ref.height;
21
+ height = _ref.height,
22
+ border = _ref.border;
22
23
  var _useState = useState(),
23
24
  _useState2 = _slicedToArray(_useState, 2),
24
25
  fileState = _useState2[0],
@@ -108,7 +109,9 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
108
109
  }, [width, height, aspectRatio]);
109
110
  return jsx(InlineImageWrapper, {
110
111
  isSelected: isSelected,
111
- aspectRatio: aspectRatio
112
+ aspectRatio: aspectRatio,
113
+ borderColor: border === null || border === void 0 ? void 0 : border.borderColor,
114
+ borderSize: border === null || border === void 0 ? void 0 : border.borderSize
112
115
  }, content(scaledDimension));
113
116
  };
114
117
  export var MediaInlineImageCard = injectIntl(MediaInlineImageCardInternal, {
@@ -1,12 +1,15 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2;
3
3
  import { css } from '@emotion/react';
4
- import { referenceHeights } from './constants';
4
+ import { B300 } from '@atlaskit/theme/colors';
5
+ import { DEFAULT_INLINE_IMAGE_ASPECT_RATIO, DEFAULT_INLINE_IMAGE_BORDER_SIZE, referenceHeights } from './constants';
5
6
  export var INLINE_IMAGE_WRAPPER_CLASS_NAME = 'media-inline-image-wrapper';
6
7
  export var INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = '--editor-media-inline-image-aspect-ratio';
8
+ export var INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = '--editor-media-inline-image-border-size';
9
+ export var INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-image-border-color';
7
10
  var inlineImageHeight = function inlineImageHeight(height) {
8
11
  var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
9
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > .", ",\n > .mediaInlineView-content-wrap\n > .", " {\n height: ", "px;\n transform: translateY(", "px);\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, height, margin);
12
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > span[data-mark-type='border']\n > .mediaInlineView-content-wrap\n > .", ",\n > span[data-mark-type='border']\n > .", ",\n > .", ",\n > .mediaInlineView-content-wrap\n > .", " {\n height: ", "px;\n transform: translateY(", "px);\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, height, margin);
10
13
  };
11
14
 
12
15
  /**
@@ -15,4 +18,25 @@ var inlineImageHeight = function inlineImageHeight(height) {
15
18
  * shift in top and bottom and size adjustments to make up for lack of 1to1 size
16
19
  * mapping
17
20
  */
18
- export var mediaInlineImageStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n // p, h3, and action items\n .", " {\n height: ", "px;\n transform: translateY(-2px);\n }\n\n h1 {\n ", "\n }\n\n h2 {\n ", "\n }\n\n h3 {\n ", "\n }\n\n h4 {\n ", "\n }\n\n h5 {\n ", "\n }\n\n h6 {\n ", "\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, referenceHeights['p'], inlineImageHeight(referenceHeights['h1'], -3), inlineImageHeight(referenceHeights['h2'], -3), inlineImageHeight(referenceHeights['h3'], -2), inlineImageHeight(referenceHeights['h4'], -2), inlineImageHeight(referenceHeights['h5'], -2), inlineImageHeight(referenceHeights['h6'], -2));
21
+ export var mediaInlineImageStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n // p, h3, and action items\n .", " {\n height: ", "px;\n transform: translateY(-2px);\n }\n\n h1 {\n ", "\n }\n\n h2 {\n ", "\n }\n\n h3 {\n ", "\n }\n\n h4 {\n ", "\n }\n\n h5 {\n ", "\n }\n\n h6 {\n ", "\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, referenceHeights['p'], inlineImageHeight(referenceHeights['h1'], -3), inlineImageHeight(referenceHeights['h2'], -3), inlineImageHeight(referenceHeights['h3'], -2), inlineImageHeight(referenceHeights['h4'], -2), inlineImageHeight(referenceHeights['h5'], -2), inlineImageHeight(referenceHeights['h6'], -2));
22
+ export var wrapperStyle = css({
23
+ display: 'inline-flex',
24
+ justifyContent: 'center',
25
+ alignItems: 'center',
26
+ verticalAlign: 'middle',
27
+ overflow: 'hidden',
28
+ borderRadius: "var(--ds-border-radius, 3px)",
29
+ aspectRatio: "var(".concat(INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
30
+ });
31
+ export var selectedStyle = css({
32
+ cursor: 'pointer',
33
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")")),
34
+ outline: 'none'
35
+ });
36
+ export var borderStyle = css({
37
+ borderColor: "var(".concat(INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, ")"),
38
+ borderStyle: 'solid',
39
+ borderRadius: "calc(var(".concat(INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_BORDER_SIZE, ") * 2px)"),
40
+ borderWidth: "calc(var(".concat(INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_BORDER_SIZE, ") * 1px)"),
41
+ boxSizing: "border-box"
42
+ });
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "76.27.10";
9
+ var packageVersion = "76.29.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // 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 = "76.27.10";
20
+ var packageVersion = "76.29.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -7,6 +7,7 @@ export declare function addParagraphAtEnd(tr: Transaction): void;
7
7
  export declare function createParagraphAtEnd(): Command;
8
8
  export declare const changeImageAlignment: (align?: AlignmentState) => Command;
9
9
  export declare const createToggleBlockMarkOnRange: <T extends {} = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode) => false | T | undefined, allowedBlocks?: NodeType[] | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean) | undefined) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
10
+ export declare const createToggleInlineMarkOnRange: <T extends {} = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode) => false | T | undefined) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
10
11
  /**
11
12
  * Toggles block mark based on the return type of `getAttrs`.
12
13
  * This is similar to ProseMirror's `getAttrs` from `AttributeSpec`
@@ -1,6 +1,7 @@
1
1
  export declare const DEFAULT_IMAGE_WIDTH = 250;
2
2
  export declare const DEFAULT_IMAGE_HEIGHT = 200;
3
3
  export declare const DEFAULT_INLINE_IMAGE_ASPECT_RATIO: number;
4
+ export declare const DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
4
5
  /**
5
6
  * Reference Heights
6
7
  *
@@ -4,6 +4,8 @@ type Props = {
4
4
  children: ReactElement;
5
5
  isSelected?: boolean;
6
6
  aspectRatio?: number | string;
7
+ borderSize?: number;
8
+ borderColor?: string;
7
9
  };
8
10
  export declare const InlineImageWrapper: FC<Props>;
9
11
  export {};
@@ -8,6 +8,10 @@ export interface MediaInlineImageCardProps {
8
8
  mediaClient: MediaClient;
9
9
  isSelected?: boolean;
10
10
  isLazy?: boolean;
11
+ border?: {
12
+ borderSize?: number;
13
+ borderColor?: string;
14
+ };
11
15
  }
12
16
  export declare const MediaInlineImageCardInternal: FC<MediaInlineImageCardProps & WrappedComponentProps & MediaInlineAttrs>;
13
17
  export declare const MediaInlineImageCard: FC<MediaInlineImageCardProps & MediaInlineAttrs>;
@@ -1,5 +1,7 @@
1
1
  export declare const INLINE_IMAGE_WRAPPER_CLASS_NAME = "media-inline-image-wrapper";
2
2
  export declare const INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = "--editor-media-inline-image-aspect-ratio";
3
+ export declare const INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = "--editor-media-inline-image-border-size";
4
+ export declare const INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = "--editor-media-inline-image-border-color";
3
5
  /**
4
6
  * Shifting the mediaInline image component (renders image) to align nicely with
5
7
  * mediaInline (renders text) is a bit of a testing ground. This numbers represent
@@ -7,3 +9,6 @@ export declare const INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = "--editor-media-inl
7
9
  * mapping
8
10
  */
9
11
  export declare const mediaInlineImageStyles: import("@emotion/react").SerializedStyles;
12
+ export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
13
+ export declare const selectedStyle: import("@emotion/react").SerializedStyles;
14
+ export declare const borderStyle: import("@emotion/react").SerializedStyles;
@@ -3,4 +3,6 @@ export type MediaInlineAttrs = {
3
3
  alt?: string;
4
4
  width?: number;
5
5
  height?: number;
6
+ borderSize?: number;
7
+ borderColor?: string;
6
8
  };
@@ -7,6 +7,7 @@ export declare function addParagraphAtEnd(tr: Transaction): void;
7
7
  export declare function createParagraphAtEnd(): Command;
8
8
  export declare const changeImageAlignment: (align?: AlignmentState) => Command;
9
9
  export declare const createToggleBlockMarkOnRange: <T extends {} = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode) => false | T | undefined, allowedBlocks?: NodeType[] | ((schema: Schema, node: PMNode, parent: PMNode | null) => boolean) | undefined) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
10
+ export declare const createToggleInlineMarkOnRange: <T extends {} = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode) => false | T | undefined) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
10
11
  /**
11
12
  * Toggles block mark based on the return type of `getAttrs`.
12
13
  * This is similar to ProseMirror's `getAttrs` from `AttributeSpec`
@@ -1,6 +1,7 @@
1
1
  export declare const DEFAULT_IMAGE_WIDTH = 250;
2
2
  export declare const DEFAULT_IMAGE_HEIGHT = 200;
3
3
  export declare const DEFAULT_INLINE_IMAGE_ASPECT_RATIO: number;
4
+ export declare const DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
4
5
  /**
5
6
  * Reference Heights
6
7
  *
@@ -4,6 +4,8 @@ type Props = {
4
4
  children: ReactElement;
5
5
  isSelected?: boolean;
6
6
  aspectRatio?: number | string;
7
+ borderSize?: number;
8
+ borderColor?: string;
7
9
  };
8
10
  export declare const InlineImageWrapper: FC<Props>;
9
11
  export {};
@@ -8,6 +8,10 @@ export interface MediaInlineImageCardProps {
8
8
  mediaClient: MediaClient;
9
9
  isSelected?: boolean;
10
10
  isLazy?: boolean;
11
+ border?: {
12
+ borderSize?: number;
13
+ borderColor?: string;
14
+ };
11
15
  }
12
16
  export declare const MediaInlineImageCardInternal: FC<MediaInlineImageCardProps & WrappedComponentProps & MediaInlineAttrs>;
13
17
  export declare const MediaInlineImageCard: FC<MediaInlineImageCardProps & MediaInlineAttrs>;
@@ -1,5 +1,7 @@
1
1
  export declare const INLINE_IMAGE_WRAPPER_CLASS_NAME = "media-inline-image-wrapper";
2
2
  export declare const INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = "--editor-media-inline-image-aspect-ratio";
3
+ export declare const INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = "--editor-media-inline-image-border-size";
4
+ export declare const INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = "--editor-media-inline-image-border-color";
3
5
  /**
4
6
  * Shifting the mediaInline image component (renders image) to align nicely with
5
7
  * mediaInline (renders text) is a bit of a testing ground. This numbers represent
@@ -7,3 +9,6 @@ export declare const INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = "--editor-media-inl
7
9
  * mapping
8
10
  */
9
11
  export declare const mediaInlineImageStyles: import("@emotion/react").SerializedStyles;
12
+ export declare const wrapperStyle: import("@emotion/react").SerializedStyles;
13
+ export declare const selectedStyle: import("@emotion/react").SerializedStyles;
14
+ export declare const borderStyle: import("@emotion/react").SerializedStyles;
@@ -3,4 +3,6 @@ export type MediaInlineAttrs = {
3
3
  alt?: string;
4
4
  width?: number;
5
5
  height?: number;
6
+ borderSize?: number;
7
+ borderColor?: string;
6
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "76.27.10",
3
+ "version": "76.29.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/"
@@ -26,7 +26,8 @@
26
26
  "team": "Editor",
27
27
  "inPublicMirror": true,
28
28
  "singleton": true,
29
- "releaseModel": "continuous"
29
+ "releaseModel": "continuous",
30
+ "runReact18": false
30
31
  },
31
32
  "af:exports": {
32
33
  "./event-dispatcher": "./src/event-dispatcher/index.ts",