@atlaskit/editor-core 188.10.0 → 188.10.2

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/plugins/annotation/commands/index.js +2 -5
  3. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  4. package/dist/cjs/plugins/annotation/pm-plugins/reducer.js +2 -4
  5. package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +3 -6
  6. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +6 -8
  7. package/dist/cjs/utils/commands.js +1 -0
  8. package/dist/cjs/version-wrapper.js +1 -1
  9. package/dist/es2019/plugins/annotation/commands/index.js +2 -5
  10. package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  11. package/dist/es2019/plugins/annotation/pm-plugins/reducer.js +2 -4
  12. package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +3 -6
  13. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +6 -8
  14. package/dist/es2019/utils/commands.js +1 -0
  15. package/dist/es2019/version-wrapper.js +1 -1
  16. package/dist/esm/plugins/annotation/commands/index.js +2 -5
  17. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
  18. package/dist/esm/plugins/annotation/pm-plugins/reducer.js +2 -4
  19. package/dist/esm/plugins/annotation/ui/InlineCommentView.js +3 -6
  20. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +6 -8
  21. package/dist/esm/utils/commands.js +1 -0
  22. package/dist/esm/version-wrapper.js +1 -1
  23. package/dist/types/plugins/annotation/commands/index.d.ts +1 -2
  24. package/dist/types/plugins/annotation/pm-plugins/types.d.ts +0 -4
  25. package/dist/types/utils/commands.d.ts +1 -0
  26. package/dist/types-ts4.5/plugins/annotation/commands/index.d.ts +1 -2
  27. package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +0 -4
  28. package/dist/types-ts4.5/utils/commands.d.ts +1 -0
  29. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 188.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#40384](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40384) [`1ed4227201a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1ed4227201a) - [ux] ED-19206 Fixing the issue of color Selection from toolbar doesn't refocus to editor
8
+ - Updated dependencies
9
+
10
+ ## 188.10.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [#40950](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40950) [`6fa1988ec35`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6fa1988ec35) - clean up FF for enabling fallback to reconcile
15
+ - [#40056](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40056) [`1a189e4493d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1a189e4493d) - [ux] COMMENTS-481: reverted changes from ED-19508
16
+
3
17
  ## 188.10.0
4
18
 
5
19
  ### Minor Changes
@@ -26,12 +26,9 @@ var updateInlineCommentResolvedState = exports.updateInlineCommentResolvedState
26
26
  }
27
27
  return (0, _pluginFactory.createCommand)(command);
28
28
  };
