@atlaskit/editor-plugin-media 9.4.5 → 9.4.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,17 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 9.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.4.6
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 9.4.5
4
16
 
5
17
  ### Patch Changes
@@ -188,7 +188,7 @@ var useLatestMediaNode = function useLatestMediaNode(nextMediaNode) {
188
188
  mediaNode = _React$useState2[0],
189
189
  setMediaNode = _React$useState2[1];
190
190
  _react.default.useEffect(function () {
191
- if (!previousMediaNode) {
191
+ if (!previousMediaNode || typeof previousMediaNode.eq !== 'function') {
192
192
  return;
193
193
  }
194
194
  if (!previousMediaNode.eq(nextMediaNode)) {
@@ -705,30 +705,6 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
705
705
  });
706
706
  }
707
707
  }
708
-
709
- // open link
710
- if (allowLinking && (0, _linking3.shouldShowMediaLinkToolbar)(state) && mediaLinkingState && mediaLinkingState.editable) {
711
- toolbarButtons.push((0, _linking3.getOpenLinkToolbarButtonOption)(intl, mediaLinkingState, pluginInjectionApi), {
712
- type: 'separator',
713
- supportsViewMode: true
714
- });
715
- }
716
- isViewOnly && toolbarButtons.push({
717
- type: 'copy-button',
718
- items: [{
719
- state: state,
720
- formatMessage: intl.formatMessage,
721
- nodeType: mediaSingle
722
- }],
723
- supportsViewMode: true
724
- }, {
725
- type: 'separator',
726
- supportsViewMode: true
727
- });
728
- if (allowAdvancedToolBarOptions && allowCommentsOnMedia) {
729
- (0, _utils2.updateToFullHeightSeparator)(toolbarButtons);
730
- toolbarButtons.push((0, _comments.commentButton)(intl, state, pluginInjectionApi, onCommentButtonMount));
731
- }
732
708
  if (allowAdvancedToolBarOptions && allowImageEditing && (0, _expValEquals.expValEquals)('platform_editor_add_image_editing', 'isEnabled', true)) {
733
709
  var _mediaNode3$attrs, _mediaNode3$attrs2;
734
710
  var _selectedMediaSingleNode4 = (0, _utils2.getSelectedMediaSingle)(state);
@@ -756,6 +732,30 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
756
732
  });
757
733
  }
758
734
  }
735
+
736
+ // open link
737
+ if (allowLinking && (0, _linking3.shouldShowMediaLinkToolbar)(state) && mediaLinkingState && mediaLinkingState.editable) {
738
+ toolbarButtons.push((0, _linking3.getOpenLinkToolbarButtonOption)(intl, mediaLinkingState, pluginInjectionApi), {
739
+ type: 'separator',
740
+ supportsViewMode: true
741
+ });
742
+ }
743
+ isViewOnly && toolbarButtons.push({
744
+ type: 'copy-button',
745
+ items: [{
746
+ state: state,
747
+ formatMessage: intl.formatMessage,
748
+ nodeType: mediaSingle
749
+ }],
750
+ supportsViewMode: true
751
+ }, {
752
+ type: 'separator',
753
+ supportsViewMode: true
754
+ });
755
+ if (allowAdvancedToolBarOptions && allowCommentsOnMedia) {
756
+ (0, _utils2.updateToFullHeightSeparator)(toolbarButtons);
757
+ toolbarButtons.push((0, _comments.commentButton)(intl, state, pluginInjectionApi, onCommentButtonMount));
758
+ }
759
759
  return toolbarButtons;
760
760
  }
761
761
  };
