@atlaskit/editor-plugin-media 8.4.13 → 8.4.14

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,13 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 8.4.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5d8ba7e59f96f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d8ba7e59f96f) -
8
+ simplify the media single resizer classnames
9
+ - Updated dependencies
10
+
3
11
  ## 8.4.13
4
12
 
5
13
  ### Patch Changes
@@ -22,6 +22,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
22
22
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
24
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
26
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
26
27
  var _main = require("../../pm-plugins/main");
27
28
  var _analytics = require("../../pm-plugins/utils/analytics");
@@ -255,6 +256,14 @@ var ResizableMediaSingleNextFunctional = exports.ResizableMediaSingleNextFunctio
255
256
  // while is not resizing, we take 100% as min-width if the container width is less than the min-width
256
257
  var minViewWidth = isResizing ? minWidth : "min(".concat(minWidth, "px, 100%)");
257
258
  var resizerNextClassName = (0, _react.useMemo)(function () {
259
+ if ((0, _expValEquals.expValEquals)('platform_editor_resizer_styles_cleanup', 'isEnabled', true)) {
260
+ var _classNameNext = (0, _classnames.default)(_styles.richMediaClassName, "image-".concat(layout), isResizing ? 'is-resizing' : 'not-resizing', className, _styles.resizerItemClassName, {
261
+ 'display-handle': selected,
262
+ 'richMedia-selected': selected,
263
+ 'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
264
+ });
265
+ return _classNameNext;
266
+ }
258
267
  // TODO: ED-26962 - Clean up where this lives and how it gets generated
259
268
  var classNameNext = (0, _classnames.default)(_styles.richMediaClassName, "image-".concat(layout), isResizing ? 'is-resizing' : 'not-resizing', className, {
260
269
  'richMedia-selected': selected,
@@ -11,13 +11,14 @@ import throttle from 'lodash/throttle';
11
11
  import { findClosestSnap, generateDefaultGuidelines, generateDynamicGuidelines, getGuidelineSnaps, getGuidelinesWithHighlights, getGuidelineTypeFromKey, getRelativeGuidelines, getRelativeGuideSnaps } from '@atlaskit/editor-common/guideline';
12
12
  import { calcMediaSingleMaxWidth, DEFAULT_IMAGE_WIDTH, MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
13
13
  import { ResizerNext } from '@atlaskit/editor-common/resizer';
14
- import { resizerStyles, richMediaClassName } from '@atlaskit/editor-common/styles';
14
+ import { resizerItemClassName, resizerStyles, richMediaClassName } from '@atlaskit/editor-common/styles';
15
15
  import { calcPctFromPx, handleSides, imageAlignmentMap, wrappedLayouts } from '@atlaskit/editor-common/ui';
16
16
  import { nonWrappedLayouts } from '@atlaskit/editor-common/utils';
17
17
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
18
18
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
19
19
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
20
20
  import { fg } from '@atlaskit/platform-feature-flags';
21
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
22
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
23
  import { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
23
24
  import { getMediaResizeAnalyticsEvent } from '../../pm-plugins/utils/analytics';
@@ -235,6 +236,14 @@ export const ResizableMediaSingleNextFunctional = props => {
235
236
  // while is not resizing, we take 100% as min-width if the container width is less than the min-width
236
237
  const minViewWidth = isResizing ? minWidth : `min(${minWidth}px, 100%)`;
237
238
  const resizerNextClassName = useMemo(() => {
239
+ if (expValEquals('platform_editor_resizer_styles_cleanup', 'isEnabled', true)) {
240
+ const classNameNext = classnames(richMediaClassName, `image-${layout}`, isResizing ? 'is-resizing' : 'not-resizing', className, resizerItemClassName, {
241
+ 'display-handle': selected,
242
+ 'richMedia-selected': selected,
243
+ 'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
244
+ });
245
+ return classNameNext;
246
+ }
238
247
  // TODO: ED-26962 - Clean up where this lives and how it gets generated
239
248
  const classNameNext = classnames(richMediaClassName, `image-${layout}`, isResizing ? 'is-resizing' : 'not-resizing', className, {
240
249
  'richMedia-selected': selected,
@@ -13,13 +13,14 @@ import throttle from 'lodash/throttle';
13
13
  import { findClosestSnap, generateDefaultGuidelines, generateDynamicGuidelines, getGuidelineSnaps, getGuidelinesWithHighlights, getGuidelineTypeFromKey, getRelativeGuidelines, getRelativeGuideSnaps } from '@atlaskit/editor-common/guideline';
14
14
  import { calcMediaSingleMaxWidth, DEFAULT_IMAGE_WIDTH, MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
15
15
  import { ResizerNext } from '@atlaskit/editor-common/resizer';
16
- import { resizerStyles, richMediaClassName } from '@atlaskit/editor-common/styles';
16
+ import { resizerItemClassName, resizerStyles, richMediaClassName } from '@atlaskit/editor-common/styles';
17
17
  import { calcPctFromPx, handleSides, imageAlignmentMap, wrappedLayouts } from '@atlaskit/editor-common/ui';
18
18
  import { nonWrappedLayouts } from '@atlaskit/editor-common/utils';
19
19
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
20
20
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
21
21
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
22
22
  import { fg } from '@atlaskit/platform-feature-flags';
23
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
23
24
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
24
25
  import { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
25
26
  import { getMediaResizeAnalyticsEvent } from '../../pm-plugins/utils/analytics';
@@ -245,6 +246,14 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
245
246
  // while is not resizing, we take 100% as min-width if the container width is less than the min-width
246
247
  var minViewWidth = isResizing ? minWidth : "min(".concat(minWidth, "px, 100%)");
247
248
  var resizerNextClassName = useMemo(function () {
249
+ if (expValEquals('platform_editor_resizer_styles_cleanup', 'isEnabled', true)) {
250
+ var _classNameNext = classnames(richMediaClassName, "image-".concat(layout), isResizing ? 'is-resizing' : 'not-resizing', className, resizerItemClassName, {
251
+ 'display-handle': selected,
252
+ 'richMedia-selected': selected,
253
+ 'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
254
+ });
255
+ return _classNameNext;
256
+ }
248
257
  // TODO: ED-26962 - Clean up where this lives and how it gets generated
249
258
  var classNameNext = classnames(richMediaClassName, "image-".concat(layout), isResizing ? 'is-resizing' : 'not-resizing', className, {
250
259
  'richMedia-selected': selected,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "8.4.13",
3
+ "version": "8.4.14",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/form": "^14.3.0",
55
55
  "@atlaskit/icon": "^29.0.0",
56
56
  "@atlaskit/icon-lab": "^5.12.0",
57
- "@atlaskit/media-card": "^79.8.0",
57
+ "@atlaskit/media-card": "^79.9.0",
58
58
  "@atlaskit/media-client": "^35.6.0",
59
59
  "@atlaskit/media-client-react": "^4.1.0",
60
60
  "@atlaskit/media-common": "^12.3.0",
@@ -66,7 +66,7 @@
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.0.0",
69
+ "@atlaskit/tmp-editor-statsig": "^14.1.0",
70
70
  "@atlaskit/tokens": "^8.4.0",
71
71
  "@atlaskit/tooltip": "^20.10.0",
72
72
  "@babel/runtime": "^7.0.0",