@atlaskit/editor-plugin-annotation 2.9.4 → 2.9.5

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/editor-plugin-annotation
2
2
 
3
+ ## 2.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#165439](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/165439)
8
+ [`1b15e228a1e86`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1b15e228a1e86) -
9
+ Fixed an issue which meant the new annotation manager still realied on a FG to be enabled when in
10
+ fact it should be enabled if an instance of the manager is supplied. Thie removed all dependencies
11
+ relying on the FG.
12
+
3
13
  ## 2.9.4
4
14
 
5
15
  ### Patch Changes
@@ -51,13 +51,15 @@ var useInlineCommentViewPluginState = (0, _hooks.sharedPluginStateHookMigratorFa
51
51
  var isOpeningMediaCommentFromToolbar = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'annotation.isOpeningMediaCommentFromToolbar');
52
52
  // eslint-disable-next-line react-hooks/rules-of-hooks
53
53
  var selectAnnotationMethod = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'annotation.selectAnnotationMethod');
54
+ var isAnnotationManagerEnabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'annotation.isAnnotationManagerEnabled');
54
55
  return {
55
56
  bookmark: bookmark,
56
57
  selectedAnnotations: selectedAnnotations,
57
58
  annotations: annotations,
58
59
  isInlineCommentViewClosed: isInlineCommentViewClosed,
59
60
  isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
60
- selectAnnotationMethod: selectAnnotationMethod
61
+ selectAnnotationMethod: selectAnnotationMethod,
62
+ isAnnotationManagerEnabled: isAnnotationManagerEnabled
61
63
  };
62
64
  }, function (_ref2) {
63
65
  var state = _ref2.state;
@@ -68,7 +70,8 @@ var useInlineCommentViewPluginState = (0, _hooks.sharedPluginStateHookMigratorFa
68
70
  annotations: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.annotations,
69
71
  isInlineCommentViewClosed: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isInlineCommentViewClosed,
70
72
  isOpeningMediaCommentFromToolbar: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isOpeningMediaCommentFromToolbar,
71
- selectAnnotationMethod: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.selectAnnotationMethod
73
+ selectAnnotationMethod: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.selectAnnotationMethod,
74
+ isAnnotationManagerEnabled: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isAnnotationManagerEnabled
72
75
  };
73
76
  });
