@atlaskit/renderer 109.29.0 → 109.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 109.29.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#97803](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97803)
8
+ [`4c1023ffb3d8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4c1023ffb3d8) -
9
+ [ED-23094] Ignore annotations on mediaInline node, including highlight styling,
10
+ event(onMouseEnter, onClick) listeners, update active annotations when the node is selected or
11
+ the cursor is right after the node
12
+
3
13
  ## 109.29.0
4
14
 
5
15
  ### Minor Changes
@@ -100,6 +100,11 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
100
100
  isMediaLink: true
101
101
  });
102
102
  }
103
+ if (_this.isCommentsOnMediaMediaInlineBugFixEnabled && node.type.name === 'mediaInline' && mark.type.name === 'annotation') {
104
+ return _objectSpread(_objectSpread({}, defaultProps), {}, {
105
+ isMediaInline: true
106
+ });
107
+ }
103
108
  return defaultProps;
104
109
  });
105
110
  (0, _defineProperty2.default)(this, "getUnsupportedContentProps", function (node) {
@@ -185,6 +190,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
185
190
  this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
186
191
  this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
187
192
  this.textHighlighter = init.textHighlighter;
193
+ this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
188
194
  }
189
195
  (0, _createClass2.default)(ReactSerializer, [{
190
196
  key: "resetState",
@@ -23,13 +23,22 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
23
23
  _ref$annotationParent = _ref.annotationParentIds,
24
24
  annotationParentIds = _ref$annotationParent === void 0 ? [] : _ref$annotationParent,
25
25
  allowAnnotations = _ref.allowAnnotations,
26
- useBlockLevel = _ref.useBlockLevel;
26
+ useBlockLevel = _ref.useBlockLevel,
27
+ isMediaInline = _ref.isMediaInline;
27
28
  var data = _objectSpread(_objectSpread({}, dataAttributes), (0, _adfSchema.buildAnnotationMarkDataAttributes)({
28
29
  id: id,
29
30
  annotationType: annotationType
30
31
  }));
31
32
  if (allowAnnotations) {
32
- return /*#__PURE__*/_react.default.createElement(_annotations.AnnotationMark, {
33
+ return isMediaInline ?
34
+ /*#__PURE__*/
35
+ // Inline comment on mediaInline is not supported as part of comments on media project,
36
+ // hence skip any styling/event handling for annotations on mediaInline.
37
+ // `id` is still needed so that comment view component can be correct positioned
38
+ // when using comment navigation to access comments on mediaInline
39
+ _react.default.createElement("span", {
40
+ id: id
41
+ }, children) : /*#__PURE__*/_react.default.createElement(_annotations.AnnotationMark, {
33
42
  id: id,
34
43
  dataAttributes: data,
35
44
  annotationParentIds: annotationParentIds,
@@ -56,7 +56,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
56
56
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
57
57
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
58
58
  var packageName = "@atlaskit/renderer";
59
- var packageVersion = "109.29.0";
59
+ var packageVersion = "109.29.1";
60
60
  var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
61
61
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
62
62
  (0, _inherits2.default)(Renderer, _PureComponent);
@@ -284,7 +284,8 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
284
284
  // does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
285
285
  allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
286
286
  isInsideOfInlineExtension: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
287
- textHighlighter: props.UNSTABLE_textHighlighter
287
+ textHighlighter: props.UNSTABLE_textHighlighter,
288
+ isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix
288
289
  };
289
290
  }
290
291
  }, {
@@ -82,6 +82,12 @@ export default class ReactSerializer {
82
82
  isMediaLink: true
83
83
  };
84
84
  }
85
+ if (this.isCommentsOnMediaMediaInlineBugFixEnabled && node.type.name === 'mediaInline' && mark.type.name === 'annotation') {
86
+ return {
87
+ ...defaultProps,
88
+ isMediaInline: true
89
+ };
90
+ }
85
91
  return defaultProps;
86
92
  });
87
93
  _defineProperty(this, "getUnsupportedContentProps", node => {
@@ -170,6 +176,7 @@ export default class ReactSerializer {
170
176
  this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
171
177
  this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
172
178
  this.textHighlighter = init.textHighlighter;
179
+ this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
173
180
  }
174
181
  resetState() {
175
182
  this.headingIds = [];
@@ -12,7 +12,8 @@ const AnnotationComponent = ({
12
12
  dataAttributes,
13
13
  annotationParentIds = [],
14
14
  allowAnnotations,
15
- useBlockLevel
15
+ useBlockLevel,
16
+ isMediaInline
16
17
  }) => {
17
18
  const data = {
18
19
  ...dataAttributes,
@@ -22,7 +23,15 @@ const AnnotationComponent = ({
22
23
  })
23
24
  };
24
25
  if (allowAnnotations) {
25
- return /*#__PURE__*/React.createElement(AnnotationMark, {
26
+ return isMediaInline ?
27
+ /*#__PURE__*/
28
+ // Inline comment on mediaInline is not supported as part of comments on media project,
29
+ // hence skip any styling/event handling for annotations on mediaInline.
30
+ // `id` is still needed so that comment view component can be correct positioned
31
+ // when using comment navigation to access comments on mediaInline
32
+ React.createElement("span", {
33
+ id: id
34
+ }, children) : /*#__PURE__*/React.createElement(AnnotationMark, {
26
35
  id: id,
27
36
  dataAttributes: data,
28
37
  annotationParentIds: annotationParentIds,
@@ -37,7 +37,7 @@ import { nodeToReact } from '../../react/nodes';
37
37
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
38
38
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
39
39
  const packageName = "@atlaskit/renderer";
40
- const packageVersion = "109.29.0";
40
+ const packageVersion = "109.29.1";
41
41
  export const defaultNodeComponents = nodeToReact;
42
42
  export class Renderer extends PureComponent {
43
43
  constructor(props) {
@@ -263,7 +263,8 @@ export class Renderer extends PureComponent {
263
263
  // does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
264
264
  allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
265
265
  isInsideOfInlineExtension: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
266
- textHighlighter: props.UNSTABLE_textHighlighter
266
+ textHighlighter: props.UNSTABLE_textHighlighter,
267
+ isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix
267
268
  };
268
269
  }
269
270
  render() {
@@ -93,6 +93,11 @@ var ReactSerializer = /*#__PURE__*/function () {
93
93
  isMediaLink: true
94
94
  });
95
95
  }
96
+ if (_this.isCommentsOnMediaMediaInlineBugFixEnabled && node.type.name === 'mediaInline' && mark.type.name === 'annotation') {
97
+ return _objectSpread(_objectSpread({}, defaultProps), {}, {
98
+ isMediaInline: true
99
+ });
100
+ }
96
101
  return defaultProps;
97
102
  });
98
103
  _defineProperty(this, "getUnsupportedContentProps", function (node) {
@@ -178,6 +183,7 @@ var ReactSerializer = /*#__PURE__*/function () {
178
183
  this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
179
184
  this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
180
185
  this.textHighlighter = init.textHighlighter;
186
+ this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
181
187
  }
182
188
  _createClass(ReactSerializer, [{
183
189
  key: "resetState",
@@ -16,13 +16,22 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
16
16
  _ref$annotationParent = _ref.annotationParentIds,
17
17
  annotationParentIds = _ref$annotationParent === void 0 ? [] : _ref$annotationParent,
18
18
  allowAnnotations = _ref.allowAnnotations,
19
- useBlockLevel = _ref.useBlockLevel;
19
+ useBlockLevel = _ref.useBlockLevel,
20
+ isMediaInline = _ref.isMediaInline;
20
21
  var data = _objectSpread(_objectSpread({}, dataAttributes), buildAnnotationMarkDataAttributes({
21
22
  id: id,
22
23
  annotationType: annotationType
23
24
  }));
24
25
  if (allowAnnotations) {
25
- return /*#__PURE__*/React.createElement(AnnotationMark, {
26
+ return isMediaInline ?
27
+ /*#__PURE__*/
28
+ // Inline comment on mediaInline is not supported as part of comments on media project,
29
+ // hence skip any styling/event handling for annotations on mediaInline.
30
+ // `id` is still needed so that comment view component can be correct positioned
31
+ // when using comment navigation to access comments on mediaInline
32
+ React.createElement("span", {
33
+ id: id
34
+ }, children) : /*#__PURE__*/React.createElement(AnnotationMark, {
26
35
  id: id,
27
36
  dataAttributes: data,
28
37
  annotationParentIds: annotationParentIds,
@@ -47,7 +47,7 @@ import { nodeToReact } from '../../react/nodes';
47
47
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
48
48
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
49
49
  var packageName = "@atlaskit/renderer";
50
- var packageVersion = "109.29.0";
50
+ var packageVersion = "109.29.1";
51
51
  export var defaultNodeComponents = nodeToReact;
52
52
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
53
53
  _inherits(Renderer, _PureComponent);
@@ -275,7 +275,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
275
275
  // does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
276
276
  allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
277
277
  isInsideOfInlineExtension: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
278
- textHighlighter: props.UNSTABLE_textHighlighter
278
+ textHighlighter: props.UNSTABLE_textHighlighter,
279
+ isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix
279
280
  };
280
281
  }
281
282
  }, {
@@ -41,6 +41,7 @@ export interface ReactSerializerInit {
41
41
  allowWindowedCodeBlock?: boolean;
42
42
  isInsideOfInlineExtension?: boolean;
43
43
  textHighlighter?: TextHighlighter;
44
+ isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
44
45
  }
45
46
  interface ParentInfo {
46
47
  parentIsIncompleteTask: boolean;
@@ -87,6 +88,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
87
88
  private nodeComponents?;
88
89
  private allowWindowedCodeBlock?;
89
90
  private isInsideOfInlineExtension?;
91
+ private isCommentsOnMediaMediaInlineBugFixEnabled?;
90
92
  private textHighlighter?;
91
93
  constructor(init: ReactSerializerInit);
92
94
  private resetState;
@@ -2,5 +2,5 @@
2
2
  import type { MarkProps, AnnotationMarkMeta } from '../types';
3
3
  import type { Mark } from '@atlaskit/editor-prosemirror/model';
4
4
  export declare const isAnnotationMark: (mark: Mark) => boolean;
5
- declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, useBlockLevel, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
5
+ declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, useBlockLevel, isMediaInline, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
6
6
  export default AnnotationComponent;
@@ -55,6 +55,7 @@ export interface AnnotationMarkMeta extends MarkMeta {
55
55
  annotationParentIds: string[];
56
56
  allowAnnotations: boolean;
57
57
  useBlockLevel?: boolean;
58
+ isMediaInline?: boolean;
58
59
  }
59
60
  export type NodeProps<NodeAttrs = {}> = NodeAttrs & PropsWithChildren<NodeMeta>;
60
61
  export type MarkProps<MarkAttrs = {}> = MarkAttrs & PropsWithChildren<MarkMeta>;
@@ -41,6 +41,7 @@ export interface ReactSerializerInit {
41
41
  allowWindowedCodeBlock?: boolean;
42
42
  isInsideOfInlineExtension?: boolean;
43
43
  textHighlighter?: TextHighlighter;
44
+ isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
44
45
  }
45
46
  interface ParentInfo {
46
47
  parentIsIncompleteTask: boolean;
@@ -87,6 +88,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
87
88
  private nodeComponents?;
88
89
  private allowWindowedCodeBlock?;
89
90
  private isInsideOfInlineExtension?;
91
+ private isCommentsOnMediaMediaInlineBugFixEnabled?;
90
92
  private textHighlighter?;
91
93
  constructor(init: ReactSerializerInit);
92
94
  private resetState;
@@ -2,5 +2,5 @@
2
2
  import type { MarkProps, AnnotationMarkMeta } from '../types';
3
3
  import type { Mark } from '@atlaskit/editor-prosemirror/model';
4
4
  export declare const isAnnotationMark: (mark: Mark) => boolean;
5
- declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, useBlockLevel, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
5
+ declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, useBlockLevel, isMediaInline, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
6
6
  export default AnnotationComponent;
@@ -55,6 +55,7 @@ export interface AnnotationMarkMeta extends MarkMeta {
55
55
  annotationParentIds: string[];
56
56
  allowAnnotations: boolean;
57
57
  useBlockLevel?: boolean;
58
+ isMediaInline?: boolean;
58
59
  }
59
60
  export type NodeProps<NodeAttrs = {}> = NodeAttrs & PropsWithChildren<NodeMeta>;
60
61
  export type MarkProps<MarkAttrs = {}> = MarkAttrs & PropsWithChildren<MarkMeta>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.29.0",
3
+ "version": "109.29.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/editor-shared-styles": "^2.11.0",
39
39
  "@atlaskit/emoji": "^67.6.0",
40
40
  "@atlaskit/icon": "^22.2.0",
41
- "@atlaskit/link-datasource": "^2.2.0",
41
+ "@atlaskit/link-datasource": "^2.3.0",
42
42
  "@atlaskit/media-card": "^77.11.0",
43
43
  "@atlaskit/media-client": "^27.0.0",
44
44
  "@atlaskit/media-client-react": "^2.0.0",