@@ -139,7 +139,7 @@ const useLatestMediaNode = nextMediaNode => {
139
139
  const previousMediaNode = usePreviousState(nextMediaNode);
140
140
  const [mediaNode, setMediaNode] = React.useState(nextMediaNode);
141
141
  React.useEffect(() => {
142
- if (!previousMediaNode) {
142
+ if (!previousMediaNode || typeof previousMediaNode.eq !== 'function') {
143
143
  return;
144
144
  }
145
145
  if (!previousMediaNode.eq(nextMediaNode)) {
@@ -704,30 +704,6 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
704
704
  });
705
705
  }
706
706
  }
707
-
708
- // open link
709
- if (allowLinking && shouldShowMediaLinkToolbar(state) && mediaLinkingState && mediaLinkingState.editable) {
710
- toolbarButtons.push(getOpenLinkToolbarButtonOption(intl, mediaLinkingState, pluginInjectionApi), {
711
- type: 'separator',
712
- supportsViewMode: true
713
- });
714
- }
715
- isViewOnly && toolbarButtons.push({
716
- type: 'copy-button',
717
- items: [{
718
- state,
719
- formatMessage: intl.formatMessage,
720
- nodeType: mediaSingle
721
- }],
722
- supportsViewMode: true
723
- }, {
724
- type: 'separator',
725
- supportsViewMode: true
726
- });
727
- if (allowAdvancedToolBarOptions && allowCommentsOnMedia) {
728
- updateToFullHeightSeparator(toolbarButtons);
729
- toolbarButtons.push(commentButton(intl, state, pluginInjectionApi, onCommentButtonMount));
730
- }
731
707
  if (allowAdvancedToolBarOptions && allowImageEditing && expValEquals('platform_editor_add_image_editing', 'isEnabled', true)) {
732
708
  var _mediaNode$attrs5, _mediaNode$attrs6;
733
709
  const selectedMediaSingleNode = getSelectedMediaSingle(state);
@@ -755,6 +731,30 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
755
731
  });
756
732
  }
757
733
  }
734
+
735
+ // open link
736
+ if (allowLinking && shouldShowMediaLinkToolbar(state) && mediaLinkingState && mediaLinkingState.editable) {
737
+ toolbarButtons.push(getOpenLinkToolbarButtonOption(intl, mediaLinkingState, pluginInjectionApi), {
738
+ type: 'separator',
739
+ supportsViewMode: true
740
+ });
741
+ }
742
+ isViewOnly && toolbarButtons.push({
743
+ type: 'copy-button',
744
+ items: [{
745
+ state,
746
+ formatMessage: intl.formatMessage,
747
+ nodeType: mediaSingle
748
+ }],
749
+ supportsViewMode: true
750
+ }, {
751
+ type: 'separator',
752
+ supportsViewMode: true
753
+ });
754
+ if (allowAdvancedToolBarOptions && allowCommentsOnMedia) {
755
+ updateToFullHeightSeparator(toolbarButtons);
756
+ toolbarButtons.push(commentButton(intl, state, pluginInjectionApi, onCommentButtonMount));
757
+ }
758
758
  return toolbarButtons;
759
759
  }
760
760
  };
@@ -182,7 +182,7 @@ var useLatestMediaNode = function useLatestMediaNode(nextMediaNode) {
182
182
  mediaNode = _React$useState2[0],
183
183
  setMediaNode = _React$useState2[1];
184
184
  React.useEffect(function () {
185
- if (!previousMediaNode) {
185
+ if (!previousMediaNode || typeof previousMediaNode.eq !== 'function') {
186
186
  return;
187
187
  }
188
188
  if (!previousMediaNode.eq(nextMediaNode)) {
@@ -696,30 +696,6 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
696
696
  });
697
697
  }
698
698
  }
699
-
700
- // open link
701
- if (allowLinking && shouldShowMediaLinkToolbar(state) && mediaLinkingState && mediaLinkingState.editable) {
702
- toolbarButtons.push(getOpenLinkToolbarButtonOption(intl, mediaLinkingState, pluginInjectionApi), {
703
- type: 'separator',
704
- supportsViewMode: true
705
- });
706
- }
707
- isViewOnly && toolbarButtons.push({
708
- type: 'copy-button',
709
- items: [{
710
- state: state,
711
- formatMessage: intl.formatMessage,
712
- nodeType: mediaSingle
713
- }],
714
- supportsViewMode: true
715
- }, {
716
- type: 'separator',
717
- supportsViewMode: true
718
- });
719
- if (allowAdvancedToolBarOptions && allowCommentsOnMedia) {
720
- updateToFullHeightSeparator(toolbarButtons);
721
- toolbarButtons.push(commentButton(intl, state, pluginInjectionApi, onCommentButtonMount));
722
- }
723
699
  if (allowAdvancedToolBarOptions && allowImageEditing && expValEquals('platform_editor_add_image_editing', 'isEnabled', true)) {
724
700
  var _mediaNode3$attrs, _mediaNode3$attrs2;
725
701
  var _selectedMediaSingleNode4 = getSelectedMediaSingle(state);
@@ -747,6 +723,30 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
747
723
  });
