@atlaskit/editor-common 87.10.2 → 87.12.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 (69) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/lazy-node-view/node-view.js +13 -1
  3. package/dist/cjs/media/index.js +8 -1
  4. package/dist/cjs/media/messages/externalMedia.js +14 -0
  5. package/dist/cjs/media-single/CommentBadge.js +5 -4
  6. package/dist/cjs/media-single/ExternalImageBadge.js +78 -0
  7. package/dist/cjs/media-single/index.js +8 -1
  8. package/dist/cjs/messages/media-insert.js +10 -0
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/node-width/index.js +1 -1
  11. package/dist/cjs/styles/index.js +6 -0
  12. package/dist/cjs/styles/shared/blockquote.js +39 -1
  13. package/dist/cjs/styles/shared/code-block.js +2 -2
  14. package/dist/cjs/styles/shared/panel.js +2 -1
  15. package/dist/cjs/ui/DropList/index.js +1 -1
  16. package/dist/cjs/ui/MediaSingle/styled.js +1 -1
  17. package/dist/es2019/lazy-node-view/node-view.js +13 -1
  18. package/dist/es2019/media/index.js +2 -1
  19. package/dist/es2019/media/messages/externalMedia.js +8 -0
  20. package/dist/es2019/media-single/CommentBadge.js +6 -5
  21. package/dist/es2019/media-single/ExternalImageBadge.js +64 -0
  22. package/dist/es2019/media-single/index.js +2 -1
  23. package/dist/es2019/messages/media-insert.js +10 -0
  24. package/dist/es2019/monitoring/error.js +1 -1
  25. package/dist/es2019/node-width/index.js +1 -1
  26. package/dist/es2019/styles/index.js +1 -1
  27. package/dist/es2019/styles/shared/blockquote.js +38 -0
  28. package/dist/es2019/styles/shared/code-block.js +6 -3
  29. package/dist/es2019/styles/shared/panel.js +2 -1
  30. package/dist/es2019/ui/DropList/index.js +1 -1
  31. package/dist/es2019/ui/MediaSingle/styled.js +1 -1
  32. package/dist/esm/lazy-node-view/node-view.js +13 -1
  33. package/dist/esm/media/index.js +2 -1
  34. package/dist/esm/media/messages/externalMedia.js +8 -0
  35. package/dist/esm/media-single/CommentBadge.js +5 -4
  36. package/dist/esm/media-single/ExternalImageBadge.js +68 -0
  37. package/dist/esm/media-single/index.js +2 -1
  38. package/dist/esm/messages/media-insert.js +10 -0
  39. package/dist/esm/monitoring/error.js +1 -1
  40. package/dist/esm/node-width/index.js +1 -1
  41. package/dist/esm/styles/index.js +1 -1
  42. package/dist/esm/styles/shared/blockquote.js +38 -0
  43. package/dist/esm/styles/shared/code-block.js +2 -2
  44. package/dist/esm/styles/shared/panel.js +2 -1
  45. package/dist/esm/ui/DropList/index.js +1 -1
  46. package/dist/esm/ui/MediaSingle/styled.js +1 -1
  47. package/dist/types/lazy-node-view/index.d.ts +2 -2
  48. package/dist/types/lazy-node-view/types.d.ts +3 -0
  49. package/dist/types/media/index.d.ts +1 -0
  50. package/dist/types/media/messages/externalMedia.d.ts +7 -0
  51. package/dist/types/media-single/CommentBadge.d.ts +2 -2
  52. package/dist/types/media-single/ExternalImageBadge.d.ts +9 -0
  53. package/dist/types/media-single/index.d.ts +1 -0
  54. package/dist/types/messages/media-insert.d.ts +10 -0
  55. package/dist/types/node-width/index.d.ts +1 -1
  56. package/dist/types/styles/index.d.ts +1 -1
  57. package/dist/types/styles/shared/blockquote.d.ts +1 -0
  58. package/dist/types-ts4.5/lazy-node-view/index.d.ts +2 -2
  59. package/dist/types-ts4.5/lazy-node-view/types.d.ts +3 -0
  60. package/dist/types-ts4.5/media/index.d.ts +1 -0
  61. package/dist/types-ts4.5/media/messages/externalMedia.d.ts +7 -0
  62. package/dist/types-ts4.5/media-single/CommentBadge.d.ts +2 -2
  63. package/dist/types-ts4.5/media-single/ExternalImageBadge.d.ts +9 -0
  64. package/dist/types-ts4.5/media-single/index.d.ts +1 -0
  65. package/dist/types-ts4.5/messages/media-insert.d.ts +10 -0
  66. package/dist/types-ts4.5/node-width/index.d.ts +1 -1
  67. package/dist/types-ts4.5/styles/index.d.ts +1 -1
  68. package/dist/types-ts4.5/styles/shared/blockquote.d.ts +1 -0
  69. package/package.json +10 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 87.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#129457](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129457)
