@atlaskit/editor-common 78.14.3 → 78.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#78436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78436) [`89ff7202e5fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/89ff7202e5fe) - The annotation comment provider will now accept a new hoverComponent which is displayed by the annotation ui when specific block nodes are rolled over by the users mouse
8
+
9
+ ## 78.14.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#81768](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81768) [`9d96e603865d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d96e603865d) - [ux] Fixes issue where inline macros don't turn red on trash hover and updates VR tests to check
14
+ - Updated dependencies
15
+
3
16
  ## 78.14.3
4
17
 
5
18
  ### Patch Changes
@@ -25,10 +25,6 @@ var wrapperDefault = exports.wrapperDefault = (0, _react.css)({
25
25
  borderRadius: "var(--ds-border-radius, 3px)",
26
26
  position: 'relative',
27
27
  verticalAlign: 'middle',
28
- '.ProseMirror-selectednode > span > & > .extension-overlay': {
29
- boxShadow: "inset 0px 0px 0px 2px ".concat("var(--ds-border-selected, ".concat(_colors.B200, ")")),
30
- opacity: 1
31
- },
32
28
  '&.with-overlay': {
33
29
  '.extension-overlay': {
34
30
  background: "var(--ds-background-neutral-hovered, ".concat(_colors.N20A, ")"),
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  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; }
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 = "78.14.3";
19
+ var packageVersion = "78.15.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
@@ -255,6 +255,12 @@ Object.defineProperty(exports, "listsSharedStyles", {
255
255
  return _lists.listsSharedStyles;
256
256
  }
257
257
  });
258
+ Object.defineProperty(exports, "mediaAnnotationStyles", {
259
+ enumerable: true,
260
+ get: function get() {
261
+ return _annotation.mediaAnnotationStyles;
262
+ }
263
+ });
258
264
  Object.defineProperty(exports, "mediaSingleSharedStyle", {
259
265
  enumerable: true,
260
266
  get: function get() {
@@ -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.blockAnnotationPrefix = exports.annotationSharedStyles = exports.annotationPrefix = exports.BlockAnnotationSharedClassNames = exports.AnnotationSharedClassNames = exports.AnnotationSharedCSSByState = void 0;
7
+ exports.mediaAnnotationStyles = exports.blockAnnotationPrefix = exports.annotationSharedStyles = exports.annotationPrefix = exports.BlockAnnotationSharedClassNames = exports.AnnotationSharedClassNames = exports.AnnotationSharedCSSByState = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -74,4 +74,8 @@ var AnnotationSharedCSSByState = exports.AnnotationSharedCSSByState = function A
74
74
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState()` is not safe in object syntax
75
75
  var annotationSharedStyles = exports.annotationSharedStyles = function annotationSharedStyles() {
76
76
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .", " {\n ", ";\n }\n\n .", " {\n ", ";\n cursor: initial;\n }\n\n .", " {\n ", ";\n }\n\n // Styling for comments on media node\n .", "[class*=ak-editor-block-annotation-] {\n border-radius: 3px;\n }\n\n .", ".", " {\n box-shadow: ", ";\n }\n\n .", ".", " {\n box-shadow: ", ";\n }\n\n .", ".", " {\n box-shadow: ", ";\n }\n }\n"])), AnnotationSharedClassNames.focus, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.draft, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.blur, AnnotationSharedCSSByState().blur, mediaNodeDomRef, mediaNodeDomRef, BlockAnnotationSharedClassNames.draft, (0, _styles.commentStatusStyleMap)('draft'), mediaNodeDomRef, BlockAnnotationSharedClassNames.focus, (0, _styles.commentStatusStyleMap)('focus'), mediaNodeDomRef, BlockAnnotationSharedClassNames.blur, (0, _styles.commentStatusStyleMap)('blur'));
77
- };
77
+ };
78
+ var mediaAnnotationStyles = exports.mediaAnnotationStyles = (0, _react.css)({
79
+ boxShadow: "5px 5px ".concat("var(--ds-background-accent-yellow-subtler, ".concat(Y75a, ")")),
80
+ borderRadius: '3px'
81
+ });
@@ -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() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "78.14.3";
25
+ var packageVersion = "78.15.0";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = MediaSingle;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _react = _interopRequireDefault(require("react"));
10
11
  var _react2 = require("@emotion/react");
@@ -36,7 +37,8 @@ function MediaSingle(_ref) {
36
37
  hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
37
38
  handleMediaSingleRef = _ref.handleMediaSingleRef,
38
39
  _ref$isInsideOfInline = _ref.isInsideOfInlineExtension,
39
- isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline;
40
+ isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline,
41
+ dataAttributes = _ref.dataAttributes;
40
42
  var isPixelWidth = (size === null || size === void 0 ? void 0 : size.widthType) === 'pixel';
41
43
  var mediaSingleWidth = (size === null || size === void 0 ? void 0 : size.width) || pctWidth;
42
44
  var children = _react.default.Children.toArray(propsChildren);
@@ -87,7 +89,7 @@ function MediaSingle(_ref) {
87
89
  var _children = (0, _slicedToArray2.default)(children, 2),
88
90
  media = _children[0],
89
91
  caption = _children[1];
90
- return (0, _react2.jsx)("div", {
92
+ return (0, _react2.jsx)("div", (0, _extends2.default)({
91
93
  ref: handleMediaSingleRef,
92
94
  css: (0, _styled.MediaSingleDimensionHelper)({
93
95
  width: width,
@@ -106,7 +108,7 @@ function MediaSingle(_ref) {
106
108
  'is-loading': isLoading,
107
109
  'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
108
110
  })
109
- }, (0, _react2.jsx)(_styled.MediaWrapper, {
111
+ }, dataAttributes), (0, _react2.jsx)(_styled.MediaWrapper, {
110
112
  hasFallbackContainer: hasFallbackContainer,
111
113
  height: mediaWrapperHeight,
112
114
  paddingBottom: paddingBottom
@@ -1,5 +1,5 @@
1
1
  import { css } from '@emotion/react';
2
- import { B200, N20, N20A, N70 } from '@atlaskit/theme/colors';
2
+ import { N20, N20A, N70 } from '@atlaskit/theme/colors';
3
3
  import { BODIED_EXT_PADDING, EXTENSION_PADDING } from '../../styles';
4
4
  export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
5
5
  export const wrapperDefault = css({
@@ -7,10 +7,6 @@ export const wrapperDefault = css({
7
7
  borderRadius: "var(--ds-border-radius, 3px)",
8
8
  position: 'relative',
9
9
  verticalAlign: 'middle',
10
- '.ProseMirror-selectednode > span > & > .extension-overlay': {
11
- boxShadow: `inset 0px 0px 0px 2px ${`var(--ds-border-selected, ${B200})`}`,
12
- opacity: 1
13
- },
14
10
  '&.with-overlay': {
15
11
  '.extension-overlay': {
16
12
  background: `var(--ds-background-neutral-hovered, ${N20A})`,
@@ -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 = "78.14.3";
3
+ const packageVersion = "78.15.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
@@ -1,6 +1,6 @@
1
1
  export { textColorStyles } from './shared/text-color';
2
2
  export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, tableMarginTopWithControl } from './shared/table';
3
- export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles } from './shared/annotation';
3
+ export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, mediaAnnotationStyles } from './shared/annotation';
4
4
  export { columnLayoutSharedStyle } from './shared/column-layout';
5
5
  export { mediaSingleSharedStyle, richMediaClassName } from './shared/media-single';
6
6
  export { blockquoteSharedStyles } from './shared/blockquote';
@@ -93,4 +93,8 @@ export const annotationSharedStyles = () => css`
93
93
  box-shadow: ${commentStatusStyleMap('blur')};
94
94
  }
95
95
  }
96
- `;
96
+ `;
97
+ export const mediaAnnotationStyles = css({
98
+ boxShadow: `5px 5px ${`var(--ds-background-accent-yellow-subtler, ${Y75a})`}`,
99
+ borderRadius: '3px'
100
+ });
@@ -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 = "78.14.3";
10
+ const packageVersion = "78.15.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /** @jsx jsx */
2
3
  import React from 'react';
3
4
  import { jsx } from '@emotion/react';
@@ -22,7 +23,8 @@ export default function MediaSingle({
22
23
  lineLength: editorWidth,
23
24
  hasFallbackContainer = true,
24
25
  handleMediaSingleRef,
25
- isInsideOfInlineExtension = false
26
+ isInsideOfInlineExtension = false,
27
+ dataAttributes
26
28
  }) {
27
29
  const isPixelWidth = (size === null || size === void 0 ? void 0 : size.widthType) === 'pixel';
28
30
  let mediaSingleWidth = (size === null || size === void 0 ? void 0 : size.width) || pctWidth;
@@ -72,7 +74,7 @@ export default function MediaSingle({
72
74
  }
73
75
  }
74
76
  const [media, caption] = children;
75
- return jsx("div", {
77
+ return jsx("div", _extends({
76
78
  ref: handleMediaSingleRef,
77
79
  css: MediaSingleDimensionHelper({
78
80
  width,
@@ -91,7 +93,7 @@ export default function MediaSingle({
91
93
  'is-loading': isLoading,
92
94
  'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
93
95
  })
94
- }, jsx(MediaWrapper, {
96
+ }, dataAttributes), jsx(MediaWrapper, {
95
97
  hasFallbackContainer: hasFallbackContainer,
96
98
  height: mediaWrapperHeight,
97
99
  paddingBottom: paddingBottom
@@ -1,5 +1,5 @@
1
1
  import { css } from '@emotion/react';
2
- import { B200, N20, N20A, N70 } from '@atlaskit/theme/colors';
2
+ import { N20, N20A, N70 } from '@atlaskit/theme/colors';
3
3
  import { BODIED_EXT_PADDING, EXTENSION_PADDING } from '../../styles';
4
4
  export { EXTENSION_PADDING as padding, BODIED_EXT_PADDING };
5
5
  export var wrapperDefault = css({
@@ -7,10 +7,6 @@ export var wrapperDefault = css({
7
7
  borderRadius: "var(--ds-border-radius, 3px)",
8
8
  position: 'relative',
9
9
  verticalAlign: 'middle',
10
- '.ProseMirror-selectednode > span > & > .extension-overlay': {
11
- boxShadow: "inset 0px 0px 0px 2px ".concat("var(--ds-border-selected, ".concat(B200, ")")),
12
- opacity: 1
13
- },
14
10
  '&.with-overlay': {
15
11
  '.extension-overlay': {
16
12
  background: "var(--ds-background-neutral-hovered, ".concat(N20A, ")"),
@@ -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 = "78.14.3";
9
+ var packageVersion = "78.15.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
@@ -1,6 +1,6 @@
1
1
  export { textColorStyles } from './shared/text-color';
2
2
  export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, tableMarginTopWithControl } from './shared/table';
3
- export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles } from './shared/annotation';
3
+ export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, mediaAnnotationStyles } from './shared/annotation';
4
4
  export { columnLayoutSharedStyle } from './shared/column-layout';
5
5
  export { mediaSingleSharedStyle, richMediaClassName } from './shared/media-single';
6
6
  export { blockquoteSharedStyles } from './shared/blockquote';
@@ -67,4 +67,8 @@ export var AnnotationSharedCSSByState = function AnnotationSharedCSSByState() {
67
67
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState()` is not safe in object syntax
68
68
  export var annotationSharedStyles = function annotationSharedStyles() {
69
69
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n .", " {\n ", ";\n }\n\n .", " {\n ", ";\n cursor: initial;\n }\n\n .", " {\n ", ";\n }\n\n // Styling for comments on media node\n .", "[class*=ak-editor-block-annotation-] {\n border-radius: 3px;\n }\n\n .", ".", " {\n box-shadow: ", ";\n }\n\n .", ".", " {\n box-shadow: ", ";\n }\n\n .", ".", " {\n box-shadow: ", ";\n }\n }\n"])), AnnotationSharedClassNames.focus, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.draft, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.blur, AnnotationSharedCSSByState().blur, mediaNodeDomRef, mediaNodeDomRef, BlockAnnotationSharedClassNames.draft, commentStatusStyleMap('draft'), mediaNodeDomRef, BlockAnnotationSharedClassNames.focus, commentStatusStyleMap('focus'), mediaNodeDomRef, BlockAnnotationSharedClassNames.blur, commentStatusStyleMap('blur'));
70
- };
70
+ };
71
+ export var mediaAnnotationStyles = css({
72
+ boxShadow: "5px 5px ".concat("var(--ds-background-accent-yellow-subtler, ".concat(Y75a, ")")),
73
+ borderRadius: '3px'
74
+ });
@@ -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 = "78.14.3";
20
+ var packageVersion = "78.15.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  /** @jsx jsx */
3
4
  import React from 'react';
@@ -28,7 +29,8 @@ export default function MediaSingle(_ref) {
28
29
  hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
29
30
  handleMediaSingleRef = _ref.handleMediaSingleRef,
30
31
  _ref$isInsideOfInline = _ref.isInsideOfInlineExtension,
31
- isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline;
32
+ isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline,
33
+ dataAttributes = _ref.dataAttributes;
32
34
  var isPixelWidth = (size === null || size === void 0 ? void 0 : size.widthType) === 'pixel';
33
35
  var mediaSingleWidth = (size === null || size === void 0 ? void 0 : size.width) || pctWidth;
34
36
  var children = React.Children.toArray(propsChildren);
@@ -79,7 +81,7 @@ export default function MediaSingle(_ref) {
79
81
  var _children = _slicedToArray(children, 2),
80
82
  media = _children[0],
81
83
  caption = _children[1];
82
- return jsx("div", {
84
+ return jsx("div", _extends({
83
85
  ref: handleMediaSingleRef,
84
86
  css: MediaSingleDimensionHelper({
85
87
  width: width,
@@ -98,7 +100,7 @@ export default function MediaSingle(_ref) {
98
100
  'is-loading': isLoading,
99
101
  'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
100
102
  })
101
- }, jsx(MediaWrapper, {
103
+ }, dataAttributes), jsx(MediaWrapper, {
102
104
  hasFallbackContainer: hasFallbackContainer,
103
105
  height: mediaWrapperHeight,
104
106
  paddingBottom: paddingBottom
@@ -1,6 +1,6 @@
1
1
  export { textColorStyles } from './shared/text-color';
2
2
  export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, tableMarginTopWithControl, } from './shared/table';
3
- export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, } from './shared/annotation';
3
+ export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, mediaAnnotationStyles, } from './shared/annotation';
4
4
  export { columnLayoutSharedStyle } from './shared/column-layout';
5
5
  export { mediaSingleSharedStyle, richMediaClassName, } from './shared/media-single';
6
6
  export { blockquoteSharedStyles } from './shared/blockquote';
@@ -15,3 +15,4 @@ export declare const AnnotationSharedCSSByState: () => {
15
15
  blur: import("@emotion/react").SerializedStyles;
16
16
  };
17
17
  export declare const annotationSharedStyles: () => import("@emotion/react").SerializedStyles;
18
+ export declare const mediaAnnotationStyles: import("@emotion/react").SerializedStyles;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
2
+ import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
5
- import { AnnotationState, AnnotationUpdateEmitter, AnnotationUpdateEvent, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
5
+ import type { AnnotationState, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
6
+ import { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './emitter';
6
7
  export type { AnnotationState };
7
8
  export type AnnotationByMatches = {
8
9
  originalSelection: string;
@@ -68,14 +69,50 @@ export type InlineCommentViewComponentProps = {
68
69
  clickElementTarget?: HTMLElement;
69
70
  deleteAnnotation: (annotationInfo: AnnotationInfo) => ActionResult;
70
71
  };
72
+ export type InlineCommentHoverComponentProps = {
73
+ /**
74
+ * Range selected
75
+ */
76
+ range: Range;
77
+ /**
78
+ * Renderer/Editor DOM element ancestors wrapping the selection.
79
+ */
80
+ wrapperDOM: HTMLElement;
81
+ /**
82
+ * If it is possible to add an inline comment on this range
83
+ */
84
+ isAnnotationAllowed: boolean;
85
+ /**
86
+ * Creates an annotation mark in the document with the given id.
87
+ */
88
+ onCreate: (annotationId: AnnotationId) => AnnotationActionResult;
89
+ /**
90
+ * Indicates that a draft comment was discarded/cancelled
91
+ */
92
+ onClose: () => void;
93
+ /**
94
+ * Call this function to surround the range with a HTML tag.
95
+ */
96
+ applyDraftMode: (keepNativeSelection?: boolean) => void;
97
+ /**
98
+ * Call this function to remove the draft HTML tags created by the applyDraftMode
99
+ */
100
+ removeDraftMode: () => void;
101
+ /**
102
+ * getAnnotationIndexMatch finds the { numMatch, matchIndex } tuple of the current selection
103
+ */
104
+ getAnnotationIndexMatch?: () => AnnotationByMatches | false;
105
+ };
71
106
  interface AnnotationTypeProvider<Type> {
72
107
  getState: (annotationIds: string[]) => Promise<AnnotationState<Type>[]>;
73
108
  updateSubscriber?: AnnotationUpdateEmitter;
74
109
  allowDraftMode?: boolean;
110
+ allowCommentsOnMedia?: boolean;
75
111
  }
76
112
  export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationTypes.INLINE_COMMENT> & {
77
113
  selectionComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
78
114
  viewComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentViewComponentProps>>;
115
+ hoverComponent?: React.ComponentType<InlineCommentHoverComponentProps>;
79
116
  };
80
117
  export type AnnotationProviders = {
81
118
  inlineComment: InlineCommentAnnotationProvider;
@@ -9,7 +9,7 @@ export declare enum SortOrder {
9
9
  NO_ORDER = "no_order"
10
10
  }
11
11
  export { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './annotation';
12
- export type { AnnotationState, AnnotationProviders, AnnotationUpdateEventPayloads, InlineCommentSelectionComponentProps, InlineCommentViewComponentProps, InlineCommentAnnotationProvider, OnAnnotationClickPayload, AnnotationByMatches, AnnotationActionResult, } from './annotation';
12
+ export type { AnnotationState, AnnotationProviders, AnnotationUpdateEventPayloads, InlineCommentSelectionComponentProps, InlineCommentHoverComponentProps, InlineCommentViewComponentProps, InlineCommentAnnotationProvider, OnAnnotationClickPayload, AnnotationByMatches, AnnotationActionResult, } from './annotation';
13
13
  export type { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue, } from './editor-actions';
14
14
  export type { TypeAheadStats, TypeAheadItemRenderProps, TypeAheadInsert, TypeAheadSelectItem, TypeAheadItem, TypeAheadForceSelect, TypeAheadHandler, } from './type-ahead';
15
15
  export type { CommandDispatch, Command, HigherOrderCommand, Predicate, } from './command';
@@ -24,6 +24,7 @@ export interface Props {
24
24
  hasFallbackContainer?: boolean;
25
25
  handleMediaSingleRef?: React.RefObject<HTMLDivElement>;
26
26
  isInsideOfInlineExtension?: boolean;
27
+ dataAttributes?: Record<string, any>;
27
28
  }
28
29
  export type { MediaSingleWidthType, MediaSingleSize };
29
- export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, size, className, children: propsChildren, nodeType, fullWidthMode, lineLength: editorWidth, hasFallbackContainer, handleMediaSingleRef, isInsideOfInlineExtension, }: Props): jsx.JSX.Element;
30
+ export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, size, className, children: propsChildren, nodeType, fullWidthMode, lineLength: editorWidth, hasFallbackContainer, handleMediaSingleRef, isInsideOfInlineExtension, dataAttributes, }: Props): jsx.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  export { textColorStyles } from './shared/text-color';
2
2
  export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, tableMarginTopWithControl, } from './shared/table';
3
- export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, } from './shared/annotation';
3
+ export { AnnotationSharedClassNames, BlockAnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, mediaAnnotationStyles, } from './shared/annotation';
4
4
  export { columnLayoutSharedStyle } from './shared/column-layout';
5
5
  export { mediaSingleSharedStyle, richMediaClassName, } from './shared/media-single';
6
6
  export { blockquoteSharedStyles } from './shared/blockquote';
@@ -15,3 +15,4 @@ export declare const AnnotationSharedCSSByState: () => {
15
15
  blur: import("@emotion/react").SerializedStyles;
16
16
  };
17
17
  export declare const annotationSharedStyles: () => import("@emotion/react").SerializedStyles;
18
+ export declare const mediaAnnotationStyles: import("@emotion/react").SerializedStyles;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
2
+ import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
5
- import { AnnotationState, AnnotationUpdateEmitter, AnnotationUpdateEvent, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
5
+ import type { AnnotationState, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
6
+ import { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './emitter';
6
7
  export type { AnnotationState };
7
8
  export type AnnotationByMatches = {
8
9
  originalSelection: string;
@@ -68,14 +69,50 @@ export type InlineCommentViewComponentProps = {
68
69
  clickElementTarget?: HTMLElement;
69
70
  deleteAnnotation: (annotationInfo: AnnotationInfo) => ActionResult;
70
71
  };
72
+ export type InlineCommentHoverComponentProps = {
73
+ /**
74
+ * Range selected
75
+ */
76
+ range: Range;
77
+ /**
78
+ * Renderer/Editor DOM element ancestors wrapping the selection.
79
+ */
80
+ wrapperDOM: HTMLElement;
81
+ /**
82
+ * If it is possible to add an inline comment on this range
83
+ */
84
+ isAnnotationAllowed: boolean;
85
+ /**
86
+ * Creates an annotation mark in the document with the given id.
87
+ */
88
+ onCreate: (annotationId: AnnotationId) => AnnotationActionResult;
89
+ /**
90
+ * Indicates that a draft comment was discarded/cancelled
91
+ */
92
+ onClose: () => void;
93
+ /**
94
+ * Call this function to surround the range with a HTML tag.
95
+ */
96
+ applyDraftMode: (keepNativeSelection?: boolean) => void;
97
+ /**
98
+ * Call this function to remove the draft HTML tags created by the applyDraftMode
99
+ */
100
+ removeDraftMode: () => void;
101
+ /**
102
+ * getAnnotationIndexMatch finds the { numMatch, matchIndex } tuple of the current selection
103
+ */
104
+ getAnnotationIndexMatch?: () => AnnotationByMatches | false;
105
+ };
71
106
  interface AnnotationTypeProvider<Type> {
72
107
  getState: (annotationIds: string[]) => Promise<AnnotationState<Type>[]>;
73
108
  updateSubscriber?: AnnotationUpdateEmitter;
74
109
  allowDraftMode?: boolean;
110
+ allowCommentsOnMedia?: boolean;
75
111
  }
76
112
  export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationTypes.INLINE_COMMENT> & {
77
113
  selectionComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
78
114
  viewComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentViewComponentProps>>;
115
+ hoverComponent?: React.ComponentType<InlineCommentHoverComponentProps>;
79
116
  };
80
117
  export type AnnotationProviders = {
81
118
  inlineComment: InlineCommentAnnotationProvider;
@@ -9,7 +9,7 @@ export declare enum SortOrder {
9
9
  NO_ORDER = "no_order"
10
10
  }
11
11
  export { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './annotation';
12
- export type { AnnotationState, AnnotationProviders, AnnotationUpdateEventPayloads, InlineCommentSelectionComponentProps, InlineCommentViewComponentProps, InlineCommentAnnotationProvider, OnAnnotationClickPayload, AnnotationByMatches, AnnotationActionResult, } from './annotation';
12
+ export type { AnnotationState, AnnotationProviders, AnnotationUpdateEventPayloads, InlineCommentSelectionComponentProps, InlineCommentHoverComponentProps, InlineCommentViewComponentProps, InlineCommentAnnotationProvider, OnAnnotationClickPayload, AnnotationByMatches, AnnotationActionResult, } from './annotation';
13
13
  export type { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue, } from './editor-actions';
14
14
  export type { TypeAheadStats, TypeAheadItemRenderProps, TypeAheadInsert, TypeAheadSelectItem, TypeAheadItem, TypeAheadForceSelect, TypeAheadHandler, } from './type-ahead';
15
15
  export type { CommandDispatch, Command, HigherOrderCommand, Predicate, } from './command';
@@ -24,6 +24,7 @@ export interface Props {
24
24
  hasFallbackContainer?: boolean;
25
25
  handleMediaSingleRef?: React.RefObject<HTMLDivElement>;
26
26
  isInsideOfInlineExtension?: boolean;
27
+ dataAttributes?: Record<string, any>;
27
28
  }
28
29
  export type { MediaSingleWidthType, MediaSingleSize };
29
- export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, size, className, children: propsChildren, nodeType, fullWidthMode, lineLength: editorWidth, hasFallbackContainer, handleMediaSingleRef, isInsideOfInlineExtension, }: Props): jsx.JSX.Element;
30
+ export default function MediaSingle({ layout, width, height, containerWidth, isLoading, pctWidth, size, className, children: propsChildren, nodeType, fullWidthMode, lineLength: editorWidth, hasFallbackContainer, handleMediaSingleRef, isInsideOfInlineExtension, dataAttributes, }: Props): jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "78.14.3",
3
+ "version": "78.15.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/"
@@ -122,7 +122,7 @@
122
122
  "@atlaskit/media-file-preview": "^0.5.0",
123
123
  "@atlaskit/media-picker": "^66.3.0",
124
124
  "@atlaskit/media-ui": "^25.4.0",
125
- "@atlaskit/media-viewer": "48.3.9",
125
+ "@atlaskit/media-viewer": "48.4.0",
126
126
  "@atlaskit/mention": "^23.0.0",
127
127
  "@atlaskit/menu": "^2.1.0",
128
128
  "@atlaskit/platform-feature-flags": "^0.2.0",