@atlaskit/editor-common 74.38.0 → 74.38.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.38.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4cbae03c15c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4cbae03c15c) - Set maxWidth for ResizerNext to stop lable updating when reaching max width
8
+
3
9
  ## 74.38.0
4
10
 
5
11
  ### Minor Changes
@@ -97,7 +97,7 @@ var calcLegacyWideWidth = function calcLegacyWideWidth(containerWidth, origWidth
97
97
  };
98
98
 
99
99
  /**
100
- * Calculate maximum width allowed for media single in new experience
100
+ * Calculate maximum width allowed for media single node in fix-width editor in new experience
101
101
  * @param containerWidth width of editor container
102
102
  */
103
103
  var calcMediaSingleMaxWidth = function calcMediaSingleMaxWidth(containerWidth) {
@@ -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.38.0";
19
+ var packageVersion = "74.38.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.38.0";
27
+ var packageVersion = "74.38.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -95,16 +95,6 @@ var getEffectiveFullWidth = function getEffectiveFullWidth(containerWidth, fullW
95
95
  }
96
96
  return "".concat((0, _mediaSingle.calcMediaSingleMaxWidth)(containerWidth), "px");
97
97
  };
98
- var calcMaxWidthWhenResizing = function calcMaxWidthWhenResizing(containerWidth, fullWidthMode, isNestedNode) {
99
- if (isNestedNode) {
100
- return '100%';
101
- }
102
- // non-nested node can resize up to full width
103
- return getEffectiveFullWidth(containerWidth, fullWidthMode);
104
- };
105
- var calcMaxWidthWhenNotResizing = function calcMaxWidthWhenNotResizing(containerWidth, mediaSingleWidth) {
106
- return "".concat(Math.min(mediaSingleWidth, containerWidth - _editorSharedStyles.akEditorGutterPadding * 2), "px");
107
- };
108
98
  function calcMargin(layout) {
109
99
  switch (layout) {
110
100
  case 'wrap-right':
@@ -141,7 +131,7 @@ var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
141
131
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
142
132
  _ref$isNestedNode = _ref.isNestedNode,
143
133
  isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
144
- 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 /* Handles responsiveness of non-nested, not-resizing nodes in editor */\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 max-width: ".concat(calcMaxWidthWhenResizing(containerWidth, fullWidthMode, isNestedNode), ";\n\n ").concat(_utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), !isNestedNode && "max-width: ".concat(layout !== 'full-width' && mediaSingleWidth && calcMaxWidthWhenNotResizing(containerWidth, mediaSingleWidth), ";\n\n ").concat(_utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n\n // override min-width to counteract max-width set in old experience\n ").concat(layout === 'full-width' && "min-width: ".concat(getEffectiveFullWidth(containerWidth, fullWidthMode), " !important;"), ";"), float(layout), calcMargin(layout), isImageAligned(layout));
134
+ 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%);", "\n\n // override min-width to counteract max-width set by ResizerNext inline style\n ").concat(layout === 'full-width' && "min-width: ".concat(getEffectiveFullWidth(containerWidth, fullWidthMode), " !important;"), ";"), float(layout), calcMargin(layout), isImageAligned(layout));
145
135
  };
146
136
  exports.MediaSingleDimensionHelper = MediaSingleDimensionHelper;
147
137
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
@@ -21,7 +21,7 @@ var nonWrappedLayouts = ['center', 'wide', 'full-width'];
21
21
  exports.nonWrappedLayouts = nonWrappedLayouts;
22
22
  var floatingLayouts = ['wrap-left', 'wrap-right'];
23
23
  exports.floatingLayouts = floatingLayouts;
24
- var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos) {
24
+ var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos, includeMoreParentNodeTypes) {
25
25
  if (typeof pos !== 'number' || isNaN(pos) || !view) {
26
26
  return false;
27
27
  }
@@ -29,8 +29,11 @@ var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, p
29
29
  var _view$state$schema$no = view.state.schema.nodes,
30
30
  expand = _view$state$schema$no.expand,
31
31
  nestedExpand = _view$state$schema$no.nestedExpand,
32
- layoutColumn = _view$state$schema$no.layoutColumn;
33
- return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn]);
32
+ layoutColumn = _view$state$schema$no.layoutColumn,
33
+ tableCell = _view$state$schema$no.tableCell,
34
+ listItem = _view$state$schema$no.listItem;
35
+ var parentNodeTypes = [expand, nestedExpand, layoutColumn];
36
+ return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, includeMoreParentNodeTypes ? [].concat(parentNodeTypes, [tableCell, listItem]) : parentNodeTypes);
34
37
  };
