@atlaskit/editor-plugin-annotation 6.1.5 → 6.1.7

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-plugin-annotation
2
2
 
3
+ ## 6.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d334d3aa69554`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d334d3aa69554) -
8
+ Fix comment sidebar re-opening
9
+
10
+ ## 6.1.6
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 6.1.5
4
17
 
5
18
  ### Patch Changes
@@ -14,6 +14,7 @@ var _hooks = require("@atlaskit/editor-common/hooks");
14
14
  var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
15
15
  var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
19
  var _editorCommands = require("../editor-commands");
19
20
  var _utils3 = require("../pm-plugins/utils");
@@ -49,6 +50,7 @@ var selector = function selector(states) {
49
50
  };
50
51
  };
51
52
  function InlineCommentView(_ref) {
53
+ var _getPluginState;
52
54
  var providers = _ref.providers,
53
55
  editorView = _ref.editorView,
54
56
  editorAnalyticsAPI = _ref.editorAnalyticsAPI,
@@ -63,12 +65,13 @@ function InlineCommentView(_ref) {
63
65
  ViewComponent = inlineCommentProvider.viewComponent;
64
66
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(editorAPI, ['annotation'], selector),
65
67
  annotations = _useSharedPluginState.annotations,
66
- bookmark = _useSharedPluginState.bookmark,
68
+ _bookmark = _useSharedPluginState.bookmark,
67
69
  isInlineCommentViewClosed = _useSharedPluginState.isInlineCommentViewClosed,
68
70
  isOpeningMediaCommentFromToolbar = _useSharedPluginState.isOpeningMediaCommentFromToolbar,
69
71
  selectAnnotationMethod = _useSharedPluginState.selectAnnotationMethod,
70
72
  selectedAnnotations = _useSharedPluginState.selectedAnnotations,
71
73
  isAnnotationManagerEnabled = _useSharedPluginState.isAnnotationManagerEnabled;
74
+ var bookmark = (0, _platformFeatureFlags.fg)('platform_editor_fix_inline_comment_reopen') ? (_getPluginState = (0, _utils3.getPluginState)(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.bookmark : _bookmark;
72
75
  var annotationsList = (0, _utils3.getAllAnnotations)(editorView.state.doc);
73
76
  var selection = (0, _utils3.getSelectionPositions)(state, bookmark);
74
77
  var position = findPosForDOM(selection);
@@ -5,9 +5,10 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
5
5
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
6
6
  import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
7
7
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
10
  import { closeComponent, createAnnotation, removeInlineCommentNearSelection, setInlineCommentDraftState, updateInlineCommentResolvedState } from '../editor-commands';
10
- import { getAllAnnotations, getAnnotationViewKey, getSelectionPositions } from '../pm-plugins/utils';
11
+ import { getAllAnnotations, getAnnotationViewKey, getPluginState, getSelectionPositions } from '../pm-plugins/utils';
11
12
  import { AnnotationTestIds } from '../types';
12
13
  import { AnnotationViewWrapper } from './AnnotationViewWrapper';
13
14
  const findPosForDOM = sel => {
@@ -45,6 +46,7 @@ export function InlineCommentView({
45
46
  editorAPI,
46
47
  dispatchAnalyticsEvent
47
48
  }) {
49
+ var _getPluginState;
48
50
  // As inlineComment is the only annotation present, this function is not generic
49
51
  const {
50
52
  inlineComment: inlineCommentProvider
@@ -60,13 +62,14 @@ export function InlineCommentView({
60
62
  } = inlineCommentProvider;
61
63
  const {
62
64
  annotations,
63
- bookmark,
65
+ bookmark: _bookmark,
64
66
  isInlineCommentViewClosed,
65
67
  isOpeningMediaCommentFromToolbar,
66
68
  selectAnnotationMethod,
67
69
  selectedAnnotations,
68
70
  isAnnotationManagerEnabled
69
71
  } = useSharedPluginStateWithSelector(editorAPI, ['annotation'], selector);
72
+ const bookmark = fg('platform_editor_fix_inline_comment_reopen') ? (_getPluginState = getPluginState(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.bookmark : _bookmark;
70
73
  const annotationsList = getAllAnnotations(editorView.state.doc);
71
74
  const selection = getSelectionPositions(state, bookmark);
72
75
  const position = findPosForDOM(selection);
@@ -6,9 +6,10 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
6
6
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
7
7
  import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
8
8
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
11
  import { closeComponent, createAnnotation, removeInlineCommentNearSelection, setInlineCommentDraftState, updateInlineCommentResolvedState } from '../editor-commands';
11
- import { getAllAnnotations, getAnnotationViewKey, getSelectionPositions } from '../pm-plugins/utils';
12
+ import { getAllAnnotations, getAnnotationViewKey, getPluginState, getSelectionPositions } from '../pm-plugins/utils';
12
13
  import { AnnotationTestIds } from '../types';
13
14
  import { AnnotationViewWrapper } from './AnnotationViewWrapper';
14
15
  var findPosForDOM = function findPosForDOM(sel) {
@@ -40,6 +41,7 @@ var selector = function selector(states) {
40
41
  };
41
42
  };
42
43
  export function InlineCommentView(_ref) {
44
+ var _getPluginState;
43
45
  var providers = _ref.providers,
44
46
  editorView = _ref.editorView,
45
47
  editorAnalyticsAPI = _ref.editorAnalyticsAPI,
@@ -54,12 +56,13 @@ export function InlineCommentView(_ref) {
54
56
  ViewComponent = inlineCommentProvider.viewComponent;
55
57
  var _useSharedPluginState = useSharedPluginStateWithSelector(editorAPI, ['annotation'], selector),
56
58
  annotations = _useSharedPluginState.annotations,
57
- bookmark = _useSharedPluginState.bookmark,
59
+ _bookmark = _useSharedPluginState.bookmark,
58
60
  isInlineCommentViewClosed = _useSharedPluginState.isInlineCommentViewClosed,
59
61
  isOpeningMediaCommentFromToolbar = _useSharedPluginState.isOpeningMediaCommentFromToolbar,
60
62
  selectAnnotationMethod = _useSharedPluginState.selectAnnotationMethod,
61
63
  selectedAnnotations = _useSharedPluginState.selectedAnnotations,
62
64
  isAnnotationManagerEnabled = _useSharedPluginState.isAnnotationManagerEnabled;
65
+ var bookmark = fg('platform_editor_fix_inline_comment_reopen') ? (_getPluginState = getPluginState(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.bookmark : _bookmark;
63
66
  var annotationsList = getAllAnnotations(editorView.state.doc);
64
67
  var selection = getSelectionPositions(state, bookmark);
65
68
  var position = findPosForDOM(selection);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "6.1.5",
3
+ "version": "6.1.7",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,17 +36,17 @@
36
36
  "@atlaskit/editor-plugin-toolbar": "^3.1.0",
37
37
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
- "@atlaskit/editor-toolbar": "^0.13.0",
39
+ "@atlaskit/editor-toolbar": "^0.14.0",
40
40
  "@atlaskit/editor-toolbar-model": "^0.2.0",
41
- "@atlaskit/icon": "^28.4.0",
41
+ "@atlaskit/icon": "^28.5.0",
42
42
  "@atlaskit/onboarding": "^14.4.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^13.2.0",
44
+ "@atlaskit/tmp-editor-statsig": "^13.5.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": "^110.4.0",
49
+ "@atlaskit/editor-common": "^110.8.0",
50
50
  "react": "^18.2.0",
51
51
  "react-dom": "^18.2.0"
52
52
  },
@@ -109,6 +109,9 @@
109
109
  "confluence_frontend_preload_inline_comment_editor": {
110
110
  "type": "boolean"
111
111
  },
112
+ "platform_editor_fix_inline_comment_reopen": {
113
+ "type": "boolean"
114
+ },
112
115
  "confluence_frontend_new_dangling_comments_ux": {
113
116
  "type": "boolean"
114
117
  }