@atlaskit/editor-plugin-annotation 1.19.7 → 1.19.9

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,19 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 1.19.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#146981](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146981)
8
+ [`1bb47674cd3df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1bb47674cd3df) -
9
+ [ED-24683] clean up `confluence.frontend.fabric.editor.comments-on-media-media-inline-bug-fix`
10
+
11
+ ## 1.19.8
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 1.19.7
4
18
 
5
19
  ### Patch Changes
@@ -228,16 +228,14 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
228
228
  annotations = _ref5.annotations,
229
229
  selectedAnnotations = _ref5.selectedAnnotations,
230
230
  isVisible = _ref5.isVisible,
231
- isInlineCommentViewClosed = _ref5.isInlineCommentViewClosed,
232
- featureFlagsPluginState = _ref5.featureFlagsPluginState;
231
+ isInlineCommentViewClosed = _ref5.isInlineCommentViewClosed;
233
232
  var decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : _view.DecorationSet.empty;
234
233
  var focusDecorations = [];
235
- var isCommentsOnMediaMediaInlineBugFixEnabled = featureFlagsPluginState === null || featureFlagsPluginState === void 0 ? void 0 : featureFlagsPluginState.commentsOnMediaMediaInlineBugFix;
236
234
  state.doc.descendants(function (node, pos) {
237
235
  var _provider$supportedBl;
238
236
  // Inline comment on mediaInline is not supported as part of comments on media project
239
237
  // Thus, we skip the decoration for mediaInline node
240
- if (isCommentsOnMediaMediaInlineBugFixEnabled && node.type.name === 'mediaInline') {
238
+ if (node.type.name === 'mediaInline') {
241
239
  return false;
242
240
  }
243
241
  var isSupportedBlockNode = node.isBlock && ((_provider$supportedBl = provider.supportedBlockNodes) === null || _provider$supportedBl === void 0 ? void 0 : _provider$supportedBl.includes(node.type.name));
@@ -55,7 +55,7 @@ var shouldClearBookMarkCheck = exports.shouldClearBookMarkCheck = function shoul
55
55
  };
56
56
  var getSelectionChangedHandler = function getSelectionChangedHandler(reopenCommentView) {
57
57
  return function (tr, pluginState) {
58
- var _pluginState$featureF, _pluginState$featureF2;
58
+ var _pluginState$featureF;
59
59
  if (pluginState.skipSelectionHandling) {
60
60
  return _objectSpread(_objectSpread({}, pluginState), {}, {
61
61
  skipSelectionHandling: false
@@ -71,7 +71,7 @@ var getSelectionChangedHandler = function getSelectionChangedHandler(reopenComme
71
71
  isInlineCommentViewClosed: false
72
72
  });
73
73
  }
74
- var selectedAnnotations = (0, _utils2.findAnnotationsInSelection)(tr.selection, tr.doc, (_pluginState$featureF2 = pluginState.featureFlagsPluginState) === null || _pluginState$featureF2 === void 0 ? void 0 : _pluginState$featureF2.commentsOnMediaMediaInlineBugFix);
74
+ var selectedAnnotations = (0, _utils2.findAnnotationsInSelection)(tr.selection, tr.doc);
75
75
  if (selectedAnnotations.length === 0) {
76
76
  return _objectSpread(_objectSpread({}, pluginState), {}, {
77
77
  selectedAnnotations: selectedAnnotations,
package/dist/cjs/utils.js CHANGED
@@ -167,7 +167,7 @@ var isCurrentBlockNodeSelected = exports.isCurrentBlockNodeSelected = function i
167
167
  }
168
168
  return false;
169
169
  };
170
- var findAnnotationsInSelection = exports.findAnnotationsInSelection = function findAnnotationsInSelection(selection, doc, isCommentsOnMediaMediaInlineBugFixEnabled) {
170
+ var findAnnotationsInSelection = exports.findAnnotationsInSelection = function findAnnotationsInSelection(selection, doc) {
171
171
  var empty = selection.empty,
172
172
  $anchor = selection.$anchor,
173
173
  anchor = selection.anchor;
@@ -191,7 +191,7 @@ var findAnnotationsInSelection = exports.findAnnotationsInSelection = function f
191
191
 
192
192
  // Inline comment on mediaInline is not supported as part of comments on media project
193
193
  // Hence, we ignore annotations associated with the node when the cursor is right after/before the node
194
- if (isCommentsOnMediaMediaInlineBugFixEnabled && [nodeBefore, node].some(function (node) {
194
+ if ([nodeBefore, node].some(function (node) {
195
195
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'mediaInline';
196
196
  })) {
197
197
  return [];
@@ -167,17 +167,15 @@ export const inlineCommentPlugin = options => {
167
167
  annotations,
168
168
  selectedAnnotations,
169
169
  isVisible,
170
- isInlineCommentViewClosed,
171
- featureFlagsPluginState
170
+ isInlineCommentViewClosed
172
171
  } = getPluginState(state) || {};
173
172
  let decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
174
173
  const focusDecorations = [];
175
- const isCommentsOnMediaMediaInlineBugFixEnabled = featureFlagsPluginState === null || featureFlagsPluginState === void 0 ? void 0 : featureFlagsPluginState.commentsOnMediaMediaInlineBugFix;
176
174
  state.doc.descendants((node, pos) => {
177
175
  var _provider$supportedBl;
178
176
  // Inline comment on mediaInline is not supported as part of comments on media project
179
177
  // Thus, we skip the decoration for mediaInline node
180
- if (isCommentsOnMediaMediaInlineBugFixEnabled && node.type.name === 'mediaInline') {
178
+ if (node.type.name === 'mediaInline') {
181
179
  return false;
182
180
  }
183
181
  const isSupportedBlockNode = node.isBlock && ((_provider$supportedBl = provider.supportedBlockNodes) === null || _provider$supportedBl === void 0 ? void 0 : _provider$supportedBl.includes(node.type.name));
@@ -45,7 +45,7 @@ export const shouldClearBookMarkCheck = (tr, editorState, bookmark) => {
45
45
  return true;
46
46
  };
47
47
  const getSelectionChangedHandler = reopenCommentView => (tr, pluginState) => {
48
- var _pluginState$featureF, _pluginState$featureF2;
48
+ var _pluginState$featureF;
49
49
  if (pluginState.skipSelectionHandling) {
50
50
  return {
51
51
  ...pluginState,
@@ -66,7 +66,7 @@ const getSelectionChangedHandler = reopenCommentView => (tr, pluginState) => {
66
66
  })
67
67
  };
68
68
  }
69
- const selectedAnnotations = findAnnotationsInSelection(tr.selection, tr.doc, (_pluginState$featureF2 = pluginState.featureFlagsPluginState) === null || _pluginState$featureF2 === void 0 ? void 0 : _pluginState$featureF2.commentsOnMediaMediaInlineBugFix);
69
+ const selectedAnnotations = findAnnotationsInSelection(tr.selection, tr.doc);
70
70
  if (selectedAnnotations.length === 0) {
71
71
  return {
72
72
  ...pluginState,
@@ -128,7 +128,7 @@ export const isCurrentBlockNodeSelected = (state, node) => {
128
128
  }
129
129
  return false;
130
130
  };
131
- export const findAnnotationsInSelection = (selection, doc, isCommentsOnMediaMediaInlineBugFixEnabled) => {
131
+ export const findAnnotationsInSelection = (selection, doc) => {
132
132
  const {
133
133
  empty,
134
134
  $anchor,
@@ -154,7 +154,7 @@ export const findAnnotationsInSelection = (selection, doc, isCommentsOnMediaMedi
154
154
 
155
155
  // Inline comment on mediaInline is not supported as part of comments on media project
156
156
  // Hence, we ignore annotations associated with the node when the cursor is right after/before the node
157
- if (isCommentsOnMediaMediaInlineBugFixEnabled && [nodeBefore, node].some(node => (node === null || node === void 0 ? void 0 : node.type.name) === 'mediaInline')) {
157
+ if ([nodeBefore, node].some(node => (node === null || node === void 0 ? void 0 : node.type.name) === 'mediaInline')) {
158
158
  return [];
159
159
  }
160
160
  const annotationMark = doc.type.schema.marks.annotation;
@@ -221,16 +221,14 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
221
221
  annotations = _ref5.annotations,
222
222
  selectedAnnotations = _ref5.selectedAnnotations,
223
223
  isVisible = _ref5.isVisible,
224
- isInlineCommentViewClosed = _ref5.isInlineCommentViewClosed,
225
- featureFlagsPluginState = _ref5.featureFlagsPluginState;
224
+ isInlineCommentViewClosed = _ref5.isInlineCommentViewClosed;
226
225
  var decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
227
226
  var focusDecorations = [];
228
- var isCommentsOnMediaMediaInlineBugFixEnabled = featureFlagsPluginState === null || featureFlagsPluginState === void 0 ? void 0 : featureFlagsPluginState.commentsOnMediaMediaInlineBugFix;
229
227
  state.doc.descendants(function (node, pos) {
230
228
  var _provider$supportedBl;
231
229
  // Inline comment on mediaInline is not supported as part of comments on media project
232
230
  // Thus, we skip the decoration for mediaInline node
233
- if (isCommentsOnMediaMediaInlineBugFixEnabled && node.type.name === 'mediaInline') {
231
+ if (node.type.name === 'mediaInline') {
234
232
  return false;
235
233
  }
236
234
  var isSupportedBlockNode = node.isBlock && ((_provider$supportedBl = provider.supportedBlockNodes) === null || _provider$supportedBl === void 0 ? void 0 : _provider$supportedBl.includes(node.type.name));
@@ -48,7 +48,7 @@ export var shouldClearBookMarkCheck = function shouldClearBookMarkCheck(tr, edit
48
48
  };
49
49
  var getSelectionChangedHandler = function getSelectionChangedHandler(reopenCommentView) {
50
50
  return function (tr, pluginState) {
51
- var _pluginState$featureF, _pluginState$featureF2;
51
+ var _pluginState$featureF;
52
52
  if (pluginState.skipSelectionHandling) {
53
53
  return _objectSpread(_objectSpread({}, pluginState), {}, {
54
54
  skipSelectionHandling: false
@@ -64,7 +64,7 @@ var getSelectionChangedHandler = function getSelectionChangedHandler(reopenComme
64
64
  isInlineCommentViewClosed: false
65
65
  });
66
66
  }
67
- var selectedAnnotations = findAnnotationsInSelection(tr.selection, tr.doc, (_pluginState$featureF2 = pluginState.featureFlagsPluginState) === null || _pluginState$featureF2 === void 0 ? void 0 : _pluginState$featureF2.commentsOnMediaMediaInlineBugFix);
67
+ var selectedAnnotations = findAnnotationsInSelection(tr.selection, tr.doc);
68
68
  if (selectedAnnotations.length === 0) {
69
69
  return _objectSpread(_objectSpread({}, pluginState), {}, {
70
70
  selectedAnnotations: selectedAnnotations,
package/dist/esm/utils.js CHANGED
@@ -140,7 +140,7 @@ export var isCurrentBlockNodeSelected = function isCurrentBlockNodeSelected(stat
140
140
  }
141
141
  return false;
142
142
  };
143
- export var findAnnotationsInSelection = function findAnnotationsInSelection(selection, doc, isCommentsOnMediaMediaInlineBugFixEnabled) {
143
+ export var findAnnotationsInSelection = function findAnnotationsInSelection(selection, doc) {
144
144
  var empty = selection.empty,
145
145
  $anchor = selection.$anchor,
146
146
  anchor = selection.anchor;
@@ -164,7 +164,7 @@ export var findAnnotationsInSelection = function findAnnotationsInSelection(sele
164
164
 
165
165
  // Inline comment on mediaInline is not supported as part of comments on media project
166
166
  // Hence, we ignore annotations associated with the node when the cursor is right after/before the node
167
- if (isCommentsOnMediaMediaInlineBugFixEnabled && [nodeBefore, node].some(function (node) {
167
+ if ([nodeBefore, node].some(function (node) {
168
168
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'mediaInline';
169
169
  })) {
170
170
  return [];
@@ -21,7 +21,7 @@ export declare const decorationKey: {
21
21
  export declare const addDraftDecoration: (start: number, end: number, targetType?: TargetType) => Decoration;
22
22
  export declare const getAnnotationViewKey: (annotations: AnnotationInfo[]) => string;
23
23
  export declare const isCurrentBlockNodeSelected: (state: EditorState, node: Node) => boolean;
24
- export declare const findAnnotationsInSelection: (selection: Selection, doc: Node, isCommentsOnMediaMediaInlineBugFixEnabled?: boolean) => AnnotationInfo[];
24
+ export declare const findAnnotationsInSelection: (selection: Selection, doc: Node) => AnnotationInfo[];
25
25
  export declare const resolveDraftBookmark: (editorState: EditorState, bookmark?: SelectionBookmark, supportedBlockNodes?: string[]) => DraftBookmark;
26
26
  /**
27
27
  * get selection from position to apply new comment for
@@ -21,7 +21,7 @@ export declare const decorationKey: {
21
21
  export declare const addDraftDecoration: (start: number, end: number, targetType?: TargetType) => Decoration;
22
22
  export declare const getAnnotationViewKey: (annotations: AnnotationInfo[]) => string;
23
23
  export declare const isCurrentBlockNodeSelected: (state: EditorState, node: Node) => boolean;
24
- export declare const findAnnotationsInSelection: (selection: Selection, doc: Node, isCommentsOnMediaMediaInlineBugFixEnabled?: boolean) => AnnotationInfo[];
24
+ export declare const findAnnotationsInSelection: (selection: Selection, doc: Node) => AnnotationInfo[];
25
25
  export declare const resolveDraftBookmark: (editorState: EditorState, bookmark?: SelectionBookmark, supportedBlockNodes?: string[]) => DraftBookmark;
26
26
  /**
27
27
  * get selection from position to apply new comment for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
- "@atlaskit/editor-common": "^90.0.0",
35
+ "@atlaskit/editor-common": "^91.2.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode-effects": "^1.1.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
39
39
  "@atlaskit/editor-prosemirror": "6.0.0",
40
- "@atlaskit/icon": "^22.18.0",
40
+ "@atlaskit/icon": "^22.19.0",
41
41
  "@atlaskit/platform-feature-flags": "^0.3.0",
42
42
  "@babel/runtime": "^7.0.0"
43
43
  },
package/.eslintrc.js DELETED
@@ -1,18 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- '@typescript-eslint/no-duplicate-imports': 'error',
4
- '@typescript-eslint/no-explicit-any': 'error',
5
- '@typescript-eslint/ban-types': [
6
- 'error',
7
- {
8
- types: {
9
- 'React.FC':
10
- 'Please use types directly on props instead, and explicitly define children if required',
11
- 'React.FunctionalComponent':
12
- 'Please use types directly on props instead, and explicitly define children if required',
13
- },
14
- extendDefaults: false,
15
- },
16
- ],
17
- },
18
- };