748
724
  }
749
725
  }
726
+
727
+ // open link
728
+ if (allowLinking && shouldShowMediaLinkToolbar(state) && mediaLinkingState && mediaLinkingState.editable) {
729
+ toolbarButtons.push(getOpenLinkToolbarButtonOption(intl, mediaLinkingState, pluginInjectionApi), {
730
+ type: 'separator',
731
+ supportsViewMode: true
732
+ });
733
+ }
734
+ isViewOnly && toolbarButtons.push({
735
+ type: 'copy-button',
736
+ items: [{
737
+ state: state,
738
+ formatMessage: intl.formatMessage,
739
+ nodeType: mediaSingle
740
+ }],
741
+ supportsViewMode: true
742
+ }, {
743
+ type: 'separator',
744
+ supportsViewMode: true
745
+ });
746
+ if (allowAdvancedToolBarOptions && allowCommentsOnMedia) {
747
+ updateToFullHeightSeparator(toolbarButtons);
748
+ toolbarButtons.push(commentButton(intl, state, pluginInjectionApi, onCommentButtonMount));
749
+ }
750
750
  return toolbarButtons;
751
751
  }
752
752
  };
@@ -36,4 +36,8 @@ export declare const mediaSpecWithFixedToDOM: () => {
36
36
  toDebugString?: (node: PMNode) => string;
37
37
  leafText?: (node: PMNode) => string;
38
38
  linebreakReplacement?: boolean;
39
+ disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
40
+ pos: number;
41
+ inside: number;
42
+ }, event: DragEvent) => boolean);
39
43
  };
@@ -56,4 +56,8 @@ export declare const mediaGroupSpecWithFixedToDOM: () => {
56
56
  toDebugString?: (node: import("prosemirror-model").Node) => string;
57
57
  leafText?: (node: import("prosemirror-model").Node) => string;
58
58
  linebreakReplacement?: boolean;
59
+ disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
60
+ pos: number;
61
+ inside: number;
62
+ }, event: DragEvent) => boolean);
59
63
  };
@@ -21,4 +21,8 @@ export declare const mediaInlineSpecWithFixedToDOM: () => {
21
21
  toDebugString?: (node: PMNode) => string;
22
22
  leafText?: (node: PMNode) => string;
23
23
  linebreakReplacement?: boolean;
24
+ disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
+ pos: number;
26
+ inside: number;
27
+ }, event: DragEvent) => boolean);
24
28
  };
@@ -36,4 +36,8 @@ export declare const mediaSpecWithFixedToDOM: () => {
36
36
  toDebugString?: (node: PMNode) => string;
37
37
  leafText?: (node: PMNode) => string;
38
38
  linebreakReplacement?: boolean;
39
+ disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
40
+ pos: number;
41
+ inside: number;
42
+ }, event: DragEvent) => boolean);
39
43
  };