35
38
  exports.isRichMediaInsideOfBlockNode = isRichMediaInsideOfBlockNode;
36
39
  var alignAttributes = function alignAttributes(layout, oldAttrs) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.38.0",
3
+ "version": "74.38.1",
4
4
  "sideEffects": false
5
5
  }
@@ -84,7 +84,7 @@ const calcLegacyWideWidth = (containerWidth, origWidth, contentWidth) => {
84
84
  };
85
85
 
86
86
  /**
87
- * Calculate maximum width allowed for media single in new experience
87
+ * Calculate maximum width allowed for media single node in fix-width editor in new experience
88
88
  * @param containerWidth width of editor container
89
89
  */
90
90
  export const calcMediaSingleMaxWidth = containerWidth => {
@@ -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.38.0";
3
+ const packageVersion = "74.38.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.38.0";
11
+ const packageVersion = "74.38.1";
12
12
  const halfFocusRing = 1;
13
13
  const dropOffset = '0, 8';
14
14
  class DropList extends Component {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import { css, jsx } from '@emotion/react';
5
- import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
5
+ import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
6
6
  import { calcMediaSingleMaxWidth } from '../../media-single';
7
7
  import { nonWrappedLayouts } from '../../utils';
8
8
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
@@ -78,16 +78,6 @@ const getEffectiveFullWidth = (containerWidth, fullWidthMode) => {
78
78
  }
79
79
  return `${calcMediaSingleMaxWidth(containerWidth)}px`;
80
80
  };
81
- const calcMaxWidthWhenResizing = (containerWidth, fullWidthMode, isNestedNode) => {
82
- if (isNestedNode) {
83
- return '100%';
84
- }
85
- // non-nested node can resize up to full width
86
- return getEffectiveFullWidth(containerWidth, fullWidthMode);
87
- };
88
- const calcMaxWidthWhenNotResizing = (containerWidth, mediaSingleWidth) => {
89
- return `${Math.min(mediaSingleWidth, containerWidth - akEditorGutterPadding * 2)}px`;
90
- };
91
81
  function calcMargin(layout) {
92
82
  switch (layout) {
93
83
  case 'wrap-right':
@@ -135,25 +125,21 @@ export const MediaSingleDimensionHelper = ({
135
125
  min-width: 100%;
136
126
  `}
137
127
  max-width: ${calcMaxWidth(layout, containerWidth)};
128
+
138
129
  ${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
139
130
  .new-file-experience-wrapper {
140
131
  box-shadow: none !important;
141
132
  }
142
133
 
143
- max-width: ${calcMaxWidthWhenResizing(containerWidth, fullWidthMode, isNestedNode)};
144
-
145
- ${nonWrappedLayouts.includes(layout) && `margin-left: 50%;
134
+ ${!isNestedNode && nonWrappedLayouts.includes(layout) && `margin-left: 50%;
146
135
  transform: translateX(-50%);`}
147
136
  }`}
148
137
 
149
- /* Handles responsiveness of non-nested, not-resizing nodes in editor */
150
138
  &[class*='not-resizing'] {
151
- ${!isNestedNode && `max-width: ${layout !== 'full-width' && mediaSingleWidth && calcMaxWidthWhenNotResizing(containerWidth, mediaSingleWidth)};
152
-
153
- ${nonWrappedLayouts.includes(layout) && `margin-left: 50%;
139
+ ${!isNestedNode && `${nonWrappedLayouts.includes(layout) && `margin-left: 50%;
154
140
  transform: translateX(-50%);`}
155
141
 
156
- // override min-width to counteract max-width set in old experience
142
+ // override min-width to counteract max-width set by ResizerNext inline style
157
143
  ${layout === 'full-width' && `min-width: ${getEffectiveFullWidth(containerWidth, fullWidthMode)} !important;`};`}
158
144
  }
159
145
 
@@ -6,7 +6,7 @@ export const shouldAddDefaultWrappedWidth = (layout, width, lineLength) => {
6
6
  };
7
7
  export const nonWrappedLayouts = ['center', 'wide', 'full-width'];
8
8
  export const floatingLayouts = ['wrap-left', 'wrap-right'];
9
- export const isRichMediaInsideOfBlockNode = (view, pos) => {
9
+ export const isRichMediaInsideOfBlockNode = (view, pos, includeMoreParentNodeTypes) => {
10
10
  if (typeof pos !== 'number' || isNaN(pos) || !view) {
11
11
  return false;
12
12
  }
@@ -14,9 +14,12 @@ export const isRichMediaInsideOfBlockNode = (view, pos) => {
14
14
  const {
15
15
  expand,
16
16
  nestedExpand,
17
- layoutColumn
17
+ layoutColumn,
18
+ tableCell,
19
+ listItem
18
20
  } = view.state.schema.nodes;
19
- return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
21
+ const parentNodeTypes = [expand, nestedExpand, layoutColumn];
22
+ return !!findParentNodeOfTypeClosestToPos($pos, includeMoreParentNodeTypes ? [...parentNodeTypes, tableCell, listItem] : parentNodeTypes);
20
23
  };
21
24
  export const alignAttributes = (layout, oldAttrs, gridSize = 12, originalWidth, lineLength) => {
22
25
  let width = oldAttrs.width;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.38.0",
3
+ "version": "74.38.1",
4
4
  "sideEffects": false
5
5
  }
@@ -87,7 +87,7 @@ var calcLegacyWideWidth = function calcLegacyWideWidth(containerWidth, origWidth
87
87
  };
88
88
 
89
89
  /**
90
- * Calculate maximum width allowed for media single in new experience
90
+ * Calculate maximum width allowed for media single node in fix-width editor in new experience
91
91
  * @param containerWidth width of editor container
92
92
  */
93
93
  export var calcMediaSingleMaxWidth = function calcMediaSingleMaxWidth(containerWidth) {
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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.38.0";
9
+ var packageVersion = "74.38.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.38.0";
21
+ var packageVersion = "74.38.1";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -6,7 +6,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
6
6
 
7
7
  import React from 'react';
8
8
  import { css, jsx } from '@emotion/react';
9
- import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
9
+ import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
10
10
  import { calcMediaSingleMaxWidth } from '../../media-single';
11
11
  import { nonWrappedLayouts } from '../../utils';
12
12
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
@@ -86,16 +86,6 @@ var getEffectiveFullWidth = function getEffectiveFullWidth(containerWidth, fullW
86
86
  }
87
87
  return "".concat(calcMediaSingleMaxWidth(containerWidth), "px");
88
88
  };
89
- var calcMaxWidthWhenResizing = function calcMaxWidthWhenResizing(containerWidth, fullWidthMode, isNestedNode) {
90
- if (isNestedNode) {
91
- return '100%';
92
- }
93
- // non-nested node can resize up to full width
94
- return getEffectiveFullWidth(containerWidth, fullWidthMode);
95
- };
96
- var calcMaxWidthWhenNotResizing = function calcMaxWidthWhenNotResizing(containerWidth, mediaSingleWidth) {
97
- return "".concat(Math.min(mediaSingleWidth, containerWidth - akEditorGutterPadding * 2), "px");
98
- };
99
89
  function calcMargin(layout) {
100
90
  switch (layout) {
101
91
  case 'wrap-right':
@@ -132,7 +122,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
132
122
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
133
123
  _ref$isNestedNode = _ref.isNestedNode,
134
124
  isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
135
- 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 /* Handles responsiveness of non-nested, not-resizing nodes in editor */\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 max-width: ".concat(calcMaxWidthWhenResizing(containerWidth, fullWidthMode, isNestedNode), ";\n\n ").concat(nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), !isNestedNode && "max-width: ".concat(layout !== 'full-width' && mediaSingleWidth && calcMaxWidthWhenNotResizing(containerWidth, mediaSingleWidth), ";\n\n ").concat(nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n\n // override min-width to counteract max-width set in old experience\n ").concat(layout === 'full-width' && "min-width: ".concat(getEffectiveFullWidth(containerWidth, fullWidthMode), " !important;"), ";"), float(layout), calcMargin(layout), isImageAligned(layout));
125
+ 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%);", "\n\n // override min-width to counteract max-width set by ResizerNext inline style\n ").concat(layout === 'full-width' && "min-width: ".concat(getEffectiveFullWidth(containerWidth, fullWidthMode), " !important;"), ";"), float(layout), calcMargin(layout), isImageAligned(layout));
136
126
  };
137
127
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
138
128
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -9,7 +9,7 @@ export var shouldAddDefaultWrappedWidth = function shouldAddDefaultWrappedWidth(
9
9
  };
10
10
  export var nonWrappedLayouts = ['center', 'wide', 'full-width'];
11
11
  export var floatingLayouts = ['wrap-left', 'wrap-right'];
12
- export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos) {
12
+ export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos, includeMoreParentNodeTypes) {
13
13
  if (typeof pos !== 'number' || isNaN(pos) || !view) {
14
14
  return false;
15
15
  }
@@ -17,8 +17,11 @@ export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(
17
17
  var _view$state$schema$no = view.state.schema.nodes,
18
18
  expand = _view$state$schema$no.expand,
19
19
  nestedExpand = _view$state$schema$no.nestedExpand,
20
- layoutColumn = _view$state$schema$no.layoutColumn;
21
- return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
20
+ layoutColumn = _view$state$schema$no.layoutColumn,
21
+ tableCell = _view$state$schema$no.tableCell,
22
+ listItem = _view$state$schema$no.listItem;
23
+ var parentNodeTypes = [expand, nestedExpand, layoutColumn];
24
+ return !!findParentNodeOfTypeClosestToPos($pos, includeMoreParentNodeTypes ? [].concat(parentNodeTypes, [tableCell, listItem]) : parentNodeTypes);
22
25
  };
23
26
  export var alignAttributes = function alignAttributes(layout, oldAttrs) {
24
27
  var gridSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 12;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.38.0",
3
+ "version": "74.38.1",
4
4
  "sideEffects": false
5
5
  }
@@ -34,7 +34,7 @@ export interface calcMediaSinglePixelWidthProps {
34
34
  */
35
35
  export declare const calcMediaSinglePixelWidth: ({ width, widthType, origWidth, layout, contentWidth, containerWidth, gutterOffset, }: calcMediaSinglePixelWidthProps) => number;
36
36
  /**
37
- * Calculate maximum width allowed for media single in new experience
37
+ * Calculate maximum width allowed for media single node in fix-width editor in new experience
38
38
  * @param containerWidth width of editor container
39
39
  */
40
40
  export declare const calcMediaSingleMaxWidth: (containerWidth: number) => number;
@@ -4,6 +4,6 @@ import { SnapPointsProps } from '../types';
4
4
  export declare const shouldAddDefaultWrappedWidth: (layout: RichMediaLayout, width?: number, lineLength?: number) => boolean | 0 | undefined;
5
5
  export declare const nonWrappedLayouts: RichMediaLayout[];
6
6
  export declare const floatingLayouts: string[];
7
- export declare const isRichMediaInsideOfBlockNode: (view: EditorView, pos: number | boolean) => boolean;
7
+ export declare const isRichMediaInsideOfBlockNode: (view: EditorView, pos: number | boolean, includeMoreParentNodeTypes?: boolean) => boolean;
8
8
  export declare const alignAttributes: (layout: RichMediaLayout, oldAttrs: RichMediaAttributes, gridSize: number | undefined, originalWidth: number, lineLength?: number) => RichMediaAttributes;
9
9
  export declare function calculateSnapPoints({ $pos, akEditorWideLayoutWidth, allowBreakoutSnapPoints, containerWidth, gridSize, gridWidth, insideInlineLike, insideLayout, isVideoFile, lineLength, offsetLeft, wrappedLayout, }: SnapPointsProps): number[];
@@ -34,7 +34,7 @@ export interface calcMediaSinglePixelWidthProps {
34
34
  */
35
35
  export declare const calcMediaSinglePixelWidth: ({ width, widthType, origWidth, layout, contentWidth, containerWidth, gutterOffset, }: calcMediaSinglePixelWidthProps) => number;
36
36
  /**
37
- * Calculate maximum width allowed for media single in new experience
37
+ * Calculate maximum width allowed for media single node in fix-width editor in new experience
38
38
  * @param containerWidth width of editor container
39
39
  */
40
40
  export declare const calcMediaSingleMaxWidth: (containerWidth: number) => number;
@@ -4,6 +4,6 @@ import { SnapPointsProps } from '../types';
4
4
  export declare const shouldAddDefaultWrappedWidth: (layout: RichMediaLayout, width?: number, lineLength?: number) => boolean | 0 | undefined;
5
5
  export declare const nonWrappedLayouts: RichMediaLayout[];
6
6
  export declare const floatingLayouts: string[];
7
- export declare const isRichMediaInsideOfBlockNode: (view: EditorView, pos: number | boolean) => boolean;
7
+ export declare const isRichMediaInsideOfBlockNode: (view: EditorView, pos: number | boolean, includeMoreParentNodeTypes?: boolean) => boolean;
8
8
  export declare const alignAttributes: (layout: RichMediaLayout, oldAttrs: RichMediaAttributes, gridSize: number | undefined, originalWidth: number, lineLength?: number) => RichMediaAttributes;
9
9
  export declare function calculateSnapPoints({ $pos, akEditorWideLayoutWidth, allowBreakoutSnapPoints, containerWidth, gridSize, gridWidth, insideInlineLike, insideLayout, isVideoFile, lineLength, offsetLeft, wrappedLayout, }: SnapPointsProps): number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.38.0",
3
+ "version": "74.38.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/"