8
+ [`171c73d4033f0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/171c73d4033f0) -
9
+ [ux] [ED-24566]
10
+
11
+ - Internationalisation strings in editor-common for editor-plugin-media-insert
12
+ - Removed default pre-filled URL for editor-plugin-media-insert popup
13
+ - Added background color for editor-plugin-media-insert popup
14
+
15
+ - [#130065](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130065)
16
+ [`e71a357ea40dd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e71a357ea40dd) -
17
+ [ux] [ED-24323] Add external image badge for externally hosted images
18
+
19
+ ## 87.11.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#130260](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130260)
24
+ [`d338ce6e4ff6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d338ce6e4ff6e) -
25
+ [ux] Add padding to blockquote and panel nodes to allow space for element controls
26
+
27
+ ### Patch Changes
28
+
29
+ - [#129804](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129804)
30
+ [`790a6fe6bc9e8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/790a6fe6bc9e8) -
31
+ [ED-24516] Fix VR test helpers for fallback LazyNodeViews
32
+ - Updated dependencies
33
+
3
34
  ## 87.10.2
4
35
 
5
36
  ### Patch Changes
@@ -7,7 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.LazyNodeView = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _memoize = _interopRequireDefault(require("lodash/memoize"));
10
11
  var _model = require("@atlaskit/editor-prosemirror/model");