@@ -56,4 +56,8 @@ export declare const mediaGroupSpecWithFixedToDOM: () => {
56
56
  toDebugString?: (node: import("prosemirror-model").Node) => string;
57
57
  leafText?: (node: import("prosemirror-model").Node) => string;
58
58
  linebreakReplacement?: boolean;
59
+ disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
60
+ pos: number;
61
+ inside: number;
62
+ }, event: DragEvent) => boolean);
59
63
  };
@@ -21,4 +21,8 @@ export declare const mediaInlineSpecWithFixedToDOM: () => {
21
21
  toDebugString?: (node: PMNode) => string;
22
22
  leafText?: (node: PMNode) => string;
23
23
  linebreakReplacement?: boolean;
24
+ disableDropCursor?: boolean | ((view: import("prosemirror-view").EditorView, pos: {
25
+ pos: number;
26
+ inside: number;
27
+ }, event: DragEvent) => boolean);
24
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "9.4.5",
3
+ "version": "9.4.7",
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.9.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^7.0.0",
38
- "@atlaskit/editor-plugin-annotation": "^7.0.0",
38
+ "@atlaskit/editor-plugin-annotation": "^7.1.0",
39
39
  "@atlaskit/editor-plugin-connectivity": "^7.0.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^7.0.0",
41
41
  "@atlaskit/editor-plugin-editor-disabled": "^7.0.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/editor-plugin-focus": "^6.0.0",
45
45
  "@atlaskit/editor-plugin-grid": "^7.0.0",
46
46
  "@atlaskit/editor-plugin-guideline": "^7.0.0",
47
- "@atlaskit/editor-plugin-interaction": "^13.0.0",
47
+ "@atlaskit/editor-plugin-interaction": "^14.0.0",
48
48
  "@atlaskit/editor-plugin-selection": "^7.0.0",
49
49
  "@atlaskit/editor-plugin-toolbar": "^4.1.0",
50
50
  "@atlaskit/editor-plugin-width": "^8.1.0",
@@ -53,21 +53,21 @@
53
53
  "@atlaskit/editor-tables": "^2.9.0",
54
54
  "@atlaskit/form": "^15.3.0",
55
55
  "@atlaskit/icon": "^30.0.0",
56
- "@atlaskit/icon-lab": "^5.14.0",
57
- "@atlaskit/media-card": "^79.14.0",
56
+ "@atlaskit/icon-lab": "^5.15.0",
57
+ "@atlaskit/media-card": "^79.15.0",
58
58
  "@atlaskit/media-client": "^35.7.0",
59
59
  "@atlaskit/media-client-react": "^4.1.0",
60
60
  "@atlaskit/media-common": "^12.3.0",
61
61
  "@atlaskit/media-filmstrip": "^51.1.0",
62
62
  "@atlaskit/media-picker": "^70.1.0",
63
63
  "@atlaskit/media-ui": "^28.7.0",
64
- "@atlaskit/media-viewer": "^52.6.0",
64
+ "@atlaskit/media-viewer": "^52.7.0",
65
65
  "@atlaskit/platform-feature-flags": "^1.1.0",
66
- "@atlaskit/primitives": "^17.1.0",
66
+ "@atlaskit/primitives": "^18.0.0",
67
67
  "@atlaskit/textfield": "^8.2.0",
68
68
  "@atlaskit/theme": "^21.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^16.31.0",
70
- "@atlaskit/tokens": "^10.1.0",
69
+ "@atlaskit/tmp-editor-statsig": "^17.10.0",
70
+ "@atlaskit/tokens": "^11.0.0",
71
71
  "@atlaskit/tooltip": "^20.14.0",
72
72
  "@babel/runtime": "^7.0.0",
73
73
  "@emotion/react": "^11.7.1",
@@ -78,7 +78,7 @@
78
78
  "uuid": "^3.1.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^111.8.0",
81
+ "@atlaskit/editor-common": "^111.11.0",
82
82
  "@atlaskit/media-core": "^37.0.0",
83
83
  "react": "^18.2.0",
84
84
  "react-dom": "^18.2.0",