@atlaskit/renderer 109.25.5 → 109.26.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/renderer
2
2
 
3
+ ## 109.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#98890](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98890)
8
+ [`9a61210caecb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a61210caecb) -
9
+ Updating parameters of the applyDraftMode() function to return a step if an annotationId is
10
+ passed in
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 109.25.5
4
17
 
5
18
  ### Patch Changes
@@ -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.25.5";
59
+ var packageVersion = "109.26.0";
60
60
  var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
61
61
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
62
62
  (0, _inherits2.default)(Renderer, _PureComponent);
@@ -65,8 +65,7 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
65
65
  }
66
66
  return result;
67
67
  }, [documentPosition, generateIndexMatch]);
68
- var applyDraftModeCallback = (0, _react.useCallback)(function () {
69
- var keepNativeSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
68
+ var applyDraftModeCallback = (0, _react.useCallback)(function (options) {
70
69
  if (!documentPosition || !isAnnotationAllowed) {
71
70
  if (createAnalyticsEvent) {
72
71
  createAnalyticsEvent({
@@ -77,7 +76,7 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
77
76
  eventType: _analytics.EVENT_TYPE.TRACK
78
77
  }).fire(_analyticsListeners.FabricChannel.editor);
79
78
  }
80
- return;
79
+ return false;
81
80
  }
82
81
  setDraftDocumentPosition(documentPosition);
83
82
  applyAnnotationDraftAt(documentPosition);
@@ -94,7 +93,7 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
94
93
  }).fire(_analyticsListeners.FabricChannel.editor);
95
94
  }
96
95
  window.requestAnimationFrame(function () {
97
- if (keepNativeSelection) {
96
+ if (options.keepNativeSelection) {
98
97
  (0, _draft.updateWindowSelectionAroundDraft)(documentPosition);
99
98
  } else {
100
99
  var sel = window.getSelection();
@@ -103,7 +102,16 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
103
102
  }
104
103
  }
105
104
  });
106
- }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
105
+ var positionToAnnotate = draftDocumentPosition || documentPosition;
106
+ if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
107
+ return false;
108
+ }
109
+ var annotation = {
110
+ annotationId: options.annotationId,
111
+ annotationType: _adfSchema.AnnotationTypes.INLINE_COMMENT
112
+ };
113
+ return applyAnnotation(positionToAnnotate, annotation, isCommentsOnMediaBugFixEnabled);
114
+ }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, applyAnnotation, draftDocumentPosition, isCommentsOnMediaBugFixEnabled, actions, range]);
107
115
  var removeDraftModeCallback = (0, _react.useCallback)(function () {
108
116
  clearAnnotationDraft();
109
117
  setDraftDocumentPosition(null);
@@ -74,8 +74,7 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
74
74
  }
75
75
  return result;
76
76
  }, [documentPosition, generateIndexMatch]);
77
- var applyDraftModeCallback = (0, _react.useCallback)(function () {
78
- var keepNativeSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
77
+ var applyDraftModeCallback = (0, _react.useCallback)(function (options) {
79
78
  if (!documentPosition || !isAnnotationAllowed) {
80
79
  if (createAnalyticsEvent) {
81
80
  createAnalyticsEvent({
@@ -86,7 +85,7 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
86
85
  eventType: _analytics.EVENT_TYPE.TRACK
87
86
  }).fire(_analyticsListeners.FabricChannel.editor);
88
87
  }
89
- return;
88
+ return false;
90
89
  }
91
90
  setDraftDocumentPosition(documentPosition);
92
91
  applyAnnotationDraftAt(documentPosition);
@@ -103,7 +102,7 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
103
102
  }).fire(_analyticsListeners.FabricChannel.editor);
104
103
  }
105
104
  window.requestAnimationFrame(function () {
106
- if (keepNativeSelection) {
105
+ if (options.keepNativeSelection) {
107
106
  (0, _draft.updateWindowSelectionAroundDraft)(documentPosition);
108
107
  } else {
109
108
  var sel = window.getSelection();
@@ -112,7 +111,16 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
112
111
  }
113
112
  }
114
113
  });
115
- }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
114
+ var positionToAnnotate = draftDocumentPosition || documentPosition;
115
+ if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
116
+ return false;
117
+ }
118
+ var annotation = {
119
+ annotationId: options.annotationId,
120
+ annotationType: _adfSchema.AnnotationTypes.INLINE_COMMENT
121
+ };
122
+ return applyAnnotation(positionToAnnotate, annotation, isCommentsOnMediaBugFixEnabled);
123
+ }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, applyAnnotation, draftDocumentPosition, isCommentsOnMediaBugFixEnabled, actions, range]);
116
124
  var removeDraftModeCallback = (0, _react.useCallback)(function () {
117
125
  clearAnnotationDraft();
118
126
  setDraftDocumentPosition(null);
@@ -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.25.5";
40
+ const packageVersion = "109.26.0";
41
41
  export const defaultNodeComponents = nodeToReact;
42
42
  export class Renderer extends PureComponent {
43
43
  constructor(props) {
@@ -53,7 +53,7 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
53
53
  }
54
54
  return result;
55
55
  }, [documentPosition, generateIndexMatch]);
56
- const applyDraftModeCallback = useCallback((keepNativeSelection = true) => {
56
+ const applyDraftModeCallback = useCallback(options => {
57
57
  if (!documentPosition || !isAnnotationAllowed) {
58
58
  if (createAnalyticsEvent) {
59
59
  createAnalyticsEvent({
@@ -64,7 +64,7 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
64
64
  eventType: EVENT_TYPE.TRACK
65
65
  }).fire(FabricChannel.editor);
66
66
  }
67
- return;
67
+ return false;
68
68
  }
69
69
  setDraftDocumentPosition(documentPosition);
70
70
  applyAnnotationDraftAt(documentPosition);
@@ -81,7 +81,7 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
81
81
  }).fire(FabricChannel.editor);
82
82
  }
83
83
  window.requestAnimationFrame(() => {
84
- if (keepNativeSelection) {
84
+ if (options.keepNativeSelection) {
85
85
  updateWindowSelectionAroundDraft(documentPosition);
86
86
  } else {
87
87
  const sel = window.getSelection();
@@ -90,7 +90,16 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
90
90
  }
91
91
  }
92
92
  });
93
- }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
93
+ const positionToAnnotate = draftDocumentPosition || documentPosition;
94
+ if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
95
+ return false;
96
+ }
97
+ const annotation = {
98
+ annotationId: options.annotationId,
99
+ annotationType: AnnotationTypes.INLINE_COMMENT
100
+ };
101
+ return applyAnnotation(positionToAnnotate, annotation, isCommentsOnMediaBugFixEnabled);
102
+ }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, applyAnnotation, draftDocumentPosition, isCommentsOnMediaBugFixEnabled, actions, range]);
94
103
  const removeDraftModeCallback = useCallback(() => {
95
104
  clearAnnotationDraft();
96
105
  setDraftDocumentPosition(null);
@@ -62,7 +62,7 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
62
62
  }
63
63
  return result;
64
64
  }, [documentPosition, generateIndexMatch]);
65
- const applyDraftModeCallback = useCallback((keepNativeSelection = true) => {
65
+ const applyDraftModeCallback = useCallback(options => {
66
66
  if (!documentPosition || !isAnnotationAllowed) {
67
67
  if (createAnalyticsEvent) {
68
68
  createAnalyticsEvent({
@@ -73,7 +73,7 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
73
73
  eventType: EVENT_TYPE.TRACK
74
74
  }).fire(FabricChannel.editor);
75
75
  }
76
- return;
76
+ return false;
77
77
  }
78
78
  setDraftDocumentPosition(documentPosition);
79
79
  applyAnnotationDraftAt(documentPosition);
@@ -90,7 +90,7 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
90
90
  }).fire(FabricChannel.editor);
91
91
  }
92
92
  window.requestAnimationFrame(() => {
93
- if (keepNativeSelection) {
93
+ if (options.keepNativeSelection) {
94
94
  updateWindowSelectionAroundDraft(documentPosition);
95
95
  } else {
96
96
  const sel = window.getSelection();
@@ -99,7 +99,16 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
99
99
  }
100
100
  }
101
101
  });
102
- }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
102
+ const positionToAnnotate = draftDocumentPosition || documentPosition;
103
+ if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
104
+ return false;
105
+ }
106
+ const annotation = {
107
+ annotationId: options.annotationId,
108
+ annotationType: AnnotationTypes.INLINE_COMMENT
109
+ };
110
+ return applyAnnotation(positionToAnnotate, annotation, isCommentsOnMediaBugFixEnabled);
111
+ }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, applyAnnotation, draftDocumentPosition, isCommentsOnMediaBugFixEnabled, actions, range]);
103
112
  const removeDraftModeCallback = useCallback(() => {
104
113
  clearAnnotationDraft();
105
114
  setDraftDocumentPosition(null);
@@ -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.25.5";
50
+ var packageVersion = "109.26.0";
51
51
  export var defaultNodeComponents = nodeToReact;
52
52
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
53
53
  _inherits(Renderer, _PureComponent);
@@ -55,8 +55,7 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
55
55
  }
56
56
  return result;
57
57
  }, [documentPosition, generateIndexMatch]);
58
- var applyDraftModeCallback = useCallback(function () {
59
- var keepNativeSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
58
+ var applyDraftModeCallback = useCallback(function (options) {
60
59
  if (!documentPosition || !isAnnotationAllowed) {
61
60
  if (createAnalyticsEvent) {
62
61
  createAnalyticsEvent({
@@ -67,7 +66,7 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
67
66
  eventType: EVENT_TYPE.TRACK
68
67
  }).fire(FabricChannel.editor);
69
68
  }
70
- return;
69
+ return false;
71
70
  }
72
71
  setDraftDocumentPosition(documentPosition);
73
72
  applyAnnotationDraftAt(documentPosition);
@@ -84,7 +83,7 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
84
83
  }).fire(FabricChannel.editor);
85
84
  }
86
85
  window.requestAnimationFrame(function () {
87
- if (keepNativeSelection) {
86
+ if (options.keepNativeSelection) {
88
87
  updateWindowSelectionAroundDraft(documentPosition);
89
88
  } else {
90
89
  var sel = window.getSelection();
@@ -93,7 +92,16 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
93
92
  }
94
93
  }
95
94
  });
96
- }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
95
+ var positionToAnnotate = draftDocumentPosition || documentPosition;
96
+ if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
97
+ return false;
98
+ }
99
+ var annotation = {
100
+ annotationId: options.annotationId,
101
+ annotationType: AnnotationTypes.INLINE_COMMENT
102
+ };
103
+ return applyAnnotation(positionToAnnotate, annotation, isCommentsOnMediaBugFixEnabled);
104
+ }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, applyAnnotation, draftDocumentPosition, isCommentsOnMediaBugFixEnabled, actions, range]);
97
105
  var removeDraftModeCallback = useCallback(function () {
98
106
  clearAnnotationDraft();
99
107
  setDraftDocumentPosition(null);
@@ -64,8 +64,7 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
64
64
  }
65
65
  return result;
66
66
  }, [documentPosition, generateIndexMatch]);
67
- var applyDraftModeCallback = useCallback(function () {
68
- var keepNativeSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
67
+ var applyDraftModeCallback = useCallback(function (options) {
69
68
  if (!documentPosition || !isAnnotationAllowed) {
70
69
  if (createAnalyticsEvent) {
71
70
  createAnalyticsEvent({
@@ -76,7 +75,7 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
76
75
  eventType: EVENT_TYPE.TRACK
77
76
  }).fire(FabricChannel.editor);
78
77
  }
79
- return;
78
+ return false;
80
79
  }
81
80
  setDraftDocumentPosition(documentPosition);
82
81
  applyAnnotationDraftAt(documentPosition);
@@ -93,7 +92,7 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
93
92
  }).fire(FabricChannel.editor);
94
93
  }
95
94
  window.requestAnimationFrame(function () {
96
- if (keepNativeSelection) {
95
+ if (options.keepNativeSelection) {
97
96
  updateWindowSelectionAroundDraft(documentPosition);
98
97
  } else {
99
98
  var sel = window.getSelection();
@@ -102,7 +101,16 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
102
101
  }
103
102
  }
104
103
  });
105
- }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
104
+ var positionToAnnotate = draftDocumentPosition || documentPosition;
105
+ if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
106
+ return false;
107
+ }
108
+ var annotation = {
109
+ annotationId: options.annotationId,
110
+ annotationType: AnnotationTypes.INLINE_COMMENT
111
+ };
112
+ return applyAnnotation(positionToAnnotate, annotation, isCommentsOnMediaBugFixEnabled);
113
+ }, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, applyAnnotation, draftDocumentPosition, isCommentsOnMediaBugFixEnabled, actions, range]);
106
114
  var removeDraftModeCallback = useCallback(function () {
107
115
  clearAnnotationDraft();
108
116
  setDraftDocumentPosition(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.25.5",
3
+ "version": "109.26.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/analytics-next": "^9.3.0",
32
32
  "@atlaskit/button": "^17.14.0",
33
33
  "@atlaskit/code": "^15.2.0",
34
- "@atlaskit/editor-common": "^79.2.0",
34
+ "@atlaskit/editor-common": "^80.0.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.12.0",
36
36
  "@atlaskit/editor-palette": "1.6.0",
37
37
  "@atlaskit/editor-prosemirror": "4.0.1",
@@ -47,11 +47,11 @@
47
47
  "@atlaskit/media-ui": "^25.10.0",
48
48
  "@atlaskit/media-viewer": "^48.5.0",
49
49
  "@atlaskit/platform-feature-flags": "^0.2.0",
50
- "@atlaskit/smart-card": "^26.63.0",
50
+ "@atlaskit/smart-card": "^26.66.0",
51
51
  "@atlaskit/status": "^1.4.0",
52
52
  "@atlaskit/task-decision": "^17.10.0",
53
53
  "@atlaskit/theme": "^12.8.0",
54
- "@atlaskit/tokens": "^1.47.0",
54
+ "@atlaskit/tokens": "^1.48.0",
55
55
  "@atlaskit/tooltip": "^18.3.0",
56
56
  "@babel/runtime": "^7.0.0",
57
57
  "@emotion/react": "^11.7.1",