@atlaskit/editor-plugin-annotation 1.5.6 → 1.5.8

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
+ ## 1.5.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#88763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88763) [`9fcd30347b0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9fcd30347b0c) - [ux] Removed annotation styling for media in editor and renderer
8
+ - Updated dependencies
9
+
10
+ ## 1.5.7
11
+
12
+ ### Patch Changes
13
+
14
+ - [#87596](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87596) [`e0b95c3a4fba`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e0b95c3a4fba) - Add new UI badge for media node to trigger comments
15
+
3
16
  ## 1.5.6
4
17
 
5
18
  ### Patch Changes
@@ -11,7 +11,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
11
11
  var _adfSchema = require("@atlaskit/adf-schema");
12
12
  var _analytics = require("@atlaskit/editor-common/analytics");
13
13
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
14
- var _styles = require("@atlaskit/editor-common/styles");
15
14
  var _view = require("@atlaskit/editor-prosemirror/view");
16
15
  var _commands = require("../commands");
17
16
  var _nodeviews = require("../nodeviews");
@@ -224,8 +223,6 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
224
223
  var decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : _view.DecorationSet.empty;
225
224
  var focusDecorations = [];
226
225
  state.doc.descendants(function (node, pos) {
227
- var _provider$supportedBl;
228
- var isSupportedBlockNode = node.isBlock && ((_provider$supportedBl = provider.supportedBlockNodes) === null || _provider$supportedBl === void 0 ? void 0 : _provider$supportedBl.includes(node.type.name));
229
226
  node.marks.filter(function (mark) {
230
227
  return mark.type === state.schema.marks.annotation;
231
228
  }).forEach(function (mark) {
@@ -234,19 +231,10 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
234
231
  var isSelected = !isInlineCommentViewClosed && !!(selectedAnnotations !== null && selectedAnnotations !== void 0 && selectedAnnotations.some(function (selectedAnnotation) {
235
232
  return selectedAnnotation.id === mark.attrs.id;
236
233
  }));
237
- if (isSupportedBlockNode) {
238
- var attrs = isUnresolved ? {
239
- class: isSelected ? "".concat(_styles.BlockAnnotationSharedClassNames.focus) : "".concat(_styles.BlockAnnotationSharedClassNames.blur)
240
- } : {};
241
- focusDecorations.push(_view.Decoration.node(pos, pos + node.nodeSize, attrs, {
242
- key: _utils.decorationKey.block
243
- }));
244
- } else {
245
- focusDecorations.push(_view.Decoration.inline(pos, pos + node.nodeSize, {
246
- class: "".concat((0, _nodeviews.getAnnotationViewClassname)(isUnresolved, isSelected), " ").concat(isUnresolved),
247
- nodeName: 'span'
248
- }));
249
- }
234
+ focusDecorations.push(_view.Decoration.inline(pos, pos + node.nodeSize, {
235
+ class: "".concat((0, _nodeviews.getAnnotationViewClassname)(isUnresolved, isSelected), " ").concat(isUnresolved),
236
+ nodeName: 'span'
237
+ }));
250
238
  }
251
239
  });
252
240
  });
@@ -1,11 +1,10 @@
1
1
  import { AnnotationTypes } from '@atlaskit/adf-schema';