29
- var closeComponent = exports.closeComponent = function closeComponent(state) {
29
+ var closeComponent = exports.closeComponent = function closeComponent() {
30
30
  return (0, _pluginFactory.createCommand)({
31
- type: _types.ACTIONS.CLOSE_COMPONENT,
32
- data: {
33
- lastClosedPos: state.selection.$head.pos
34
- }
31
+ type: _types.ACTIONS.CLOSE_COMPONENT
35
32
  });
36
33
  };
37
34
  var clearDirtyMark = exports.clearDirtyMark = function clearDirtyMark() {
@@ -156,7 +156,7 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
156
156
  };
157
157
  var setSelectedAnnotationFn = function setSelectedAnnotationFn(annotationId) {
158
158
  if (!annotationId) {
159
- (0, _commands.closeComponent)(editorView.state)(editorView.state, editorView.dispatch);
159
+ (0, _commands.closeComponent)()(editorView.state, editorView.dispatch);
160
160
  } else {
161
161
  (0, _commands.setSelectedAnnotation)(annotationId)(editorView.state, editorView.dispatch);
162
162
  }
@@ -21,8 +21,7 @@ var _default = exports.default = function _default(pluginState, action) {
21
21
  case _types.ACTIONS.INLINE_COMMENT_UPDATE_MOUSE_STATE:
22
22
  var mouseData = Object.assign({}, pluginState.mouseData, action.data.mouseData);
23
23
  return _objectSpread(_objectSpread({}, pluginState), {}, {
24
- mouseData: mouseData,
25
- lastClosedPos: undefined
24
+ mouseData: mouseData
26
25
  });
27
26
  case _types.ACTIONS.SET_INLINE_COMMENT_DRAFT_STATE:
28
27
  return getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
@@ -33,8 +32,7 @@ var _default = exports.default = function _default(pluginState, action) {
33
32
  });
34
33
  case _types.ACTIONS.CLOSE_COMPONENT:
35
34
  return _objectSpread(_objectSpread({}, pluginState), {}, {
36
- selectedAnnotations: [],
37
- lastClosedPos: action.data.lastClosedPos
35
+ selectedAnnotations: []
38
36
  });
39
37
  case _types.ACTIONS.ADD_INLINE_COMMENT:
40
38
  var updatedPluginState = getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
@@ -45,8 +45,7 @@ function InlineCommentView(_ref) {
45
45
  var _ref2 = inlineCommentState || {},
46
46
  bookmark = _ref2.bookmark,
47
47
  selectedAnnotations = _ref2.selectedAnnotations,
48
- annotations = _ref2.annotations,
49
- lastClosedPos = _ref2.lastClosedPos;
48
+ annotations = _ref2.annotations;
50
49
  var annotationsList = (0, _utils2.getAllAnnotations)(editorView.state.doc);
51
50
  var selection = (0, _utils2.getSelectionPositions)(state, inlineCommentState);
52
51
  var position = findPosForDOM(selection);
@@ -108,9 +107,7 @@ function InlineCommentView(_ref) {
108
107
  var activeAnnotations = (selectedAnnotations === null || selectedAnnotations === void 0 ? void 0 : selectedAnnotations.filter(function (mark) {
109
108
  return annotations && annotations[mark.id] === false;
110
109
  })) || [];
111
- if (!ViewComponent || activeAnnotations.length === 0 ||
112
- // Check if the user has moved the selection since closing the previous comment
113
- editorView.state.selection.$head.pos === lastClosedPos) {
110
+ if (!ViewComponent || activeAnnotations.length === 0) {
114
111
  return null;
115
112
  }
116
113
  var onAnnotationViewed = function onAnnotationViewed() {
@@ -148,7 +145,7 @@ function InlineCommentView(_ref) {
148
145
  return (0, _commands.updateInlineCommentResolvedState)((0, _defineProperty2.default)({}, id, true), _inlineCommentEvents.RESOLVE_METHOD.COMPONENT)(editorView.state, editorView.dispatch);
149
146
  },
150
147
  onClose: function onClose() {
151
- (0, _commands.closeComponent)(editorView.state)(editorView.state, editorView.dispatch);
148
+ (0, _commands.closeComponent)()(editorView.state, editorView.dispatch);
152
149
  }
153
150
  }));
154
151
  }
@@ -64,7 +64,6 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
64
64
  });
65
65
  });
66
66
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTextColor", function (color, editorAnalyticsApi, disabled) {
67
- var _this$toolbarItemRef;
68
67
  if (!disabled) {
69
68
  var _this$props$editorVie;
70
69
  var palette = _this.props.pluginState.palette;
@@ -84,7 +83,6 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
84
83
  //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
85
84
  (_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
86
85
  }
87
- (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
88
86
  return false;
89
87
  });
90
88
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
@@ -120,8 +118,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
120
118
  }));
121
119
  }
122
120
  if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
123
- var _this$toolbarItemRef2;
124
- (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
121
+ var _this$toolbarItemRef;
122
+ (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
125
123
  }
126
124
  });
127
125
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hide", function (e) {
@@ -134,15 +132,15 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
134
132
  isOpen: false
135
133
  });
136
134
  if (e instanceof KeyboardEvent && e.key === 'Escape') {
137
- var _this$toolbarItemRef3;
138
- (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
135
+ var _this$toolbarItemRef2;
136
+ (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
139
137
  }
140
138
  }
141
139
  });
142
140
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideonEsc", function (e) {
143
- var _this$toolbarItemRef4;
141
+ var _this$toolbarItemRef3;
144
142
  _this.hide(e);
