@atlaskit/editor-plugin-media 3.0.15 → 3.1.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,17 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#170742](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170742)
8
+ [`9c026e8d50959`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9c026e8d50959) -
9
+ Add data-media-vc-wrapper attribute to Editor MediaCardWrapper component
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 3.0.15
4
16
 
5
17
  ### Patch Changes
@@ -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
  };
@@ -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
  };
@@ -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.1.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
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",
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/form": "^12.0.0",
60
60
  "@atlaskit/icon": "^26.4.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
64
  "@atlaskit/media-common": "^12.1.0",
65
65
  "@atlaskit/media-filmstrip": "^50.1.0",
@@ -70,8 +70,8 @@
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
  },