2
2
  import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import { BlockAnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
5
4
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
5
  import { clearDirtyMark, closeComponent, setInlineCommentsVisibility, setSelectedAnnotation, updateInlineCommentResolvedState, updateMouseState } from '../commands';
7
6
  import { AnnotationNodeView, getAnnotationViewClassname } from '../nodeviews';
8
- import { decorationKey, getAllAnnotations, getPluginState, inlineCommentPluginKey } from '../utils';
7
+ import { getAllAnnotations, getPluginState, inlineCommentPluginKey } from '../utils';
9
8
  import { createPluginState } from './plugin-factory';
10
9
  const fetchProviderStates = async (provider, annotationIds) => {
11
10
  const data = await provider.getState(annotationIds);
@@ -164,25 +163,14 @@ export const inlineCommentPlugin = options => {
164
163
  let decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
165
164
  const focusDecorations = [];
166
165
  state.doc.descendants((node, pos) => {
167
- var _provider$supportedBl;
168
- const isSupportedBlockNode = node.isBlock && ((_provider$supportedBl = provider.supportedBlockNodes) === null || _provider$supportedBl === void 0 ? void 0 : _provider$supportedBl.includes(node.type.name));
169
166
  node.marks.filter(mark => mark.type === state.schema.marks.annotation).forEach(mark => {
170
167
  if (isVisible) {
171
168
  const isUnresolved = !!annotations && annotations[mark.attrs.id] === false;
172
169
  const isSelected = !isInlineCommentViewClosed && !!(selectedAnnotations !== null && selectedAnnotations !== void 0 && selectedAnnotations.some(selectedAnnotation => selectedAnnotation.id === mark.attrs.id));
173
- if (isSupportedBlockNode) {
174
- const attrs = isUnresolved ? {
175
- class: isSelected ? `${BlockAnnotationSharedClassNames.focus}` : `${BlockAnnotationSharedClassNames.blur}`
176
- } : {};
177
- focusDecorations.push(Decoration.node(pos, pos + node.nodeSize, attrs, {
178
- key: decorationKey.block
179
- }));
180
- } else {
181
- focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
182
- class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`,
183
- nodeName: 'span'
184
- }));
185
- }
170
+ focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
171
+ class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`,
172
+ nodeName: 'span'
173
+ }));
186
174
  }
187
175
  });
188
176
  });
@@ -4,11 +4,10 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { AnnotationTypes } from '@atlaskit/adf-schema';
5
5
  import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
- import { BlockAnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
8
7
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
8
  import { clearDirtyMark, closeComponent, setInlineCommentsVisibility, setSelectedAnnotation, updateInlineCommentResolvedState, updateMouseState } from '../commands';
10
9
  import { AnnotationNodeView, getAnnotationViewClassname } from '../nodeviews';
11
- import { decorationKey, getAllAnnotations, getPluginState, inlineCommentPluginKey } from '../utils';
10
+ import { getAllAnnotations, getPluginState, inlineCommentPluginKey } from '../utils';
12
11
  import { createPluginState } from './plugin-factory';
13
12
  var fetchProviderStates = /*#__PURE__*/function () {
14
13
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(provider, annotationIds) {
@@ -217,8 +216,6 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
217
216
  var decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
218
217
  var focusDecorations = [];
219
218
  state.doc.descendants(function (node, pos) {
220
- var _provider$supportedBl;
221
- var isSupportedBlockNode = node.isBlock && ((_provider$supportedBl = provider.supportedBlockNodes) === null || _provider$supportedBl === void 0 ? void 0 : _provider$supportedBl.includes(node.type.name));
222
219
  node.marks.filter(function (mark) {
223
220
  return mark.type === state.schema.marks.annotation;
224
221
  }).forEach(function (mark) {
@@ -227,19 +224,10 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
227
224
  var isSelected = !isInlineCommentViewClosed && !!(selectedAnnotations !== null && selectedAnnotations !== void 0 && selectedAnnotations.some(function (selectedAnnotation) {
228
225
  return selectedAnnotation.id === mark.attrs.id;
229
226
  }));
230
- if (isSupportedBlockNode) {
231
- var attrs = isUnresolved ? {
232
- class: isSelected ? "".concat(BlockAnnotationSharedClassNames.focus) : "".concat(BlockAnnotationSharedClassNames.blur)
233
- } : {};
234
- focusDecorations.push(Decoration.node(pos, pos + node.nodeSize, attrs, {
235
- key: decorationKey.block
236
- }));
237
- } else {
238
- focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
239
- class: "".concat(getAnnotationViewClassname(isUnresolved, isSelected), " ").concat(isUnresolved),
240
- nodeName: 'span'
241
- }));
242
- }
227
+ focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
228
+ class: "".concat(getAnnotationViewClassname(isUnresolved, isSelected), " ").concat(isUnresolved),
229
+ nodeName: 'span'
230
+ }));
243
231
  }
244
232
  });
245
233
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^35.8.0",
36
- "@atlaskit/editor-common": "^78.23.0",
36
+ "@atlaskit/editor-common": "^78.26.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
38
38
  "@atlaskit/editor-plugin-editor-viewmode": "^1.0.0",
39
39
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",