@atlaskit/editor-plugin-media 8.4.18 → 8.4.19

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,11 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 8.4.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 8.4.18
4
10
 
5
11
  ### Patch Changes
@@ -50,11 +50,11 @@ var CommentBadgeWrapper = exports.CommentBadgeWrapper = function CommentBadgeWra
50
50
  }) && !isInlineCommentViewClosed ? 'active' : 'default';
51
51
  }, [selectedAnnotations, isInlineCommentViewClosed, mediaNode]);
52
52
  var onClick = (0, _react.useCallback)(function () {
53
- if (api.annotation && mediaNode) {
53
+ if (api !== null && api !== void 0 && api.annotation && mediaNode) {
54
54
  var showCommentForBlockNode = api.annotation.actions.showCommentForBlockNode;
55
55
  showCommentForBlockNode(mediaNode, _analytics.VIEW_METHOD.BADGE)(state, dispatch);
56
56
  }
57
- }, [api.annotation, dispatch, mediaNode, state]);
57
+ }, [api === null || api === void 0 ? void 0 : api.annotation, dispatch, mediaNode, state]);
58
58
  var pos = getPos();
59
59
  var hasNoComments = !Number.isFinite(pos) || !annotations || !mediaNode || mediaNode.type !== media || mediaNode.marks.every(function (maybeAnnotation) {
60
60
  return maybeAnnotation.type !== annotation || !(maybeAnnotation.attrs.id in annotations) || annotations[maybeAnnotation.attrs.id];
@@ -97,7 +97,7 @@ const mediaAsyncOperations = async props => {
97
97
  });
98
98
  props.addPendingTask(copyNode);
99
99
  await copyNode;
100
- } catch (e) {}
100
+ } catch {}
101
101
  }
102
102
  };
103
103
  const useMediaAsyncOperations = ({
@@ -44,13 +44,13 @@ export const CommentBadgeWrapper = ({
44
44
  return selectedAnnotations.some(annotation => !!mediaNode.marks.find(mark => mark.attrs.id === annotation.id)) && !isInlineCommentViewClosed ? 'active' : 'default';
45
45
  }, [selectedAnnotations, isInlineCommentViewClosed, mediaNode]);
46
46
  const onClick = useCallback(() => {
47
- if (api.annotation && mediaNode) {
47
+ if (api !== null && api !== void 0 && api.annotation && mediaNode) {
48
48
  const {
49
49
  showCommentForBlockNode
50
50
  } = api.annotation.actions;
51
51
  showCommentForBlockNode(mediaNode, VIEW_METHOD.BADGE)(state, dispatch);
52
52
  }
53
- }, [api.annotation, dispatch, mediaNode, state]);
53
+ }, [api === null || api === void 0 ? void 0 : api.annotation, dispatch, mediaNode, state]);
54
54
  const pos = getPos();
55
55
  const hasNoComments = !Number.isFinite(pos) || !annotations || !mediaNode || mediaNode.type !== media || mediaNode.marks.every(maybeAnnotation => maybeAnnotation.type !== annotation || !(maybeAnnotation.attrs.id in annotations) || annotations[maybeAnnotation.attrs.id]);
56
56
  if (!isDrafting && hasNoComments || !mediaNode) {
@@ -41,11 +41,11 @@ export var CommentBadgeWrapper = function CommentBadgeWrapper(_ref) {
41
41
  }) && !isInlineCommentViewClosed ? 'active' : 'default';
42
42
  }, [selectedAnnotations, isInlineCommentViewClosed, mediaNode]);
43
43
  var onClick = useCallback(function () {
44
- if (api.annotation && mediaNode) {
44
+ if (api !== null && api !== void 0 && api.annotation && mediaNode) {
45
45
  var showCommentForBlockNode = api.annotation.actions.showCommentForBlockNode;
46
46
  showCommentForBlockNode(mediaNode, VIEW_METHOD.BADGE)(state, dispatch);
47
47
  }
48
- }, [api.annotation, dispatch, mediaNode, state]);
48
+ }, [api === null || api === void 0 ? void 0 : api.annotation, dispatch, mediaNode, state]);
49
49
  var pos = getPos();
50
50
  var hasNoComments = !Number.isFinite(pos) || !annotations || !mediaNode || mediaNode.type !== media || mediaNode.marks.every(function (maybeAnnotation) {
51
51
  return maybeAnnotation.type !== annotation || !(maybeAnnotation.attrs.id in annotations) || annotations[maybeAnnotation.attrs.id];
@@ -6,7 +6,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
7
7
  import type { getPosHandler } from '../../types';
8
8
  type CommentBadgeWrapperProps = {
9
- api: ExtractInjectionAPI<MediaNextEditorPluginType>;
9
+ api?: ExtractInjectionAPI<MediaNextEditorPluginType>;
10
10
  getPos: getPosHandler;
11
11
  isDrafting?: boolean;
12
12
  marks?: AnnotationMarkDefinition[];
@@ -6,7 +6,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
7
7
  import type { getPosHandler } from '../../types';
8
8
  type CommentBadgeWrapperProps = {
9
- api: ExtractInjectionAPI<MediaNextEditorPluginType>;
9
+ api?: ExtractInjectionAPI<MediaNextEditorPluginType>;
10
10
  getPos: getPosHandler;
11
11
  isDrafting?: boolean;
12
12
  marks?: AnnotationMarkDefinition[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "8.4.18",
3
+ "version": "8.4.19",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/button": "^23.6.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
38
- "@atlaskit/editor-plugin-annotation": "^6.2.0",
38
+ "@atlaskit/editor-plugin-annotation": "^6.3.0",
39
39
  "@atlaskit/editor-plugin-connectivity": "^6.0.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
41
41
  "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
@@ -66,9 +66,9 @@
66
66
  "@atlaskit/primitives": "^16.4.0",
67
67
  "@atlaskit/textfield": "^8.1.0",
68
68
  "@atlaskit/theme": "^21.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^14.6.0",
69
+ "@atlaskit/tmp-editor-statsig": "^15.0.0",
70
70
  "@atlaskit/tokens": "^8.4.0",
71
- "@atlaskit/tooltip": "^20.10.0",
71
+ "@atlaskit/tooltip": "^20.11.0",
72
72
  "@babel/runtime": "^7.0.0",
73
73
  "@emotion/react": "^11.7.1",
74
74
  "bind-event-listener": "^3.0.0",
@@ -78,7 +78,7 @@
78
78
  "uuid": "^3.1.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^110.38.0",
81
+ "@atlaskit/editor-common": "^110.40.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",