145
- (_this$toolbarItemRef4 = _this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 || (_this$toolbarItemRef4 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef4 === void 0 || _this$toolbarItemRef4.focus();
143
+ (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
146
144
  });
147
145
  return _this;
148
146
  }
@@ -7,6 +7,7 @@ exports.withScrollIntoView = exports.isNthParentOfType = void 0;
7
7
  /**
8
8
  * Creates a filter that checks if the node at a given number of parents above the current
9
9
  * selection is of the correct node type.
10
+ *
10
11
  * @param nodeType The node type to compare the nth parent against
11
12
  * @param depthAway How many levels above the current node to check against. 0 refers to
12
13
  * the current selection's parent, which will be the containing node when the selection
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "188.10.0";
8
+ var version = exports.version = "188.10.2";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -16,11 +16,8 @@ export const updateInlineCommentResolvedState = (partialNewState, resolveMethod)
16
16
  }
17
17
  return createCommand(command);
18
18
  };
19
- export const closeComponent = state => createCommand({
20
- type: ACTIONS.CLOSE_COMPONENT,
21
- data: {
22
- lastClosedPos: state.selection.$head.pos
23
- }
19
+ export const closeComponent = () => createCommand({
20
+ type: ACTIONS.CLOSE_COMPONENT
24
21
  });
25
22
  export const clearDirtyMark = () => createCommand({
26
23
  type: ACTIONS.INLINE_COMMENT_CLEAR_DIRTY_MARK
@@ -99,7 +99,7 @@ export const inlineCommentPlugin = options => {
99
99
  const setVisibility = isVisible => onSetVisibility(editorView)(isVisible);
100
100
  const setSelectedAnnotationFn = annotationId => {
101
101
  if (!annotationId) {
102
- closeComponent(editorView.state)(editorView.state, editorView.dispatch);
102
+ closeComponent()(editorView.state, editorView.dispatch);
103
103
  } else {
104
104
  setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
105
105
  }
@@ -15,8 +15,7 @@ export default ((pluginState, action) => {
15
15
  const mouseData = Object.assign({}, pluginState.mouseData, action.data.mouseData);
16
16
  return {
17
17
  ...pluginState,
18
- mouseData,
19
- lastClosedPos: undefined
18
+ mouseData
20
19
  };
21
20
  case ACTIONS.SET_INLINE_COMMENT_DRAFT_STATE:
22
21
  return getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
@@ -29,8 +28,7 @@ export default ((pluginState, action) => {
29
28
  case ACTIONS.CLOSE_COMPONENT:
30
29
  return {
31
30
  ...pluginState,
32
- selectedAnnotations: [],
33
- lastClosedPos: action.data.lastClosedPos
31
+ selectedAnnotations: []
34
32
  };
35
33
  case ACTIONS.ADD_INLINE_COMMENT:
36
34
  const updatedPluginState = getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
@@ -44,8 +44,7 @@ export function InlineCommentView({
44
44
  const {
45
45
  bookmark,
46
46
  selectedAnnotations,
47
- annotations,
48
- lastClosedPos
47
+ annotations
49
48
  } = inlineCommentState || {};
50
49
  const annotationsList = getAllAnnotations(editorView.state.doc);
51
50
  const selection = getSelectionPositions(state, inlineCommentState);
@@ -106,9 +105,7 @@ export function InlineCommentView({
106
105
 
107
106
  // View Component
108
107
  const activeAnnotations = (selectedAnnotations === null || selectedAnnotations === void 0 ? void 0 : selectedAnnotations.filter(mark => annotations && annotations[mark.id] === false)) || [];
109
- if (!ViewComponent || activeAnnotations.length === 0 ||
110
- // Check if the user has moved the selection since closing the previous comment
111
- editorView.state.selection.$head.pos === lastClosedPos) {
108
+ if (!ViewComponent || activeAnnotations.length === 0) {
112
109
  return null;
113
110
  }
114
111
  const onAnnotationViewed = () => {
@@ -144,7 +141,7 @@ export function InlineCommentView({
144
141
  [id]: true
145
142
  }, RESOLVE_METHOD.COMPONENT)(editorView.state, editorView.dispatch),
146
143
  onClose: () => {
147
- closeComponent(editorView.state)(editorView.state, editorView.dispatch);
144
+ closeComponent()(editorView.state, editorView.dispatch);
148
145
  }
149
146
  }));
150
147
  }
@@ -42,7 +42,6 @@ export class ToolbarTextColor extends React.Component {
42
42
  });
43
43
  });
44
44
  _defineProperty(this, "changeTextColor", (color, editorAnalyticsApi, disabled) => {
45
- var _this$toolbarItemRef, _this$toolbarItemRef$;
46
45
  if (!disabled) {
47
46
  var _this$props$editorVie;
48
47
  const {
@@ -64,7 +63,6 @@ export class ToolbarTextColor extends React.Component {
64
63
  //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
65
64
  (_this$props$editorVie = this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
66
65
  }
67
- (_this$toolbarItemRef = this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 ? void 0 : (_this$toolbarItemRef$ = _this$toolbarItemRef.current) === null || _this$toolbarItemRef$ === void 0 ? void 0 : _this$toolbarItemRef$.focus();
68
66
  return false;
69
67
  });
70
68
  _defineProperty(this, "toggleOpen", () => {
@@ -101,8 +99,8 @@ export class ToolbarTextColor extends React.Component {
101
99
  }));
102
100
  }
103
101
  if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
104
- var _this$toolbarItemRef2, _this$toolbarItemRef3;
105
- (_this$toolbarItemRef2 = this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
102
+ var _this$toolbarItemRef, _this$toolbarItemRef$;
103
+ (_this$toolbarItemRef = this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 ? void 0 : (_this$toolbarItemRef$ = _this$toolbarItemRef.current) === null || _this$toolbarItemRef$ === void 0 ? void 0 : _this$toolbarItemRef$.focus();
106
104
  }
107
105
  });
108
106
  _defineProperty(this, "hide", e => {
@@ -117,15 +115,15 @@ export class ToolbarTextColor extends React.Component {
117
115
  isOpen: false
118
116
  });
119
117
  if (e instanceof KeyboardEvent && e.key === 'Escape') {
120
- var _this$toolbarItemRef4, _this$toolbarItemRef5;
121
- (_this$toolbarItemRef4 = this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 ? void 0 : (_this$toolbarItemRef5 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef5 === void 0 ? void 0 : _this$toolbarItemRef5.focus();
118
+ var _this$toolbarItemRef2, _this$toolbarItemRef3;
119
+ (_this$toolbarItemRef2 = this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
122
120
  }
123
121
  }
124
122
  });
125
123
  _defineProperty(this, "hideonEsc", e => {
126
- var _this$toolbarItemRef6, _this$toolbarItemRef7;
124
+ var _this$toolbarItemRef4, _this$toolbarItemRef5;
127
125
  this.hide(e);
128
- (_this$toolbarItemRef6 = this.toolbarItemRef) === null || _this$toolbarItemRef6 === void 0 ? void 0 : (_this$toolbarItemRef7 = _this$toolbarItemRef6.current) === null || _this$toolbarItemRef7 === void 0 ? void 0 : _this$toolbarItemRef7.focus();
126
+ (_this$toolbarItemRef4 = this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 ? void 0 : (_this$toolbarItemRef5 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef5 === void 0 ? void 0 : _this$toolbarItemRef5.focus();
129
127
  });
130
128
  }
131
129
  render() {
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Creates a filter that checks if the node at a given number of parents above the current
3
3
  * selection is of the correct node type.
4
+ *
4
5
  * @param nodeType The node type to compare the nth parent against
5
6
  * @param depthAway How many levels above the current node to check against. 0 refers to
6
7
  * the current selection's parent, which will be the containing node when the selection
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "188.10.0";
2
+ export const version = "188.10.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -19,12 +19,9 @@ export var updateInlineCommentResolvedState = function updateInlineCommentResolv
19
19
  }
20
20
  return createCommand(command);
21
21
  };
22
- export var closeComponent = function closeComponent(state) {
22
+ export var closeComponent = function closeComponent() {
23
23
  return createCommand({
24
- type: ACTIONS.CLOSE_COMPONENT,
25
- data: {
26
- lastClosedPos: state.selection.$head.pos
27
- }
24
+ type: ACTIONS.CLOSE_COMPONENT
28
25
  });
29
26
  };
30
27
  export var clearDirtyMark = function clearDirtyMark() {
@@ -149,7 +149,7 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
149
149
  };
150
150
  var setSelectedAnnotationFn = function setSelectedAnnotationFn(annotationId) {
151
151
  if (!annotationId) {
152
- closeComponent(editorView.state)(editorView.state, editorView.dispatch);
152
+ closeComponent()(editorView.state, editorView.dispatch);
153
153
  } else {
154
154
  setSelectedAnnotation(annotationId)(editorView.state, editorView.dispatch);
155
155
  }
@@ -14,8 +14,7 @@ export default (function (pluginState, action) {
14
14
  case ACTIONS.INLINE_COMMENT_UPDATE_MOUSE_STATE:
15
15
  var mouseData = Object.assign({}, pluginState.mouseData, action.data.mouseData);
16
16
  return _objectSpread(_objectSpread({}, pluginState), {}, {
17
- mouseData: mouseData,
18
- lastClosedPos: undefined
17
+ mouseData: mouseData
19
18
  });
20
19
  case ACTIONS.SET_INLINE_COMMENT_DRAFT_STATE:
21
20
  return getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
@@ -26,8 +25,7 @@ export default (function (pluginState, action) {
26
25
  });
27
26
  case ACTIONS.CLOSE_COMPONENT:
28
27
  return _objectSpread(_objectSpread({}, pluginState), {}, {
29
- selectedAnnotations: [],
30
- lastClosedPos: action.data.lastClosedPos
28
+ selectedAnnotations: []
31
29
  });
32
30
  case ACTIONS.ADD_INLINE_COMMENT:
33
31
  var updatedPluginState = getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
@@ -38,8 +38,7 @@ export function InlineCommentView(_ref) {
38
38
  var _ref2 = inlineCommentState || {},
39
39
  bookmark = _ref2.bookmark,
40
40
  selectedAnnotations = _ref2.selectedAnnotations,
41
- annotations = _ref2.annotations,
42
- lastClosedPos = _ref2.lastClosedPos;
41
+ annotations = _ref2.annotations;
43
42
  var annotationsList = getAllAnnotations(editorView.state.doc);
44
43
  var selection = getSelectionPositions(state, inlineCommentState);
45
44
  var position = findPosForDOM(selection);
@@ -101,9 +100,7 @@ export function InlineCommentView(_ref) {
101
100
  var activeAnnotations = (selectedAnnotations === null || selectedAnnotations === void 0 ? void 0 : selectedAnnotations.filter(function (mark) {
102
101
  return annotations && annotations[mark.id] === false;
103
102
  })) || [];
104
- if (!ViewComponent || activeAnnotations.length === 0 ||
105
- // Check if the user has moved the selection since closing the previous comment
106
- editorView.state.selection.$head.pos === lastClosedPos) {
103
+ if (!ViewComponent || activeAnnotations.length === 0) {
107
104
  return null;
108
105
  }
109
106
  var onAnnotationViewed = function onAnnotationViewed() {
@@ -141,7 +138,7 @@ export function InlineCommentView(_ref) {
141
138
  return updateInlineCommentResolvedState(_defineProperty({}, id, true), RESOLVE_METHOD.COMPONENT)(editorView.state, editorView.dispatch);
142
139
  },
143
140
  onClose: function onClose() {
144
- closeComponent(editorView.state)(editorView.state, editorView.dispatch);
141
+ closeComponent()(editorView.state, editorView.dispatch);
145
142
  }
146
143
  }));
147
144
  }
@@ -61,7 +61,6 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
61
61
  });
62
62
  });
63
63
  _defineProperty(_assertThisInitialized(_this), "changeTextColor", function (color, editorAnalyticsApi, disabled) {
64
- var _this$toolbarItemRef;
65
64
  if (!disabled) {
66
65
  var _this$props$editorVie;
67
66
  var palette = _this.props.pluginState.palette;
@@ -81,7 +80,6 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
81
80
  //To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
82
81
  (_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
83
82
  }
84
- (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
85
83
  return false;
86
84
  });
87
85
  _defineProperty(_assertThisInitialized(_this), "toggleOpen", function () {
@@ -117,8 +115,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
117
115
  }));
118
116
  }
119
117
  if (!isOpen && event instanceof KeyboardEvent && (event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
120
- var _this$toolbarItemRef2;
121
- (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
118
+ var _this$toolbarItemRef;
119
+ (_this$toolbarItemRef = _this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 || (_this$toolbarItemRef = _this$toolbarItemRef.current) === null || _this$toolbarItemRef === void 0 || _this$toolbarItemRef.focus();
122
120
  }
123
121
  });
124
122
  _defineProperty(_assertThisInitialized(_this), "hide", function (e) {
@@ -131,15 +129,15 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
131
129
  isOpen: false
132
130
  });
133
131
  if (e instanceof KeyboardEvent && e.key === 'Escape') {
134
- var _this$toolbarItemRef3;
135
- (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
132
+ var _this$toolbarItemRef2;
133
+ (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
136
134
  }
137
135
  }
138
136
  });
139
137
  _defineProperty(_assertThisInitialized(_this), "hideonEsc", function (e) {
140
- var _this$toolbarItemRef4;
138
+ var _this$toolbarItemRef3;
141
139
  _this.hide(e);
142
- (_this$toolbarItemRef4 = _this.toolbarItemRef) === null || _this$toolbarItemRef4 === void 0 || (_this$toolbarItemRef4 = _this$toolbarItemRef4.current) === null || _this$toolbarItemRef4 === void 0 || _this$toolbarItemRef4.focus();
140
+ (_this$toolbarItemRef3 = _this.toolbarItemRef) === null || _this$toolbarItemRef3 === void 0 || (_this$toolbarItemRef3 = _this$toolbarItemRef3.current) === null || _this$toolbarItemRef3 === void 0 || _this$toolbarItemRef3.focus();
143
141
  });
144
142
  return _this;
145
143
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Creates a filter that checks if the node at a given number of parents above the current
3
3
  * selection is of the correct node type.
4
+ *
4
5
  * @param nodeType The node type to compare the nth parent against
5
6
  * @param depthAway How many levels above the current node to check against. 0 refers to
6
7
  * the current selection's parent, which will be the containing node when the selection
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "188.10.0";
2
+ export var version = "188.10.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,11 +1,10 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
1
  import type { RESOLVE_METHOD } from './../../analytics/types/inline-comment-events';
3
2
  import type { Command } from '../../../types';
4
3
  import { AnnotationTypes } from '@atlaskit/adf-schema';
5
4
  import { INPUT_METHOD } from '../../analytics';
6
5
  import type { InlineCommentMap, InlineCommentMouseData } from '../pm-plugins/types';
7
6
  export declare const updateInlineCommentResolvedState: (partialNewState: InlineCommentMap, resolveMethod?: RESOLVE_METHOD) => Command;
8
- export declare const closeComponent: (state: EditorState) => Command;
7
+ export declare const closeComponent: () => Command;
9
8
  export declare const clearDirtyMark: () => Command;
10
9
  export declare const removeInlineCommentNearSelection: (id: string) => Command;
11
10
  export declare const setInlineCommentDraftState: (drafting: boolean, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT) => Command;
@@ -43,9 +43,6 @@ export type InlineCommentAction = {
43
43
  type: ACTIONS.INLINE_COMMENT_CLEAR_DIRTY_MARK;
44
44
  } | {
45
45
  type: ACTIONS.CLOSE_COMPONENT;
46
- data: {
47
- lastClosedPos: number;
48
- };
49
46
  } | {
50
47
  type: ACTIONS.ADD_INLINE_COMMENT;
51
48
  data: {
@@ -74,5 +71,4 @@ export type InlineCommentPluginState = {
74
71
  bookmark?: SelectionBookmark;
75
72
  disallowOnWhitespace: boolean;
76
73
  isVisible: boolean;
77
- lastClosedPos?: number;
78
74
  };
@@ -4,6 +4,7 @@ import type { HigherOrderCommand } from '@atlaskit/editor-common/types';
4
4
  /**
5
5
  * Creates a filter that checks if the node at a given number of parents above the current
6
6
  * selection is of the correct node type.
7
+ *
7
8
  * @param nodeType The node type to compare the nth parent against
8
9
  * @param depthAway How many levels above the current node to check against. 0 refers to
9
10
  * the current selection's parent, which will be the containing node when the selection
@@ -1,11 +1,10 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
1
  import type { RESOLVE_METHOD } from './../../analytics/types/inline-comment-events';
3
2
  import type { Command } from '../../../types';
4
3
  import { AnnotationTypes } from '@atlaskit/adf-schema';
5
4
  import { INPUT_METHOD } from '../../analytics';
6
5
  import type { InlineCommentMap, InlineCommentMouseData } from '../pm-plugins/types';
7
6
  export declare const updateInlineCommentResolvedState: (partialNewState: InlineCommentMap, resolveMethod?: RESOLVE_METHOD) => Command;
8
- export declare const closeComponent: (state: EditorState) => Command;
7
+ export declare const closeComponent: () => Command;
9
8
  export declare const clearDirtyMark: () => Command;
10
9
  export declare const removeInlineCommentNearSelection: (id: string) => Command;
11
10
  export declare const setInlineCommentDraftState: (drafting: boolean, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT) => Command;
@@ -43,9 +43,6 @@ export type InlineCommentAction = {
43
43
  type: ACTIONS.INLINE_COMMENT_CLEAR_DIRTY_MARK;
44
44
  } | {
45
45
  type: ACTIONS.CLOSE_COMPONENT;
46
- data: {
47
- lastClosedPos: number;
48
- };
49
46
  } | {
50
47
  type: ACTIONS.ADD_INLINE_COMMENT;
51
48
  data: {
@@ -74,5 +71,4 @@ export type InlineCommentPluginState = {
74
71
  bookmark?: SelectionBookmark;
75
72
  disallowOnWhitespace: boolean;
76
73
  isVisible: boolean;
77
- lastClosedPos?: number;
78
74
  };
@@ -4,6 +4,7 @@ import type { HigherOrderCommand } from '@atlaskit/editor-common/types';
4
4
  /**
5
5
  * Creates a filter that checks if the node at a given number of parents above the current
6
6
  * selection is of the correct node type.
7
+ *
7
8
  * @param nodeType The node type to compare the nth parent against
8
9
  * @param depthAway How many levels above the current node to check against. 0 refers to
9
10
  * the current selection's parent, which will be the containing node when the selection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "188.10.0",
3
+ "version": "188.10.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -92,7 +92,7 @@
92
92
  "@atlaskit/editor-plugin-scroll-into-view": "^0.1.0",
93
93
  "@atlaskit/editor-plugin-selection": "^0.1.0",
94
94
  "@atlaskit/editor-plugin-status": "^0.1.0",
95
- "@atlaskit/editor-plugin-table": "^5.2.0",
95
+ "@atlaskit/editor-plugin-table": "^5.3.0",
96
96
  "@atlaskit/editor-plugin-text-formatting": "^0.4.0",
97
97
  "@atlaskit/editor-plugin-type-ahead": "^0.7.0",
98
98
  "@atlaskit/editor-plugin-unsupported-content": "^0.2.0",
@@ -154,7 +154,7 @@
154
154
  "@af/editor-libra": "*",
155
155
  "@af/integration-testing": "*",
156
156
  "@af/visual-regression": "*",
157
- "@atlaskit/collab-provider": "9.15.1",
157
+ "@atlaskit/collab-provider": "9.15.2",
158
158
  "@atlaskit/dropdown-menu": "^12.1.0",
159
159
  "@atlaskit/editor-extension-dropbox": "^0.4.0",
160
160
  "@atlaskit/flag": "^15.2.0",