@atlaskit/editor-plugin-media 5.1.6 → 5.1.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,15 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 5.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#185940](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185940)
8
+ [`456bee393c4d3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/456bee393c4d3) -
9
+ [ux] When editor-area is less than 768px wide, we reduce editor gutters to 24px in Full-page
10
+ editor.
11
+ - Updated dependencies
12
+
3
13
  ## 5.1.6
4
14
 
5
15
  ### 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 _main = require("../../pm-plugins/main");
26
27
  var _analytics = require("../../pm-plugins/utils/analytics");
27
28
  var _checkMediaType = require("../../pm-plugins/utils/check-media-type");
@@ -87,11 +88,12 @@ var calcUnwrappedLayout = function calcUnwrappedLayout(width, containerWidth, co
87
88
  if (width <= contentWidth) {
88
89
  return 'center';
89
90
  }
90
- if (width < Math.min(containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2, _editorSharedStyles.akEditorFullWidthLayoutWidth)) {
91
+ var padding = containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0, _expValEquals.expValEquals)('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? _editorSharedStyles.akEditorGutterPaddingReduced : (0, _editorSharedStyles.akEditorGutterPaddingDynamic)();
92
+ if (width < Math.min(containerWidth - padding * 2, _editorSharedStyles.akEditorFullWidthLayoutWidth)) {
91
93
  return 'wide';
92
94
  }
93
95
 
94
- // set full width to be containerWidth - akEditorGutterPaddingDynamic() * 2
96
+ // set full width to be containerWidth - padding * 2
95
97
  // instead of containerWidth - akEditorBreakoutPadding,
96
98
  // so that we have image aligned with text
97
99
  return 'full-width';
@@ -16,8 +16,9 @@ import { calcPctFromPx, handleSides, imageAlignmentMap, wrappedLayouts } from '@
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
- import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
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 { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
22
23
  import { getMediaResizeAnalyticsEvent } from '../../pm-plugins/utils/analytics';
23
24
  import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
@@ -78,11 +79,12 @@ const calcUnwrappedLayout = (width, containerWidth, contentWidth, fullWidthMode,
78
79
  if (width <= contentWidth) {
79
80
  return 'center';
80
81
  }
81
- if (width < Math.min(containerWidth - akEditorGutterPaddingDynamic() * 2, akEditorFullWidthLayoutWidth)) {
82
+ const padding = containerWidth <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
83
+ if (width < Math.min(containerWidth - padding * 2, akEditorFullWidthLayoutWidth)) {
82
84
  return 'wide';
83
85
  }
84
86
 
85
- // set full width to be containerWidth - akEditorGutterPaddingDynamic() * 2
87
+ // set full width to be containerWidth - padding * 2
86
88
  // instead of containerWidth - akEditorBreakoutPadding,
87
89
  // so that we have image aligned with text
88
90
  return 'full-width';
@@ -18,8 +18,9 @@ import { calcPctFromPx, handleSides, imageAlignmentMap, wrappedLayouts } from '@
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
- import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
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 { MEDIA_PLUGIN_IS_RESIZING_KEY, MEDIA_PLUGIN_RESIZING_WIDTH_KEY } from '../../pm-plugins/main';
24
25
  import { getMediaResizeAnalyticsEvent } from '../../pm-plugins/utils/analytics';
25
26
  import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
@@ -77,11 +78,12 @@ var calcUnwrappedLayout = function calcUnwrappedLayout(width, containerWidth, co
77
78
  if (width <= contentWidth) {
78
79
  return 'center';
79
80
  }
80
- if (width < Math.min(containerWidth - akEditorGutterPaddingDynamic() * 2, akEditorFullWidthLayoutWidth)) {
81
+ var padding = containerWidth <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
82
+ if (width < Math.min(containerWidth - padding * 2, akEditorFullWidthLayoutWidth)) {
81
83
  return 'wide';
82
84
  }
83
85
 
84
- // set full width to be containerWidth - akEditorGutterPaddingDynamic() * 2
86
+ // set full width to be containerWidth - padding * 2
85
87
  // instead of containerWidth - akEditorBreakoutPadding,
86
88
  // so that we have image aligned with text
87
89
  return 'full-width';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "5.1.6",
3
+ "version": "5.1.7",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/editor-plugin-selection": "^3.0.0",
53
53
  "@atlaskit/editor-plugin-width": "^4.0.0",
54
54
  "@atlaskit/editor-prosemirror": "7.0.0",
55
- "@atlaskit/editor-shared-styles": "^3.4.0",
55
+ "@atlaskit/editor-shared-styles": "^3.5.0",
56
56
  "@atlaskit/editor-tables": "^2.9.0",
57
57
  "@atlaskit/form": "^12.0.0",
58
58
  "@atlaskit/icon": "^27.3.0",
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/primitives": "^14.10.0",
70
70
  "@atlaskit/textfield": "^8.0.0",
71
71
  "@atlaskit/theme": "^19.0.0",
72
- "@atlaskit/tmp-editor-statsig": "^9.7.0",
72
+ "@atlaskit/tmp-editor-statsig": "^9.8.0",
73
73
  "@atlaskit/tokens": "^5.5.0",
74
74
  "@atlaskit/tooltip": "^20.3.0",
75
75
  "@babel/runtime": "^7.0.0",