74
77
  function InlineCommentView(_ref3) {
@@ -93,7 +96,8 @@ function InlineCommentView(_ref3) {
93
96
  isInlineCommentViewClosed = _useInlineCommentView.isInlineCommentViewClosed,
94
97
  isOpeningMediaCommentFromToolbar = _useInlineCommentView.isOpeningMediaCommentFromToolbar,
95
98
  selectAnnotationMethod = _useInlineCommentView.selectAnnotationMethod,
96
- selectedAnnotations = _useInlineCommentView.selectedAnnotations;
99
+ selectedAnnotations = _useInlineCommentView.selectedAnnotations,
100
+ isAnnotationManagerEnabled = _useInlineCommentView.isAnnotationManagerEnabled;
97
101
  var annotationsList = (0, _utils3.getAllAnnotations)(editorView.state.doc);
98
102
  var selection = (0, _utils3.getSelectionPositions)(state, {
99
103
  bookmark: bookmark
@@ -160,7 +164,7 @@ function InlineCommentView(_ref3) {
160
164
  textSelection: textSelection,
161
165
  wasNewAnnotationSelected: !!currentlySelectedAnnotation && isAnnotationSelectionChanged,
162
166
  onCreate: function onCreate(id) {
163
- if (!(0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
167
+ if (!isAnnotationManagerEnabled) {
164
168
  var createAnnotationResult = (0, _editorCommands.createAnnotation)(editorAnalyticsAPI, editorAPI)(id, _adfSchema.AnnotationTypes.INLINE_COMMENT, inlineCommentProvider.supportedBlockNodes)(editorView.state, editorView.dispatch);
165
169
  !editorView.hasFocus() && editorView.focus();
166
170
  if (!createAnnotationResult && (0, _platformFeatureFlags.fg)('confluence_frontend_handle_annotation_error')) {
@@ -169,7 +173,7 @@ function InlineCommentView(_ref3) {
169
173
  }
170
174
  },
171
175
  onClose: function onClose() {
172
- if (!(0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
176
+ if (!isAnnotationManagerEnabled) {
173
177
  (0, _editorCommands.setInlineCommentDraftState)(editorAnalyticsAPI)(false)(editorView.state, editorView.dispatch);
174
178
  !editorView.hasFocus() && editorView.focus();
175
179
  }
@@ -42,13 +42,15 @@ const useInlineCommentViewPluginState = sharedPluginStateHookMigratorFactory(({
42
42
  const isOpeningMediaCommentFromToolbar = useSharedPluginStateSelector(api, 'annotation.isOpeningMediaCommentFromToolbar');
43
43
  // eslint-disable-next-line react-hooks/rules-of-hooks
44
44
  const selectAnnotationMethod = useSharedPluginStateSelector(api, 'annotation.selectAnnotationMethod');
45
+ const isAnnotationManagerEnabled = useSharedPluginStateSelector(api, 'annotation.isAnnotationManagerEnabled');
45
46
  return {
46
47
  bookmark,
47
48
  selectedAnnotations,
48
49
  annotations,
49
50
  isInlineCommentViewClosed,
50
51
  isOpeningMediaCommentFromToolbar,
51
- selectAnnotationMethod
52
+ selectAnnotationMethod,
53
+ isAnnotationManagerEnabled
52
54
  };
53
55
  }, ({
54
56
  state
@@ -60,7 +62,8 @@ const useInlineCommentViewPluginState = sharedPluginStateHookMigratorFactory(({
60
62
  annotations: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.annotations,
61
63
  isInlineCommentViewClosed: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isInlineCommentViewClosed,
62
64
  isOpeningMediaCommentFromToolbar: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isOpeningMediaCommentFromToolbar,
63
- selectAnnotationMethod: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.selectAnnotationMethod
65
+ selectAnnotationMethod: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.selectAnnotationMethod,
66
+ isAnnotationManagerEnabled: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isAnnotationManagerEnabled
64
67
  };
65
68
  });
66
69
  export function InlineCommentView({
@@ -89,7 +92,8 @@ export function InlineCommentView({
89
92
  isInlineCommentViewClosed,
90
93
  isOpeningMediaCommentFromToolbar,
91
94
  selectAnnotationMethod,
92
- selectedAnnotations
95
+ selectedAnnotations,
96
+ isAnnotationManagerEnabled
93
97
  } = useInlineCommentViewPluginState({
94
98
  api: editorAPI,
95
99
  state
@@ -160,7 +164,7 @@ export function InlineCommentView({
160
164
  textSelection: textSelection,
161
165
  wasNewAnnotationSelected: !!currentlySelectedAnnotation && isAnnotationSelectionChanged,
162
166
  onCreate: id => {
163
- if (!fg('platform_editor_comments_api_manager')) {
167
+ if (!isAnnotationManagerEnabled) {
164
168
  const createAnnotationResult = createAnnotation(editorAnalyticsAPI, editorAPI)(id, AnnotationTypes.INLINE_COMMENT, inlineCommentProvider.supportedBlockNodes)(editorView.state, editorView.dispatch);
165
169
  !editorView.hasFocus() && editorView.focus();
166
170
  if (!createAnnotationResult && fg('confluence_frontend_handle_annotation_error')) {
@@ -169,7 +173,7 @@ export function InlineCommentView({
169
173
  }
170
174
  },
171
175
  onClose: () => {
172
- if (!fg('platform_editor_comments_api_manager')) {
176
+ if (!isAnnotationManagerEnabled) {
173
177
  setInlineCommentDraftState(editorAnalyticsAPI)(false)(editorView.state, editorView.dispatch);
174
178
  !editorView.hasFocus() && editorView.focus();
175
179
  }
@@ -42,13 +42,15 @@ var useInlineCommentViewPluginState = sharedPluginStateHookMigratorFactory(funct
42
42
  var isOpeningMediaCommentFromToolbar = useSharedPluginStateSelector(api, 'annotation.isOpeningMediaCommentFromToolbar');
43
43
  // eslint-disable-next-line react-hooks/rules-of-hooks
44
44
  var selectAnnotationMethod = useSharedPluginStateSelector(api, 'annotation.selectAnnotationMethod');
45
+ var isAnnotationManagerEnabled = useSharedPluginStateSelector(api, 'annotation.isAnnotationManagerEnabled');
45
46
  return {
46
47
  bookmark: bookmark,
47
48
  selectedAnnotations: selectedAnnotations,
48
49
  annotations: annotations,
49
50
  isInlineCommentViewClosed: isInlineCommentViewClosed,
50
51
  isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
51
- selectAnnotationMethod: selectAnnotationMethod
52
+ selectAnnotationMethod: selectAnnotationMethod,
53
+ isAnnotationManagerEnabled: isAnnotationManagerEnabled
52
54
  };
53
55
  }, function (_ref2) {
54
56
  var state = _ref2.state;
@@ -59,7 +61,8 @@ var useInlineCommentViewPluginState = sharedPluginStateHookMigratorFactory(funct
59
61
  annotations: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.annotations,
60
62
  isInlineCommentViewClosed: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isInlineCommentViewClosed,
61
63
  isOpeningMediaCommentFromToolbar: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isOpeningMediaCommentFromToolbar,
62
- selectAnnotationMethod: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.selectAnnotationMethod
64
+ selectAnnotationMethod: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.selectAnnotationMethod,
65
+ isAnnotationManagerEnabled: inlineCommentState === null || inlineCommentState === void 0 ? void 0 : inlineCommentState.isAnnotationManagerEnabled
63
66
  };
64
67
  });
65
68
  export function InlineCommentView(_ref3) {
@@ -84,7 +87,8 @@ export function InlineCommentView(_ref3) {
84
87
  isInlineCommentViewClosed = _useInlineCommentView.isInlineCommentViewClosed,
85
88
  isOpeningMediaCommentFromToolbar = _useInlineCommentView.isOpeningMediaCommentFromToolbar,
86
89
  selectAnnotationMethod = _useInlineCommentView.selectAnnotationMethod,
87
- selectedAnnotations = _useInlineCommentView.selectedAnnotations;
90
+ selectedAnnotations = _useInlineCommentView.selectedAnnotations,
91
+ isAnnotationManagerEnabled = _useInlineCommentView.isAnnotationManagerEnabled;
88
92
  var annotationsList = getAllAnnotations(editorView.state.doc);
89
93
  var selection = getSelectionPositions(state, {
90
94
  bookmark: bookmark
@@ -151,7 +155,7 @@ export function InlineCommentView(_ref3) {
151
155
  textSelection: textSelection,
152
156
  wasNewAnnotationSelected: !!currentlySelectedAnnotation && isAnnotationSelectionChanged,
153
157
  onCreate: function onCreate(id) {
154
- if (!fg('platform_editor_comments_api_manager')) {
158
+ if (!isAnnotationManagerEnabled) {
155
159
  var createAnnotationResult = createAnnotation(editorAnalyticsAPI, editorAPI)(id, AnnotationTypes.INLINE_COMMENT, inlineCommentProvider.supportedBlockNodes)(editorView.state, editorView.dispatch);
156
160
  !editorView.hasFocus() && editorView.focus();
157
161
  if (!createAnnotationResult && fg('confluence_frontend_handle_annotation_error')) {
@@ -160,7 +164,7 @@ export function InlineCommentView(_ref3) {
160
164
  }
161
165
  },
162
166
  onClose: function onClose() {
163
- if (!fg('platform_editor_comments_api_manager')) {
167
+ if (!isAnnotationManagerEnabled) {
164
168
  setInlineCommentDraftState(editorAnalyticsAPI)(false)(editorView.state, editorView.dispatch);
165
169
  !editorView.hasFocus() && editorView.focus();
166
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "2.9.4",
3
+ "version": "2.9.5",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/icon": "^26.4.0",
43
43
  "@atlaskit/onboarding": "^14.2.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
- "@atlaskit/tmp-editor-statsig": "^5.8.0",
45
+ "@atlaskit/tmp-editor-statsig": "^5.10.0",
46
46
  "@babel/runtime": "^7.0.0"
47
47
  },
48
48
  "peerDependencies": {
@@ -95,7 +95,8 @@
95
95
  },
96
96
  "platform-feature-flags": {
97
97
  "platform_editor_comments_api_manager": {
98
- "type": "boolean"
98
+ "type": "boolean",
99
+ "referenceOnly": true
99
100
  },
100
101
  "editor_inline_comments_on_inline_nodes": {
101
102
  "type": "boolean"