@atlaskit/editor-common 74.56.0 → 74.56.1

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,11 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 74.56.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2c12cd28cb8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2c12cd28cb8) - Enforce scale-down approach for wide media single node in renderer
8
+
3
9
  ## 74.56.0
4
10
 
5
11
  ### Minor Changes
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "74.56.0";
19
+ var packageVersion = "74.56.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "74.56.0";
27
+ var packageVersion = "74.56.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -99,7 +99,8 @@ function MediaSingle(_ref) {
99
99
  layout: layout,
100
100
  containerWidth: containerWidth,
101
101
  mediaSingleWidth: mediaSingleWidth,
102
- fullWidthMode: fullWidthMode
102
+ fullWidthMode: fullWidthMode,
103
+ isExtendedResizeExperienceOn: isPixelWidth
103
104
  }),
104
105
  "data-layout": layout,
105
106
  "data-width": mediaSingleWidth,
@@ -124,7 +124,11 @@ var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
124
124
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
125
125
  _ref$isNestedNode = _ref.isNestedNode,
126
126
  isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
127
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &[class*='not-resizing'] {\n ", "\n }\n\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' && (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 100%;\n "]))), calcMaxWidth(layout, containerWidth), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), !isNestedNode && "".concat(_utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);"), float(layout), calcMargin(layout), isImageAligned(layout));
127
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] &,\n li & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &[class*='not-resizing'] {\n ", "\n }\n\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
128
+ /* This causes issues for new experience where we don't strip layout attributes
129
+ when copying top-level node and pasting into a table/layout,
130
+ because full-width layout will remain, causing node to be edge-to-edge */
131
+ !isExtendedResizeExperienceOn && (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 100%;\n "]))), isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), isNestedNode ? /* Make nested node appear responsives when resizing table cell */"max-width: 100%;" : "".concat(_utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);"), float(layout), calcMargin(layout), isImageAligned(layout));
128
132
  };
129
133
  exports.MediaSingleDimensionHelper = MediaSingleDimensionHelper;
130
134
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "74.56.0";
3
+ const packageVersion = "74.56.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  import { borderRadius } from '@atlaskit/theme/constants';
9
9
  import Layer from '../Layer';
10
10
  const packageName = "@atlaskit/editor-common";
11
- const packageVersion = "74.56.0";
11
+ const packageVersion = "74.56.1";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -83,7 +83,8 @@ export default function MediaSingle({
83
83
  layout,
84
84
  containerWidth,
85
85
  mediaSingleWidth,
86
- fullWidthMode
86
+ fullWidthMode,
87
+ isExtendedResizeExperienceOn: isPixelWidth
87
88
  }),
88
89
  "data-layout": layout,
89
90
  "data-width": mediaSingleWidth,
@@ -103,21 +103,27 @@ export const MediaSingleDimensionHelper = ({
103
103
  pctWidth,
104
104
  mediaSingleWidth,
105
105
  width,
106
+ // original media width
106
107
  isExtendedResizeExperienceOn,
107
108
  isNestedNode = false
108
109
  }) => css`
109
110
  /* For nested rich media items, set max-width to 100% */
110
111
  tr &,
111
112
  [data-layout-column] &,
112
- [data-node-type='expand'] & {
113
+ [data-node-type='expand'] &,
114
+ li & {
113
115
  max-width: 100%;
114
116
  }
115
117
 
116
- width: ${mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized)};
117
- ${layout === 'full-width' && css`
118
+ width: ${isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized)};
119
+ ${layout === 'full-width' &&
120
+ /* This causes issues for new experience where we don't strip layout attributes
121
+ when copying top-level node and pasting into a table/layout,
122
+ because full-width layout will remain, causing node to be edge-to-edge */
123
+ !isExtendedResizeExperienceOn && css`
118
124
  min-width: 100%;
119
125
  `}
120
- max-width: ${calcMaxWidth(layout, containerWidth)};
126
+ max-width: ${isExtendedResizeExperienceOn ? `${containerWidth}px` : calcMaxWidth(layout, containerWidth)};
121
127
 
122
128
  ${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
123
129
  .new-file-experience-wrapper {
@@ -129,8 +135,9 @@ export const MediaSingleDimensionHelper = ({
129
135
  }`}
130
136
 
131
137
  &[class*='not-resizing'] {
132
- ${!isNestedNode && `${nonWrappedLayouts.includes(layout) && `margin-left: 50%;
133
- transform: translateX(-50%);`}`}
138
+ ${isNestedNode ? /* Make nested node appear responsives when resizing table cell */
139
+ `max-width: 100%;` : `${nonWrappedLayouts.includes(layout) && `margin-left: 50%;
140
+ transform: translateX(-50%);`}`}
134
141
  }
135
142
 
136
143
  float: ${float(layout)};
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "74.56.0";
9
+ var packageVersion = "74.56.1";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.56.0";
21
+ var packageVersion = "74.56.1";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -89,7 +89,8 @@ export default function MediaSingle(_ref) {
89
89
  layout: layout,
90
90
  containerWidth: containerWidth,
91
91
  mediaSingleWidth: mediaSingleWidth,
92
- fullWidthMode: fullWidthMode
92
+ fullWidthMode: fullWidthMode,
93
+ isExtendedResizeExperienceOn: isPixelWidth
93
94
  }),
94
95
  "data-layout": layout,
95
96
  "data-width": mediaSingleWidth,
@@ -115,7 +115,11 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
115
115
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
116
116
  _ref$isNestedNode = _ref.isNestedNode,
117
117
  isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
118
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &[class*='not-resizing'] {\n ", "\n }\n\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 100%;\n "]))), calcMaxWidth(layout, containerWidth), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), !isNestedNode && "".concat(nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);"), float(layout), calcMargin(layout), isImageAligned(layout));
118
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] &,\n li & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &[class*='not-resizing'] {\n ", "\n }\n\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
119
+ /* This causes issues for new experience where we don't strip layout attributes
120
+ when copying top-level node and pasting into a table/layout,
121
+ because full-width layout will remain, causing node to be edge-to-edge */
122
+ !isExtendedResizeExperienceOn && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 100%;\n "]))), isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), isNestedNode ? /* Make nested node appear responsives when resizing table cell */"max-width: 100%;" : "".concat(nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);"), float(layout), calcMargin(layout), isImageAligned(layout));
119
123
  };
120
124
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
121
125
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -25,7 +25,7 @@ export interface MediaSingleWrapperProps {
25
25
  layout: MediaSingleLayout;
26
26
  /**
27
27
  * @private
28
- * @deprecated Use {@link MediaSingleWrapperProps.mediaSingleWidth} instead.
28
+ * @deprecated Use {@link MediaSingleWrapperProps["mediaSingleWidth"]} instead.
29
29
  * Cleanup ticket: https://product-fabric.atlassian.net/browse/ED-19076
30
30
  */
31
31
  pctWidth?: number;
@@ -25,7 +25,7 @@ export interface MediaSingleWrapperProps {
25
25
  layout: MediaSingleLayout;
26
26
  /**
27
27
  * @private
28
- * @deprecated Use {@link MediaSingleWrapperProps.mediaSingleWidth} instead.
28
+ * @deprecated Use {@link MediaSingleWrapperProps["mediaSingleWidth"]} instead.
29
29
  * Cleanup ticket: https://product-fabric.atlassian.net/browse/ED-19076
30
30
  */
31
31
  pctWidth?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.56.0",
3
+ "version": "74.56.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"