12
+ var getEditorLineWidth = (0, _memoize.default)(function (view) {
13
+ var _view$dom;
14
+ return (_view$dom = view.dom) === null || _view$dom === void 0 ? void 0 : _view$dom.clientWidth;
15
+ });
16
+
11
17
  /**
12
18
  * 🧱 Internal: Editor FE Platform
13
19
  *
@@ -22,7 +28,13 @@ var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/function () {
22
28
  this.dom = document.createElement('div');
23
29
  return;
24
30
  }
25
- var fallback = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node));
31
+ var toDOMConfiguration = {
32
+ editorLineWidth: getEditorLineWidth(view)
33
+ };
34
+ var fallback = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node,
35
+ // We are injecting a second parameter to be used by the toDOM lazy node view implementations
36
+ // @ts-expect-error
37
+ toDOMConfiguration));
26
38
  this.dom = fallback.dom;
27
39
  this.contentDOM = fallback.contentDOM;
28
40
  if (this.dom instanceof HTMLElement) {
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "dropPlaceholderMessages", {
27
27
  return _dropPlaceholder.dropPlaceholderMessages;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "externalMediaMessages", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _externalMedia.externalMediaMessages;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "imageBorderMessages", {
31
37
  enumerable: true,
32
38
  get: function get() {
@@ -72,4 +78,5 @@ var _caption = require("./messages/caption");
72
78
  var _dropPlaceholder = require("./messages/dropPlaceholder");
73
79
  var _altText = require("./messages/altText");
74
80
  var _mediaResizeAnnouncerMess = require("./messages/mediaResizeAnnouncerMess");
75
- var _comments = require("./messages/comments");
81
+ var _comments = require("./messages/comments");
82
+ var _externalMedia = require("./messages/externalMedia");
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.externalMediaMessages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var externalMediaMessages = exports.externalMediaMessages = (0, _reactIntlNext.defineMessages)({
9
+ externalMediaFile: {
10
+ id: 'fabric.editor.externalMediaFile',
11
+ defaultMessage: 'External media file',
12
+ description: 'External media file'
13
+ }
14
+ });
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.CommentBadge = void 0;
7
+ exports.getBadgeSize = exports.CommentBadge = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _react = require("react");
10
10
  var _react2 = require("@emotion/react");
@@ -38,11 +38,11 @@ var commentBadgeEditorOverrides = function commentBadgeEditorOverrides(commentsO
38
38
  zIndex: _constants.layers.card()
39
39
  });
40
40
  };
41
- var getBadgeSize = function getBadgeSize(width, height) {
41
+ var getBadgeSize = exports.getBadgeSize = function getBadgeSize(width, height) {
42
42
  // width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
43
43
  return width && width < 70 || height && height < 70 ? 'small' : 'medium';
44
44
  };
45
- var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
45
+ var CommentBadge = exports.CommentBadge = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
46
46
  var intl = _ref.intl,
47
47
  width = _ref.width,
48
48
  height = _ref.height,
@@ -87,6 +87,7 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
87
87
  }
88
88
  }, [status]);
89
89
  return (0, _react2.jsx)("div", {
90
+ ref: ref,
90
91
  css: badgeOffsetRight ? [commentBadgeWrapper,
91
92
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
92
93
  commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight)] : commentBadgeWrapper
@@ -119,4 +120,4 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
119
120
  size: badgeSize
120
121
  })
121
122
  })));
122
- };
123
+ });
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ExternalImageBadge = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _debounce = _interopRequireDefault(require("lodash/debounce"));
12
+ var _reactIntlNext = require("react-intl-next");
13
+ var _info = _interopRequireDefault(require("@atlaskit/icon/glyph/info"));
14
+ var _primitives = require("@atlaskit/primitives");
15
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
16
+ var _media = require("../media");
17
+ var _CommentBadge = require("./CommentBadge");
18
+ 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); }
19
+ 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; }
20
+ var baseStyles = (0, _primitives.xcss)({
21
+ position: 'absolute',
22
+ top: 'space.025',
23
+ borderRadius: 'border.radius',
24
+ backgroundColor: 'elevation.surface',
25
+ zIndex: 'tooltip',
26
+ lineHeight: "var(--ds-space-200, 16px)",
27
+ right: 'var(--right-offset)',
28
+ cursor: 'pointer'
29
+ });
30
+ var ExternalImageBadge = exports.ExternalImageBadge = function ExternalImageBadge(_ref) {
31
+ var mediaWidth = _ref.mediaWidth,
32
+ mediaHeight = _ref.mediaHeight,
33
+ _ref$commentBadgeRigh = _ref.commentBadgeRightOffset,
34
+ commentBadgeRightOffset = _ref$commentBadgeRigh === void 0 ? 0 : _ref$commentBadgeRigh,
35
+ mediaElement = _ref.mediaElement;
36
+ var intl = (0, _reactIntlNext.useIntl)();
37
+ var message = intl.formatMessage(_media.externalMediaMessages.externalMediaFile);
38
+ var _useState = (0, _react.useState)((0, _CommentBadge.getBadgeSize)(mediaWidth, mediaHeight)),
39
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
40
+ badgeSize = _useState2[0],
41
+ setBadgeSize = _useState2[1];
42
+ // detect resize of media element to adjust badge size
43
+ // will combine with the comment badge resize observer when refactoring in the future to avoid multiple resize observers
44
+ (0, _react.useEffect)(function () {
45
+ var observer = new ResizeObserver((0, _debounce.default)(function (entries) {
46
+ var _entries = (0, _slicedToArray2.default)(entries, 1),
47
+ entry = _entries[0];
48
+ var _entry$contentRect = entry.contentRect,
49
+ width = _entry$contentRect.width,
50
+ height = _entry$contentRect.height;
51
+ setBadgeSize((0, _CommentBadge.getBadgeSize)(width, height));
52
+ }));
53
+ if (mediaElement) {
54
+ observer.observe(mediaElement);
55
+ }
56
+ return function () {
57
+ observer.disconnect();
58
+ };
59
+ }, [mediaElement]);
60
+ var baseRightOffset = badgeSize === 'medium' ? 4 : 2;
61
+ var rightOffset = baseRightOffset + commentBadgeRightOffset;
62
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box
63
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
64
+ , {
65
+ style: {
66
+ '--right-offset': "".concat(rightOffset, "px")
67
+ },
68
+ padding: badgeSize === 'medium' ? 'space.050' : 'space.0',
69
+ "data-external-image-badge": "true",
70
+ xcss: baseStyles,
71
+ tabIndex: 0
72
+ }, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
73
+ content: message
74
+ }, /*#__PURE__*/_react.default.createElement(_info.default, {
75
+ size: "small",
76
+ label: message
77
+ })));
78
+ };
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "DEFAULT_IMAGE_WIDTH", {
27
27
  return _constants.DEFAULT_IMAGE_WIDTH;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "ExternalImageBadge", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _ExternalImageBadge.ExternalImageBadge;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH", {
31
37
  enumerable: true,
32
38
  get: function get() {
@@ -137,4 +143,5 @@ Object.defineProperty(exports, "wrappedLayouts", {
137
143
  });
138
144
  var _constants = require("./constants");
139
145
  var _utils = require("./utils");
140
- var _CommentBadge = require("./CommentBadge");
146
+ var _CommentBadge = require("./CommentBadge");
147
+ var _ExternalImageBadge = require("./ExternalImageBadge");
@@ -40,5 +40,15 @@ var mediaInsertMessages = exports.mediaInsertMessages = (0, _reactIntlNext.defin
40
40
  id: 'fabric.editor.media.insert.mediaAlt',
41
41
  defaultMessage: 'Preview for uploaded image or video file',
42
42
  description: 'Alt text describing a preview of an image uploaded.'
43
+ },
44
+ linkTabTitle: {
45
+ id: 'fabric.editor.media.insert.linkTabTitle',
46
+ defaultMessage: 'Link',
47
+ description: 'Title of the navigation tab that allows users to insert media from a URL or link'
48
+ },
49
+ mediaPickerPopupAriaLabel: {
50
+ id: 'fabric.editor.media.insert.mediaPickerPopupAriaLabel',
51
+ defaultMessage: 'Media picker',
52
+ description: 'Accessibility label for the media picker popup'
43
53
  }
44
54
  });
