@atlaskit/editor-plugin-annotation 5.3.2 → 5.4.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,12 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 5.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`08569ab338048`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/08569ab338048) -
8
+ Removed feature gates for cleanup
9
+
3
10
  ## 5.3.2
4
11
 
5
12
  ### Patch Changes
@@ -29,7 +29,7 @@ var fetchProviderStates = /*#__PURE__*/function () {
29
29
  return _regenerator.default.wrap(function _callee$(_context) {
30
30
  while (1) switch (_context.prev = _context.next) {
31
31
  case 0:
32
- if (!((!provider || !provider.getState) && (0, _platformFeatureFlags.fg)('use_comments_data_annotation_updater'))) {
32
+ if (!(!provider || !provider.getState)) {
33
33
  _context.next = 2;
34
34
  break;
35
35
  }
@@ -65,26 +65,20 @@ var fetchState = /*#__PURE__*/function () {
65
65
  return _regenerator.default.wrap(function _callee2$(_context2) {
66
66
  while (1) switch (_context2.prev = _context2.next) {
67
67
  case 0:
68
- if (!((!annotationIds || !annotationIds.length) && !(0, _platformFeatureFlags.fg)('use_comments_data_annotation_updater'))) {
69
- _context2.next = 2;
70
- break;
71
- }
72
- return _context2.abrupt("return");
73
- case 2:
74
- _context2.next = 4;
68
+ _context2.next = 2;
75
69
  return fetchProviderStates(provider, annotationIds);
76
- case 4:
70
+ case 2:
77
71
  inlineCommentStates = _context2.sent;
78
- if (!(Object.keys(inlineCommentStates).length === 0 && (0, _platformFeatureFlags.fg)('use_comments_data_annotation_updater'))) {
79
- _context2.next = 7;
72
+ if (!(Object.keys(inlineCommentStates).length === 0)) {
73
+ _context2.next = 5;
80
74
  break;
81
75
  }
82
76
  return _context2.abrupt("return");
83
- case 7:
77
+ case 5:
84
78
  if (editorView.dispatch) {
85
79
  (0, _editorCommands.updateInlineCommentResolvedState)(editorAnalyticsAPI)(inlineCommentStates)(editorView.state, editorView.dispatch);
86
80
  }
87
- case 8:
81
+ case 6:
88
82
  case "end":
89
83
  return _context2.stop();
90
84
  }
@@ -214,24 +208,10 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
214
208
  return onSetVisibility(editorView)(isVisible);
215
209
  };
216
210
  var setSelectedAnnotationFn = function setSelectedAnnotationFn(annotationId) {
217
- var pluginState = (0, _utils3.getPluginState)(editorView.state);
218
- if ((0, _platformFeatureFlags.fg)('platform_editor_listen_for_focussed_query_param')) {
219
- // When feature flag is true, only close if no annotationId
220
- if (!annotationId) {
221
- (0, _editorCommands.closeComponent)()(editorView.state, editorView.dispatch);
222
- } else {
223
- (0, _editorCommands.setSelectedAnnotation)(annotationId)(editorView.state, editorView.dispatch);
224
- }
211
+ if (!annotationId) {
212
+ (0, _editorCommands.closeComponent)()(editorView.state, editorView.dispatch);
225
213
  } else {
226
- // When feature flag is false, close if:
227
- // 1. No annotationId OR
228
- // 2. View is closed and annotation clicks are enabled
229
- var shouldClose = !annotationId || (pluginState === null || pluginState === void 0 ? void 0 : pluginState.isInlineCommentViewClosed) && (0, _platformFeatureFlags.fg)('platform_editor_listen_for_annotation_clicks');
230
- if (shouldClose) {
231
- (0, _editorCommands.closeComponent)()(editorView.state, editorView.dispatch);
232
- } else {
233
- (0, _editorCommands.setSelectedAnnotation)(annotationId)(editorView.state, editorView.dispatch);
234
- }
214
+ (0, _editorCommands.setSelectedAnnotation)(annotationId)(editorView.state, editorView.dispatch);
235
215
  }
236
216
  };
237
217
  var setHoveredAnnotationFn = function setHoveredAnnotationFn(annotationId) {
@@ -280,15 +260,13 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
280
260
  selectedAnnotationId && selectedAnnotationId !== (prevSelectedAnnotations === null || prevSelectedAnnotations === void 0 || (_prevSelectedAnnotati = prevSelectedAnnotations[0]) === null || _prevSelectedAnnotati === void 0 ? void 0 : _prevSelectedAnnotati.id) &&
281
261
  // This ensures that the selected annotation is unresolved
282
262
  annotations && annotations[selectedAnnotationId] === false) {
283
- var _options$selectCommen;
263
+ var _options$selectCommen, _options$viewInlineCo;
284
264
  // ...we mark the select annotation experience as complete.
285
265
  // The selectComponentExperience is using a simplified object, which is why it's type asserted.
286
266
  (_options$selectCommen = options.selectCommentExperience) === null || _options$selectCommen === void 0 || _options$selectCommen.selectAnnotation.complete(selectedAnnotationId);
287
- if ((0, _platformFeatureFlags.fg)('cc_comments_track_view_inline_comment_action')) {
288
- var _options$viewInlineCo;
289
- // ...and start a new UFO press trace since the selected comment is changing
290
- (_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
291
- }
267
+
268
+ // ...and start a new UFO press trace since the selected comment is changing
269
+ (_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
292
270
  }
293
271
  var api = options.api;
294
272
  if (isDrafting && !view.state.selection.eq(_prevState.selection) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
@@ -14,7 +14,7 @@ import { createPluginState } from './plugin-factory';
14
14
  import { shouldSuppressFloatingToolbar } from './toolbar';
15
15
  import { decorationKey, getAllAnnotations, getPluginState, inlineCommentPluginKey } from './utils';
16
16
  const fetchProviderStates = async (provider, annotationIds) => {
17
- if ((!provider || !provider.getState) && fg('use_comments_data_annotation_updater')) {
17
+ if (!provider || !provider.getState) {
18
18
  return {};
19
19
  }
20
20
  const data = await provider.getState(annotationIds);
@@ -30,11 +30,8 @@ const fetchProviderStates = async (provider, annotationIds) => {
30
30
  // fetchState is unable to return a command as it's runs async and may dispatch at a later time
31
31
  // Requires `editorView` instead of the decomposition as the async means state may end up stale
32
32
  const fetchState = async (provider, annotationIds, editorView, editorAnalyticsAPI) => {
33
- if ((!annotationIds || !annotationIds.length) && !fg('use_comments_data_annotation_updater')) {
34
- return;
35
- }
36
33
  const inlineCommentStates = await fetchProviderStates(provider, annotationIds);
37
- if (Object.keys(inlineCommentStates).length === 0 && fg('use_comments_data_annotation_updater')) {
34
+ if (Object.keys(inlineCommentStates).length === 0) {
38
35
  return;
39
36
  }
40
37
  if (editorView.dispatch) {
@@ -145,24 +142,10 @@ export const inlineCommentPlugin = options => {
145
142
  const mouseUp = event => onMouseUp(editorView.state, editorView.dispatch)(event);
146
143
  const setVisibility = isVisible => onSetVisibility(editorView)(isVisible);
147
144
  const setSelectedAnnotationFn = annotationId => {
148
- const pluginState = getPluginState(editorView.state);
149
- if (fg('platform_editor_listen_for_focussed_query_param')) {
150
- // When feature flag is true, only close if no annotationId
151
- if (!annotationId) {
152
- closeComponent()(editorView.state, editorView.dispatch);
153
- } else {
154
- setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
155
- }
145
+ if (!annotationId) {
146
+ closeComponent()(editorView.state, editorView.dispatch);
156
147
  } else {
157
- // When feature flag is false, close if:
158
- // 1. No annotationId OR
159
- // 2. View is closed and annotation clicks are enabled
160
- const shouldClose = !annotationId || (pluginState === null || pluginState === void 0 ? void 0 : pluginState.isInlineCommentViewClosed) && fg('platform_editor_listen_for_annotation_clicks');
161
- if (shouldClose) {
162
- closeComponent()(editorView.state, editorView.dispatch);
163
- } else {
164
- setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
165
- }
148
+ setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
166
149
  }
167
150
  };
168
151
  const setHoveredAnnotationFn = annotationId => {
@@ -215,15 +198,13 @@ export const inlineCommentPlugin = options => {
215
198
  selectedAnnotationId && selectedAnnotationId !== (prevSelectedAnnotations === null || prevSelectedAnnotations === void 0 ? void 0 : (_prevSelectedAnnotati = prevSelectedAnnotations[0]) === null || _prevSelectedAnnotati === void 0 ? void 0 : _prevSelectedAnnotati.id) &&
216
199
  // This ensures that the selected annotation is unresolved
217
200
  annotations && annotations[selectedAnnotationId] === false) {
218
- var _options$selectCommen;
201
+ var _options$selectCommen, _options$viewInlineCo;
219
202
  // ...we mark the select annotation experience as complete.
220
203
  // The selectComponentExperience is using a simplified object, which is why it's type asserted.
221
204
  (_options$selectCommen = options.selectCommentExperience) === null || _options$selectCommen === void 0 ? void 0 : _options$selectCommen.selectAnnotation.complete(selectedAnnotationId);
222
- if (fg('cc_comments_track_view_inline_comment_action')) {
223
- var _options$viewInlineCo;
224
- // ...and start a new UFO press trace since the selected comment is changing
225
- (_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 ? void 0 : _options$viewInlineCo.call(options);
226
- }
205
+
206
+ // ...and start a new UFO press trace since the selected comment is changing
207
+ (_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 ? void 0 : _options$viewInlineCo.call(options);
227
208
  }
228
209
  const {
229
210
  api
@@ -22,7 +22,7 @@ var fetchProviderStates = /*#__PURE__*/function () {
22
22
  return _regeneratorRuntime.wrap(function _callee$(_context) {
23
23
  while (1) switch (_context.prev = _context.next) {
24
24
  case 0:
25
- if (!((!provider || !provider.getState) && fg('use_comments_data_annotation_updater'))) {
25
+ if (!(!provider || !provider.getState)) {
26
26
  _context.next = 2;
27
27
  break;
28
28
  }
@@ -58,26 +58,20 @@ var fetchState = /*#__PURE__*/function () {
58
58
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
59
59
  while (1) switch (_context2.prev = _context2.next) {
60
60
  case 0:
61
- if (!((!annotationIds || !annotationIds.length) && !fg('use_comments_data_annotation_updater'))) {
62
- _context2.next = 2;
63
- break;
64
- }
65
- return _context2.abrupt("return");
66
- case 2:
67
- _context2.next = 4;
61
+ _context2.next = 2;
68
62
  return fetchProviderStates(provider, annotationIds);
69
- case 4:
63
+ case 2:
70
64
  inlineCommentStates = _context2.sent;
71
- if (!(Object.keys(inlineCommentStates).length === 0 && fg('use_comments_data_annotation_updater'))) {
72
- _context2.next = 7;
65
+ if (!(Object.keys(inlineCommentStates).length === 0)) {
66
+ _context2.next = 5;
73
67
  break;
74
68
  }
75
69
  return _context2.abrupt("return");
76
- case 7:
70
+ case 5:
77
71
  if (editorView.dispatch) {
78
72
  updateInlineCommentResolvedState(editorAnalyticsAPI)(inlineCommentStates)(editorView.state, editorView.dispatch);
79
73
  }
80
- case 8:
74
+ case 6:
81
75
  case "end":
82
76
  return _context2.stop();
83
77
  }
@@ -207,24 +201,10 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
207
201
  return onSetVisibility(editorView)(isVisible);
208
202
  };
209
203
  var setSelectedAnnotationFn = function setSelectedAnnotationFn(annotationId) {
210
- var pluginState = getPluginState(editorView.state);
211
- if (fg('platform_editor_listen_for_focussed_query_param')) {
212
- // When feature flag is true, only close if no annotationId
213
- if (!annotationId) {
214
- closeComponent()(editorView.state, editorView.dispatch);
215
- } else {
216
- setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
217
- }
204
+ if (!annotationId) {
205
+ closeComponent()(editorView.state, editorView.dispatch);
218
206
  } else {
219
- // When feature flag is false, close if:
220
- // 1. No annotationId OR
221
- // 2. View is closed and annotation clicks are enabled
222
- var shouldClose = !annotationId || (pluginState === null || pluginState === void 0 ? void 0 : pluginState.isInlineCommentViewClosed) && fg('platform_editor_listen_for_annotation_clicks');
223
- if (shouldClose) {
224
- closeComponent()(editorView.state, editorView.dispatch);
225
- } else {
226
- setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
227
- }
207
+ setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
228
208
  }
229
209
  };
230
210
  var setHoveredAnnotationFn = function setHoveredAnnotationFn(annotationId) {
@@ -273,15 +253,13 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
273
253
  selectedAnnotationId && selectedAnnotationId !== (prevSelectedAnnotations === null || prevSelectedAnnotations === void 0 || (_prevSelectedAnnotati = prevSelectedAnnotations[0]) === null || _prevSelectedAnnotati === void 0 ? void 0 : _prevSelectedAnnotati.id) &&
274
254
  // This ensures that the selected annotation is unresolved
275
255
  annotations && annotations[selectedAnnotationId] === false) {
276
- var _options$selectCommen;
256
+ var _options$selectCommen, _options$viewInlineCo;
277
257
  // ...we mark the select annotation experience as complete.
278
258
  // The selectComponentExperience is using a simplified object, which is why it's type asserted.
279
259
  (_options$selectCommen = options.selectCommentExperience) === null || _options$selectCommen === void 0 || _options$selectCommen.selectAnnotation.complete(selectedAnnotationId);
280
- if (fg('cc_comments_track_view_inline_comment_action')) {
281
- var _options$viewInlineCo;
282
- // ...and start a new UFO press trace since the selected comment is changing
283
- (_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
284
- }
260
+
261
+ // ...and start a new UFO press trace since the selected comment is changing
262
+ (_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
285
263
  }
286
264
  var api = options.api;
287
265
  if (isDrafting && !view.state.selection.eq(_prevState.selection) && editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "5.3.2",
3
+ "version": "5.4.0",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,15 +38,15 @@
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/editor-toolbar": "^0.9.0",
40
40
  "@atlaskit/editor-toolbar-model": "^0.2.0",
41
- "@atlaskit/icon": "^28.1.0",
41
+ "@atlaskit/icon": "^28.2.0",
42
42
  "@atlaskit/onboarding": "^14.4.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^12.21.0",
44
+ "@atlaskit/tmp-editor-statsig": "^12.27.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "react-intl-next": "npm:react-intl@^5.18.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^109.6.0",
49
+ "@atlaskit/editor-common": "^109.11.0",
50
50
  "react": "^18.2.0",
51
51
  "react-dom": "^18.2.0"
52
52
  },
@@ -100,21 +100,12 @@
100
100
  "editor_inline_comments_on_inline_nodes": {
101
101
  "type": "boolean"
102
102
  },
103
- "use_comments_data_annotation_updater": {
104
- "type": "boolean"
105
- },
106
103
  "platform_editor_listen_for_annotation_clicks": {
107
104
  "type": "boolean"
108
105
  },
109
106
  "platform_editor_annotation_selected_annotation": {
110
107
  "type": "boolean"
111
108
  },
112
- "platform_editor_listen_for_focussed_query_param": {
113
- "type": "boolean"
114
- },
115
- "cc_comments_track_view_inline_comment_action": {
116
- "type": "boolean"
117
- },
118
109
  "confluence_frontend_preload_inline_comment_editor": {
119
110
  "type": "boolean"
120
111
  },