@atlaskit/editor-plugin-media 3.0.15 → 3.2.0

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,29 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 3.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#172247](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172247)
8
+ [`67d04382f5777`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/67d04382f5777) -
9
+ Add data-media-vc-wrapper to ProseMirror media signle node
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 3.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#170742](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170742)
20
+ [`9c026e8d50959`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9c026e8d50959) -
21
+ Add data-media-vc-wrapper attribute to Editor MediaCardWrapper component
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 3.0.15
4
28
 
5
29
  ### Patch Changes
@@ -31,6 +31,7 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
31
31
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
32
32
  var _mediaClient = require("@atlaskit/media-client");
33
33
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
34
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
34
35
  var _captions = require("../pm-plugins/commands/captions");
35
36
  var _main = require("../pm-plugins/main");
36
37
  var _mediaCommon = require("../pm-plugins/utils/media-common");
@@ -715,6 +716,9 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
715
716
  if ((_this$reactComponentP2 = this.reactComponentProps.mediaOptions) !== null && _this$reactComponentP2 !== void 0 && _this$reactComponentP2.allowPixelResizing) {
716
717
  domRef.classList.add('media-extended-resize-experience');
717
718
  }
719
+ if ((0, _expValEquals.expValEquals)('platform_editor_media_card_vc_wrapper_attribute', 'isEnabled', true)) {
720
+ domRef.setAttribute('data-media-vc-wrapper', 'true');
721
+ }
718
722
  return domRef;
719
723
  }
720
724
  }, {
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
10
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
11
11
  var _colors = require("@atlaskit/theme/colors");
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
14
  var _toDOMAttrs = require("./toDOMAttrs");
14
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -190,7 +191,7 @@ var getToDom = exports.getToDom = function getToDom(allowPixelResizing) {
190
191
  childMediaWidth: childMediaWidth,
191
192
  mediaSingleDimensionWidth: mediaSingleAttrs === null || mediaSingleAttrs === void 0 ? void 0 : mediaSingleAttrs.width
192
193
  });
193
- return ['div', {
194
+ return ['div', _objectSpread({
194
195
  class: 'mediaSingleView-content-wrap',
195
196
  layout: layout,
196
197
  style: (0, _lazyNodeView.convertToInlineCss)({
@@ -205,7 +206,9 @@ var getToDom = exports.getToDom = function getToDom(allowPixelResizing) {
205
206
  marginLeft: isMediaWrapped ? layout === 'wrap-left' ? 'auto' : HALF_GUTTER_SIZE : 0,
206
207
  width: contentWrapperWidth
207
208
  })
208
- }, content];
209
+ }, (0, _expValEquals.expValEquals)('platform_editor_media_card_vc_wrapper_attribute', 'isEnabled', true) ? {
210
+ 'data-media-vc-wrapper': 'true'
211
+ } : {}), content];
209
212
  };
210
213
  };
211
214
 
@@ -770,7 +770,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
770
770
  nodeType: nodeType,
771
771
  getDomRef: function getDomRef() {
772
772
  var _mediaPluginState$ele;
773
- var element = isSelectedNodeMediaSingle && (0, _platformFeatureFlags.fg)('platform_editor_media_single_toolbar_target') ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(".".concat(_styles.MediaSingleNodeSelector))) || mediaPluginState.element : mediaPluginState.element;
773
+ var element = isSelectedNodeMediaSingle ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(".".concat(_styles.MediaSingleNodeSelector))) || mediaPluginState.element : mediaPluginState.element;
774
774
  return element;
775
775
  }
776
776
  };
@@ -23,6 +23,7 @@ import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/u
23
23
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
24
24
  import { getAttrsFromUrl } from '@atlaskit/media-client';
25
25
  import { fg } from '@atlaskit/platform-feature-flags';
26
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
26
27
  import { insertAndSelectCaptionFromMediaSinglePos } from '../pm-plugins/commands/captions';
27
28
  import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
28
29
  import { isMediaBlobUrlFromAttrs } from '../pm-plugins/utils/media-common';
@@ -619,6 +620,9 @@ class MediaSingleNodeView extends ReactNodeView {
619
620
  if ((_this$reactComponentP4 = this.reactComponentProps.mediaOptions) !== null && _this$reactComponentP4 !== void 0 && _this$reactComponentP4.allowPixelResizing) {
620
621
  domRef.classList.add('media-extended-resize-experience');
621
622
  }
623
+ if (expValEquals('platform_editor_media_card_vc_wrapper_attribute', 'isEnabled', true)) {
624
+ domRef.setAttribute('data-media-vc-wrapper', 'true');
625
+ }
622
626
  return domRef;
623
627
  }