@@ -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 = "87.10.2";
20
+ var packageVersion = "87.12.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
@@ -105,7 +105,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
105
105
  var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
106
106
  return isFullWidthModeEnabled ? Math.min(containerWidth.lineLength, _editorSharedStyles.akEditorFullWidthLayoutWidth) : (0, _breakout.absoluteBreakoutWidth)(layout, containerWidth.width);
107
107
  };
108
- var getTableContainerWidth = exports.getTableContainerWidth = function getTableContainerWidth(node, isCommentEditor) {
108
+ var getTableContainerWidth = exports.getTableContainerWidth = function getTableContainerWidth(node) {
109
109
  if (node !== null && node !== void 0 && node.attrs.width) {
110
110
  return node.attrs.width;
111
111
  }
@@ -153,6 +153,12 @@ Object.defineProperty(exports, "blockquoteSharedStyles", {
153
153
  return _blockquote.blockquoteSharedStyles;
154
154
  }
155
155
  });
156
+ Object.defineProperty(exports, "blockquoteSharedStylesNew", {
157
+ enumerable: true,
158
+ get: function get() {
159
+ return _blockquote.blockquoteSharedStylesNew;
160
+ }
161
+ });
156
162
  Object.defineProperty(exports, "buttonGroupStyle", {
157
163
  enumerable: true,
158
164
  get: function get() {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.blockquoteSharedStyles = void 0;
6
+ exports.blockquoteSharedStylesNew = exports.blockquoteSharedStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -44,4 +44,42 @@ var blockquoteSharedStyles = exports.blockquoteSharedStyles = (0, _react.css)({
44
44
  display: 'inline-table'
45
45
  }
46
46
  }
47
+ });
48
+
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
50
+ var blockquoteSharedStylesNew = exports.blockquoteSharedStylesNew = (0, _react.css)({
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
52
+ '& blockquote': {
53
+ boxSizing: 'border-box',
54
+ color: 'inherit',
55
+ paddingLeft: "var(--ds-space-250, 20px)",
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
57
+ borderLeft: "2px solid ".concat("var(--ds-border, ".concat(_editorSharedStyles.akEditorBlockquoteBorderColor, ")")),
58
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
59
+ margin: "".concat(_editorSharedStyles.blockNodesVerticalMargin, " 0 0 0"),
60
+ marginRight: 0,
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
62
+ "[dir='rtl'] &": {
63
+ paddingLeft: 0,
64
+ paddingRight: "var(--ds-space-200, 16px)"
65
+ },
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
67
+ '&:first-child': {
68
+ marginTop: 0
69
+ },
70
+ '&::before': {
71
+ content: "''"
72
+ },
73
+ '&::after': {
74
+ content: 'none'
75
+ },
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
77
+ '& p': {
78
+ display: 'block'
79
+ },
80
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
81
+ '& table, & table:last-child': {
82
+ display: 'inline-table'
83
+ }
84
+ }
47
85
  });
@@ -29,9 +29,9 @@ var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
29
29
  CODEBLOCK_LINE_NUMBER_GUTTER_FG: 'line-number-gutter--fg'
30
30
  };
31
31
  var codeBlockSharedStyles = exports.codeBlockSharedStyles = function codeBlockSharedStyles() {
32
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", "\n\t\t> .", "\n\t\t> .", " {\n\t\tmargin-right: ", ";\n\n\t\tcode {\n\t\t\tdisplay: block;\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\t}\n\n\t.", "\n\t\t> .", " {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\n\t\tcode {\n\t\t\tflex-grow: 1;\n\n\t\t\twhite-space: pre;\n\t\t}\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\n\t\t--ds--code--bg-color: transparent;\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\t// relative position set so number gutter remains absolute on horizontal scroll.\n\t\t\tposition: relative;\n\t\t}\n\n\t\t.", " {\n\t\t\tflex-shrink: 0;\n\t\t\ttext-align: right;\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tline-height: 0;\n\t\t\t\tfont-size: 0;\n\n\t\t\t\t::before {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tcontent: counter(line);\n\t\t\t\t\tcounter-increment: line;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t\tline-height: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: 2rem;\n\t\t\tflex-shrink: 0;\n\t\t}\n\n\t\t.", " {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\n\t\t\tcode {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\twhite-space: pre;\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tpointer-events: none;\n\t\t\tuser-select: none;\n\t\t\twidth: 2rem;\n\t\t\tleft: 0;\n\t\t\tposition: absolute;\n\t\t\tfont-size: ", ";\n\t\t\tline-height: 1.5rem;\n\t\t\ttext-align: center;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER_FG, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG, "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER_FG, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
32
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", "\n\t\t> .", "\n\t\t> .", " {\n\t\tmargin-right: ", ";\n\n\t\tcode {\n\t\t\tdisplay: block;\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\t}\n\n\t.", "\n\t\t> .", " {\n\t\tdisplay: flex;\n\t\tflex: 1;\n\n\t\tcode {\n\t\t\tflex-grow: 1;\n\n\t\t\twhite-space: pre;\n\t\t}\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\n\t\t--ds--code--bg-color: transparent;\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\t// relative position set so number gutter remains absolute on horizontal scroll.\n\t\t\tposition: relative;\n\t\t}\n\n\t\t.", " {\n\t\t\tflex-shrink: 0;\n\t\t\ttext-align: right;\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tline-height: 0;\n\t\t\t\tfont-size: 0;\n\n\t\t\t\t::before {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tcontent: counter(line);\n\t\t\t\t\tcounter-increment: line;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t\tline-height: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tpadding: 0px ", ";\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: ", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\n\t\t\tcode {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\twhite-space: pre;\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tpointer-events: none;\n\t\t\tuser-select: none;\n\t\t\twidth: var(--lineNumberGutterWidth, 2rem);\n\t\t\tleft: 0;\n\t\t\tposition: absolute;\n\t\t\tfont-size: ", ";\n\t\t\tpadding: 0px ", ";\n\t\t\tline-height: 1.5rem;\n\t\t\ttext-align: right;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER_FG, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG, "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER_FG, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
33
33
  leftCoverWidth: "var(--ds-space-300, 24px)"
34
- }), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER_FG, CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER_FG, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-text-subtlest, #505F79)");
34
+ }), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER_FG, CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER_FG, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_FG, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, #505F79)");
35
35
  };
36
36
 
37
37
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -16,6 +16,7 @@ var _editorPalette = require("@atlaskit/editor-palette");
16
16
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
  var _consts = require("@atlaskit/editor-shared-styles/consts");
18
18
  var _emoji = require("@atlaskit/emoji");
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
20
  var _colors = require("@atlaskit/theme/colors");
20
21
  var _templateObject;
21
22
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
@@ -171,7 +172,7 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
171
172
 
172
173
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Safe to autofix with a tiny tweak to `mainDynamicStyles` being an object, but holding off…
173
174
  var panelSharedStylesWithoutPrefix = exports.panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix() {
174
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tborder-radius: ", ";\n\tmargin: ", " 0 0;\n\tpadding-top: ", ";\n\tpadding-right: ", ";\n\tpadding-bottom: ", ";\n\tpadding-left: ", ";\n\tmin-width: ", "px;\n\tdisplay: flex;\n\tposition: relative;\n\talign-items: normal;\n\tword-break: break-word;\n\n\t", "\n\n\t.", " {\n\t\tflex-shrink: 0;\n\t\theight: ", ";\n\t\twidth: ", ";\n\t\tbox-sizing: content-box;\n\t\tpadding-right: ", ";\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t\t-moz-user-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t\tmargin-top: 0.1em;\n\t\t", "\n\n\t\t> span {\n\t\t\tvertical-align: middle;\n\t\t\tdisplay: inline-flex;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\n\t\t\t// Vertical align only works for inline-block elements in Firefox\n\t\t\t@-moz-document url-prefix() {\n\t\t\t\timg {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.ak-editor-panel__content {\n\t\tmargin: ", " 0 ", ";\n\t\tflex: 1 0 0;\n\t\t/*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n\t\tmin-width: 0;\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n"])), "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS));
175
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tborder-radius: ", ";\n\tmargin: ", " 0 0;\n\tpadding-top: ", ";\n\tpadding-right: ", ";\n\tpadding-bottom: ", ";\n\tpadding-left: ", ";\n\tmin-width: ", "px;\n\tdisplay: flex;\n\tposition: relative;\n\talign-items: normal;\n\tword-break: break-word;\n\n\t", "\n\n\t.", " {\n\t\tflex-shrink: 0;\n\t\theight: ", ";\n\t\twidth: ", ";\n\t\tbox-sizing: content-box;\n\t\tpadding-right: ", ";\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t\t-moz-user-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t\tmargin-top: 0.1em;\n\t\t", "\n\n\t\t> span {\n\t\t\tvertical-align: middle;\n\t\t\tdisplay: inline-flex;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\t\t}\n\n\t\t.", " {\n\t\t\tvertical-align: ", "px;\n\n\t\t\t// Vertical align only works for inline-block elements in Firefox\n\t\t\t@-moz-document url-prefix() {\n\t\t\t\timg {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.ak-editor-panel__content {\n\t\tmargin: ", " 0 ", ";\n\t\tflex: 1 0 0;\n\t\t/*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n\t\tmin-width: 0;\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&[data-panel-type='", "'] {\n\t\t", "\n\n\t\t.", " {\n\t\t\t", "\n\t\t}\n\t}\n"])), "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, "var(--ds-space-100, 8px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", (0, _platformFeatureFlags.fg)('platform_editor_element_padding_changes_gate') ? "var(--ds-space-150, 12px)" : "var(--ds-space-100, 8px)", iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS));
175
176
  };
176
177
  var panelSharedStyles = exports.panelSharedStyles = function panelSharedStyles() {
177
178
  return (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(PanelSharedCssClassName.prefix), panelSharedStylesWithoutPrefix()));
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "87.10.2";
26
+ var packageVersion = "87.12.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  var DropList = /*#__PURE__*/function (_Component) {
@@ -184,7 +184,7 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
184
184
 
185
185
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
186
186
  var mediaWrapperStyle = exports.mediaWrapperStyle = function mediaWrapperStyle(props) {
187
- return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t// Comments on media project adds comment badge as child of the media wrapper,\n\t// thus we need to exclude it so that style is applied to intended div\n\t& > div:not([data-comment-badge='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\n\t\t> div {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t}\n\t}\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
187
+ return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t// Comments on media project adds comment badge as child of the media wrapper,\n\t// thus we need to exclude it so that style is applied to intended div\n\t& > div:not([data-comment-badge='true'], [data-external-image-badge='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\n\t\t> div {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t}\n\t}\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
188
188
  };
189
189
  var MediaWrapper = exports.MediaWrapper = function MediaWrapper(_ref3) {
190
190
  var children = _ref3.children,
@@ -1,4 +1,10 @@
1
+ import memoize from 'lodash/memoize';
1
2
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
3
+ const getEditorLineWidth = memoize(view => {
4
+ var _view$dom;
5
+ return (_view$dom = view.dom) === null || _view$dom === void 0 ? void 0 : _view$dom.clientWidth;
6
+ });
7
+
2
8
  /**
3
9
  * 🧱 Internal: Editor FE Platform
4
10
  *
@@ -12,7 +18,13 @@ export class LazyNodeView {
12
18
  this.dom = document.createElement('div');
13
19
  return;
14
20
  }
15
- const fallback = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node));
21
+ const toDOMConfiguration = {
22
+ editorLineWidth: getEditorLineWidth(view)
23
+ };
24
+ const fallback = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node,
25
+ // We are injecting a second parameter to be used by the toDOM lazy node view implementations
26
+ // @ts-expect-error
27
+ toDOMConfiguration));
16
28
  this.dom = fallback.dom;
17
29
  this.contentDOM = fallback.contentDOM;
18
30
  if (this.dom instanceof HTMLElement) {
@@ -7,4 +7,5 @@ export { captionMessages } from './messages/caption';
7
7
  export { dropPlaceholderMessages } from './messages/dropPlaceholder';
8
8
  export { altTextMessages } from './messages/altText';
9
9
  export { mediaResizeAnnouncerMessMessages } from './messages/mediaResizeAnnouncerMess';
10
- export { commentMessages } from './messages/comments';
10
+ export { commentMessages } from './messages/comments';
11
+ export { externalMediaMessages } from './messages/externalMedia';
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const externalMediaMessages = defineMessages({
3
+ externalMediaFile: {
4
+ id: 'fabric.editor.externalMediaFile',
5
+ defaultMessage: 'External media file',
6
+ description: 'External media file'
7
+ }
8
+ });
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { useEffect, useMemo, useState } from 'react';
5
+ import { forwardRef, useEffect, useMemo, useState } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
@@ -27,11 +27,11 @@ const commentBadgeEditorOverrides = (commentsOnMediaBugFixEnabled, badgeOffsetRi
27
27
  right: commentsOnMediaBugFixEnabled ? badgeOffsetRight : '14px',
28
28
  zIndex: layers.card()
29
29
  });
30
- const getBadgeSize = (width, height) => {
30
+ export const getBadgeSize = (width, height) => {
31
31
  // width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
32
32
  return width && width < 70 || height && height < 70 ? 'small' : 'medium';
33
33
  };
34
- export const CommentBadge = ({
34
+ export const CommentBadge = /*#__PURE__*/forwardRef(({
35
35
  intl,
36
36
  width,
37
37
  height,
@@ -42,7 +42,7 @@ export const CommentBadge = ({
42
42
  onMouseLeave,
43
43
  badgeOffsetRight,
44
44
  commentsOnMediaBugFixEnabled
45
- }) => {
45
+ }, ref) => {
46
46
  const [badgeSize, setBadgeSize] = useState(getBadgeSize(width, height));
47
47
  const title = intl.formatMessage(messages.viewCommentsOnMedia);
48
48
  useEffect(() => {
@@ -73,6 +73,7 @@ export const CommentBadge = ({
73
73
  }
74
74
  }, [status]);
75
75
  return jsx("div", {
76
+ ref: ref,
76
77
  css: badgeOffsetRight ? [commentBadgeWrapper,
77
78
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
78
79
  commentBadgeEditorOverrides(commentsOnMediaBugFixEnabled, badgeOffsetRight)] : commentBadgeWrapper
@@ -105,4 +106,4 @@ export const CommentBadge = ({
105
106
  size: badgeSize
106
107
  })
107
108
  })));
108
- };
109
+ });
@@ -0,0 +1,64 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import debounce from 'lodash/debounce';
3
+ import { useIntl } from 'react-intl-next';
4
+ import InfoIcon from '@atlaskit/icon/glyph/info';
5
+ import { Box, xcss } from '@atlaskit/primitives';
6
+ import Tooltip from '@atlaskit/tooltip';
7
+ import { externalMediaMessages } from '../media';
8
+ import { getBadgeSize } from './CommentBadge';
9
+ const baseStyles = xcss({
10
+ position: 'absolute',
11
+ top: 'space.025',
12
+ borderRadius: 'border.radius',
13
+ backgroundColor: 'elevation.surface',
14
+ zIndex: 'tooltip',
15
+ lineHeight: "var(--ds-space-200, 16px)",
16
+ right: 'var(--right-offset)',
17
+ cursor: 'pointer'
18
+ });
19
+ export const ExternalImageBadge = ({
20
+ mediaWidth,
21
+ mediaHeight,
22
+ commentBadgeRightOffset = 0,
23
+ mediaElement
24
+ }) => {
25
+ const intl = useIntl();
26
+ const message = intl.formatMessage(externalMediaMessages.externalMediaFile);
27
+ const [badgeSize, setBadgeSize] = useState(getBadgeSize(mediaWidth, mediaHeight));
28
+ // detect resize of media element to adjust badge size
29
+ // will combine with the comment badge resize observer when refactoring in the future to avoid multiple resize observers
30
+ useEffect(() => {
31
+ const observer = new ResizeObserver(debounce(entries => {
32
+ const [entry] = entries;
33
+ const {
34
+ width,
35
+ height
36
+ } = entry.contentRect;
37
+ setBadgeSize(getBadgeSize(width, height));
38
+ }));
39
+ if (mediaElement) {
40
+ observer.observe(mediaElement);
41
+ }
42
+ return () => {
43
+ observer.disconnect();
44
+ };
45
+ }, [mediaElement]);
46
+ const baseRightOffset = badgeSize === 'medium' ? 4 : 2;
47
+ const rightOffset = baseRightOffset + commentBadgeRightOffset;
48
+ return /*#__PURE__*/React.createElement(Box
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
50
+ , {
51
+ style: {
52
+ '--right-offset': `${rightOffset}px`
53
+ },
54
+ padding: badgeSize === 'medium' ? 'space.050' : 'space.0',
55
+ "data-external-image-badge": "true",
56
+ xcss: baseStyles,
57
+ tabIndex: 0
58
+ }, /*#__PURE__*/React.createElement(Tooltip, {
59
+ content: message
60
+ }, /*#__PURE__*/React.createElement(InfoIcon, {
61
+ size: "small",
62
+ label: message
63
+ })));
64
+ };
@@ -1,3 +1,4 @@
1
1
  export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, CAPTION_PLACEHOLDER_ID } from './constants';
2
2
  export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext, currentMediaNodeWithPos } from './utils';
3
- export { CommentBadge } from './CommentBadge';
3
+ export { CommentBadge } from './CommentBadge';
4
+ export { ExternalImageBadge } from './ExternalImageBadge';
@@ -34,5 +34,15 @@ export const mediaInsertMessages = defineMessages({
34
34
  id: 'fabric.editor.media.insert.mediaAlt',
35
35
  defaultMessage: 'Preview for uploaded image or video file',
36
36
  description: 'Alt text describing a preview of an image uploaded.'
37
+ },
38
+ linkTabTitle: {
39
+ id: 'fabric.editor.media.insert.linkTabTitle',
40
+ defaultMessage: 'Link',
41
+ description: 'Title of the navigation tab that allows users to insert media from a URL or link'
42
+ },
43
+ mediaPickerPopupAriaLabel: {
44
+ id: 'fabric.editor.media.insert.mediaPickerPopupAriaLabel',
45
+ defaultMessage: 'Media picker',
46
+ description: 'Accessibility label for the media picker popup'
37
47
  }
38
48
  });
@@ -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 = "87.10.2";
4
+ const packageVersion = "87.12.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