624
628
  getContentDOM() {
@@ -1,6 +1,7 @@
1
1
  import { mediaSingleSpec } from '@atlaskit/adf-schema';
2
2
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
3
  import { N20, N50 } from '@atlaskit/theme/colors';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
6
  import { getAttrsFromNodeMediaSingle } from './toDOMAttrs';
6
7
  const WRAPPED_LAYOUTS = ['wrap-left', 'wrap-right'];
@@ -199,7 +200,10 @@ export const getToDom = allowPixelResizing => node => {
199
200
  marginRight: isMediaWrapped ? layout === 'wrap-right' ? 'auto' : HALF_GUTTER_SIZE : 0,
200
201
  marginLeft: isMediaWrapped ? layout === 'wrap-left' ? 'auto' : HALF_GUTTER_SIZE : 0,
201
202
  width: contentWrapperWidth
202
- })
203
+ }),
204
+ ...(expValEquals('platform_editor_media_card_vc_wrapper_attribute', 'isEnabled', true) ? {
205
+ 'data-media-vc-wrapper': 'true'
206
+ } : {})
203
207
  }, content];
204
208
  };
205
209
 
@@ -768,7 +768,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
768
768
  nodeType,
769
769
  getDomRef: () => {
770
770
  var _mediaPluginState$ele;
771
- const element = isSelectedNodeMediaSingle && fg('platform_editor_media_single_toolbar_target') ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(`.${MediaSingleNodeSelector}`)) || mediaPluginState.element : mediaPluginState.element;
771
+ const element = isSelectedNodeMediaSingle ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(`.${MediaSingleNodeSelector}`)) || mediaPluginState.element : mediaPluginState.element;
772
772
  return element;
773
773
  }
774
774
  };
@@ -36,6 +36,7 @@ import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/u
36
36
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
37
37
  import { getAttrsFromUrl } from '@atlaskit/media-client';
38
38
  import { fg } from '@atlaskit/platform-feature-flags';
39
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
39
40
  import { insertAndSelectCaptionFromMediaSinglePos } from '../pm-plugins/commands/captions';
40
41
  import { MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
41
42
  import { isMediaBlobUrlFromAttrs } from '../pm-plugins/utils/media-common';
@@ -711,6 +712,9 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
711
712
  if ((_this$reactComponentP2 = this.reactComponentProps.mediaOptions) !== null && _this$reactComponentP2 !== void 0 && _this$reactComponentP2.allowPixelResizing) {
712
713
  domRef.classList.add('media-extended-resize-experience');
713
714
  }
715
+ if (expValEquals('platform_editor_media_card_vc_wrapper_attribute', 'isEnabled', true)) {
716
+ domRef.setAttribute('data-media-vc-wrapper', 'true');
717
+ }
714
718
  return domRef;
715
719
  }
716
720
  }, {
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { mediaSingleSpec } from '@atlaskit/adf-schema';
5
5
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
6
6
  import { N20, N50 } from '@atlaskit/theme/colors';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
9
  import { getAttrsFromNodeMediaSingle } from './toDOMAttrs';
9
10
  var WRAPPED_LAYOUTS = ['wrap-left', 'wrap-right'];
@@ -183,7 +184,7 @@ export var getToDom = function getToDom(allowPixelResizing) {
183
184
  childMediaWidth: childMediaWidth,
184
185
  mediaSingleDimensionWidth: mediaSingleAttrs === null || mediaSingleAttrs === void 0 ? void 0 : mediaSingleAttrs.width
185
186
  });
186
- return ['div', {
187
+ return ['div', _objectSpread({
187
188
  class: 'mediaSingleView-content-wrap',
188
189
  layout: layout,
189
190
  style: convertToInlineCss({
@@ -198,7 +199,9 @@ export var getToDom = function getToDom(allowPixelResizing) {
198
199
  marginLeft: isMediaWrapped ? layout === 'wrap-left' ? 'auto' : HALF_GUTTER_SIZE : 0,
199
200
  width: contentWrapperWidth
200
201
  })
201
- }, content];
202
+ }, expValEquals('platform_editor_media_card_vc_wrapper_attribute', 'isEnabled', true) ? {
203
+ 'data-media-vc-wrapper': 'true'
204
+ } : {}), content];
202
205
  };
203
206
  };
204
207
 
@@ -761,7 +761,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
761
761
  nodeType: nodeType,
762
762
  getDomRef: function getDomRef() {
763
763
  var _mediaPluginState$ele;
764
- var element = isSelectedNodeMediaSingle && fg('platform_editor_media_single_toolbar_target') ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(".".concat(MediaSingleNodeSelector))) || mediaPluginState.element : mediaPluginState.element;
764
+ var element = isSelectedNodeMediaSingle ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(".".concat(MediaSingleNodeSelector))) || mediaPluginState.element : mediaPluginState.element;
765
765
  return element;
766
766
  }
767
767
  };
@@ -5,7 +5,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
5
  import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
6
6
  import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
7
7
  import type { ExtractInjectionAPI, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
8
- import { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
8
+ import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
9
9
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
10
10
  import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
@@ -1,4 +1,4 @@
1
- import { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl-next';
2
2
  import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
3
3
  import type { LayoutIcon } from '@atlaskit/editor-common/card';
4
4
  import type { Command, FloatingToolbarItem, FloatingToolbarDropdown, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
@@ -5,7 +5,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
5
  import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
6
6
  import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
7
7
  import type { ExtractInjectionAPI, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
8
- import { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
8
+ import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
9
9
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
10
10
  import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
@@ -1,4 +1,4 @@
1
- import { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl-next';
2
2
  import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
3
3
  import type { LayoutIcon } from '@atlaskit/editor-common/card';
4
4
  import type { Command, FloatingToolbarItem, FloatingToolbarDropdown, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "3.0.15",
3
+ "version": "3.2.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,13 +38,13 @@
38
38
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
39
39
  "@atlaskit/analytics-next": "^11.1.0",
40
40
  "@atlaskit/button": "^23.2.0",
41
- "@atlaskit/editor-common": "^106.6.0",
41
+ "@atlaskit/editor-common": "^106.9.0",
42
42
  "@atlaskit/editor-palette": "^2.1.0",
43
43
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
44
44
  "@atlaskit/editor-plugin-annotation": "^2.9.0",
45
45
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
46
46
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
47
- "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
47
+ "@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
48
48
  "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
49
49
  "@atlaskit/editor-plugin-floating-toolbar": "^4.2.0",
50
50
  "@atlaskit/editor-plugin-focus": "^1.5.0",
@@ -57,21 +57,21 @@
57
57
  "@atlaskit/editor-shared-styles": "^3.4.0",
58
58
  "@atlaskit/editor-tables": "^2.9.0",
59
59
  "@atlaskit/form": "^12.0.0",
60
- "@atlaskit/icon": "^26.4.0",
60
+ "@atlaskit/icon": "^27.0.0",
61
61
  "@atlaskit/media-card": "^79.3.0",
62
- "@atlaskit/media-client": "^33.3.0",
62
+ "@atlaskit/media-client": "^33.4.0",
63
63
  "@atlaskit/media-client-react": "^4.1.0",
64
- "@atlaskit/media-common": "^12.1.0",
64
+ "@atlaskit/media-common": "^12.2.0",
65
65
  "@atlaskit/media-filmstrip": "^50.1.0",
66
66
  "@atlaskit/media-picker": "^69.0.0",
67
- "@atlaskit/media-ui": "^28.2.0",
67
+ "@atlaskit/media-ui": "^28.3.0",
68
68
  "@atlaskit/media-viewer": "^52.2.0",
69
69
  "@atlaskit/platform-feature-flags": "^1.1.0",
70
70
  "@atlaskit/primitives": "^14.8.0",
71
71
  "@atlaskit/textfield": "^8.0.0",
72
72
  "@atlaskit/theme": "^18.0.0",
73
- "@atlaskit/tmp-editor-statsig": "^7.0.0",
74
- "@atlaskit/tokens": "^5.1.0",
73
+ "@atlaskit/tmp-editor-statsig": "^7.1.0",
74
+ "@atlaskit/tokens": "^5.2.0",
75
75
  "@atlaskit/tooltip": "^20.3.0",
76
76
  "@babel/runtime": "^7.0.0",
77
77
  "@emotion/react": "^11.7.1",
@@ -172,9 +172,6 @@
172
172
  "platform_editor_remove_media_inline_feature_flag": {
173
173
  "type": "boolean"
174
174
  },
175
- "platform_editor_media_single_toolbar_target": {
176
- "type": "boolean"
177
- },
178
175
  "platform_editor_controls_patch_6": {
179
176
  "type": "boolean"
180
177
  },