@atlaskit/editor-common 74.59.0 → 75.0.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 +17 -0
- package/dist/cjs/media-single/utils.js +7 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/index.js +0 -7
- package/dist/cjs/ui/MediaSingle/styled.js +23 -4
- package/dist/cjs/ui/index.js +7 -7
- package/dist/es2019/media-single/utils.js +7 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/index.js +0 -5
- package/dist/es2019/ui/MediaSingle/styled.js +22 -3
- package/dist/es2019/ui/index.js +2 -2
- package/dist/esm/media-single/utils.js +7 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/index.js +0 -5
- package/dist/esm/ui/MediaSingle/styled.js +21 -3
- package/dist/esm/ui/index.js +2 -2
- package/dist/types/media-single/utils.d.ts +6 -0
- package/dist/types/ui/MediaSingle/index.d.ts +0 -1
- package/dist/types/ui/MediaSingle/styled.d.ts +6 -1
- package/dist/types/ui/index.d.ts +2 -2
- package/dist/types-ts4.5/media-single/utils.d.ts +6 -0
- package/dist/types-ts4.5/ui/MediaSingle/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +6 -1
- package/dist/types-ts4.5/ui/index.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 75.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1c085549bd9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1c085549bd9) - clean up pctWidth used in new image resize experience
|
|
8
|
+
|
|
9
|
+
## 75.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`e6122bf1c9a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6122bf1c9a) - MEX-2481 revert and re-introduce a new fix for media border gap issue
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`9d3236f1b2d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d3236f1b2d) - Add comments for getParentWidthForNestedMediaSingleNode function
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 74.59.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -199,6 +199,13 @@ var getMaxWidthForNestedNodeNext = function getMaxWidthForNestedNodeNext(view, p
|
|
|
199
199
|
}
|
|
200
200
|
return null;
|
|
201
201
|
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Get parent content width for nested media single node
|
|
205
|
+
* @param resolvedPos resolved Position of the node
|
|
206
|
+
* @param view editor view
|
|
207
|
+
* @returns parent content width for nested node
|
|
208
|
+
*/
|
|
202
209
|
exports.getMaxWidthForNestedNodeNext = getMaxWidthForNestedNodeNext;
|
|
203
210
|
var getParentWidthForNestedMediaSingleNode = function getParentWidthForNestedMediaSingleNode(resolvedPos, view) {
|
|
204
211
|
var domNode = view.nodeDOM(resolvedPos.pos);
|
|
@@ -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 = "
|
|
19
|
+
var packageVersion = "75.0.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 = "
|
|
27
|
+
var packageVersion = "75.0.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.IMAGE_AND_BORDER_ADJUSTMENT = void 0;
|
|
8
7
|
exports.default = MediaSingle;
|
|
9
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -17,12 +16,6 @@ var _richMediaUtils = require("../../utils/rich-media-utils");
|
|
|
17
16
|
var _styled = require("./styled");
|
|
18
17
|
/** @jsx jsx */
|
|
19
18
|
|
|
20
|
-
/*
|
|
21
|
-
This constant is used to proportionally adjust the image and its border to avoid any gaps. i.e. The value will simultaneously expand the width and height of the image by 2 pixels; and similarly contract the border by 2 pixels.
|
|
22
|
-
Read more: https://product-fabric.atlassian.net/browse/MEX-2481
|
|
23
|
-
*/
|
|
24
|
-
var IMAGE_AND_BORDER_ADJUSTMENT = 2;
|
|
25
|
-
exports.IMAGE_AND_BORDER_ADJUSTMENT = IMAGE_AND_BORDER_ADJUSTMENT;
|
|
26
19
|
function MediaSingle(_ref) {
|
|
27
20
|
var layout = _ref.layout,
|
|
28
21
|
width = _ref.width,
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.MediaWrapper = exports.MediaSingleDimensionHelper = void 0;
|
|
7
|
+
exports.MediaWrapper = exports.MediaSingleDimensionHelper = exports.MediaBorderGapFiller = void 0;
|
|
8
8
|
exports.calcLegacyWidth = calcLegacyWidth;
|
|
9
9
|
exports.calcResizedWidth = calcResizedWidth;
|
|
10
10
|
exports.mediaWrapperStyle = void 0;
|
|
@@ -118,13 +118,12 @@ var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
|
|
|
118
118
|
fullWidthMode = _ref.fullWidthMode,
|
|
119
119
|
isResized = _ref.isResized,
|
|
120
120
|
layout = _ref.layout,
|
|
121
|
-
pctWidth = _ref.pctWidth,
|
|
122
121
|
mediaSingleWidth = _ref.mediaSingleWidth,
|
|
123
122
|
width = _ref.width,
|
|
124
123
|
isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
|
|
125
124
|
_ref$isNestedNode = _ref.isNestedNode,
|
|
126
125
|
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 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
|
|
126
|
+
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 ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
|
|
128
127
|
/* This causes issues for new experience where we don't strip layout attributes
|
|
129
128
|
when copying top-level node and pasting into a table/layout,
|
|
130
129
|
because full-width layout will remain, causing node to be edge-to-edge */
|
|
@@ -149,4 +148,24 @@ var MediaWrapper = function MediaWrapper(_ref3) {
|
|
|
149
148
|
}, children);
|
|
150
149
|
};
|
|
151
150
|
exports.MediaWrapper = MediaWrapper;
|
|
152
|
-
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
151
|
+
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
There was an issue with a small, intermittent white gap appearing between the images due to a small pixel difference in browser rendering.
|
|
155
|
+
|
|
156
|
+
The solution implemented below was adapted from: https://stackoverflow.com/a/68885576
|
|
157
|
+
It suggests adding an absolute div on top which matches the width and height and setting the border on that div.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
var MediaBorderGapFiller = function MediaBorderGapFiller(_ref4) {
|
|
161
|
+
var borderColor = _ref4.borderColor;
|
|
162
|
+
return (0, _react2.jsx)("div", {
|
|
163
|
+
style: {
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
inset: '0px',
|
|
166
|
+
border: "0.5px solid ".concat(borderColor),
|
|
167
|
+
borderRadius: '1px'
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
exports.MediaBorderGapFiller = MediaBorderGapFiller;
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -89,12 +89,6 @@ Object.defineProperty(exports, "HelperMessage", {
|
|
|
89
89
|
return _Messages.HelperMessage;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
Object.defineProperty(exports, "IMAGE_AND_BORDER_ADJUSTMENT", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function get() {
|
|
95
|
-
return _MediaSingle.IMAGE_AND_BORDER_ADJUSTMENT;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
92
|
Object.defineProperty(exports, "IntlErrorBoundary", {
|
|
99
93
|
enumerable: true,
|
|
100
94
|
get: function get() {
|
|
@@ -113,6 +107,12 @@ Object.defineProperty(exports, "LINKPICKER_HEIGHT_IN_PX", {
|
|
|
113
107
|
return _const.LINKPICKER_HEIGHT_IN_PX;
|
|
114
108
|
}
|
|
115
109
|
});
|
|
110
|
+
Object.defineProperty(exports, "MediaBorderGapFiller", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function get() {
|
|
113
|
+
return _styled.MediaBorderGapFiller;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
116
|
Object.defineProperty(exports, "MediaSingle", {
|
|
117
117
|
enumerable: true,
|
|
118
118
|
get: function get() {
|
|
@@ -372,7 +372,7 @@ Object.defineProperty(exports, "wrapperStyle", {
|
|
|
372
372
|
}
|
|
373
373
|
});
|
|
374
374
|
var _Caption = _interopRequireDefault(require("./Caption"));
|
|
375
|
-
var _MediaSingle =
|
|
375
|
+
var _MediaSingle = _interopRequireDefault(require("./MediaSingle"));
|
|
376
376
|
var _styled = require("./MediaSingle/styled");
|
|
377
377
|
var _grid = require("./MediaSingle/grid");
|
|
378
378
|
var _link = require("./MediaSingle/link");
|
|
@@ -176,6 +176,13 @@ export const getMaxWidthForNestedNodeNext = (view, pos, forInsertion) => {
|
|
|
176
176
|
}
|
|
177
177
|
return null;
|
|
178
178
|
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Get parent content width for nested media single node
|
|
182
|
+
* @param resolvedPos resolved Position of the node
|
|
183
|
+
* @param view editor view
|
|
184
|
+
* @returns parent content width for nested node
|
|
185
|
+
*/
|
|
179
186
|
export const getParentWidthForNestedMediaSingleNode = (resolvedPos, view) => {
|
|
180
187
|
const domNode = view.nodeDOM(resolvedPos.pos);
|
|
181
188
|
if (resolvedPos.nodeAfter && floatingLayouts.includes(resolvedPos.nodeAfter.attrs.layout) && domNode && domNode.parentElement) {
|
|
@@ -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 = "
|
|
3
|
+
const packageVersion = "75.0.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
|
|
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
9
9
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "
|
|
12
|
+
const packageVersion = "75.0.1";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -7,11 +7,6 @@ import { MEDIA_SINGLE_GUTTER_SIZE } from '../../media-single/constants';
|
|
|
7
7
|
import { getMediaSinglePixelWidth } from '../../media-single/utils';
|
|
8
8
|
import { shouldAddDefaultWrappedWidth } from '../../utils/rich-media-utils';
|
|
9
9
|
import { MediaSingleDimensionHelper, MediaWrapper } from './styled';
|
|
10
|
-
/*
|
|
11
|
-
This constant is used to proportionally adjust the image and its border to avoid any gaps. i.e. The value will simultaneously expand the width and height of the image by 2 pixels; and similarly contract the border by 2 pixels.
|
|
12
|
-
Read more: https://product-fabric.atlassian.net/browse/MEX-2481
|
|
13
|
-
*/
|
|
14
|
-
export const IMAGE_AND_BORDER_ADJUSTMENT = 2;
|
|
15
10
|
export default function MediaSingle({
|
|
16
11
|
layout,
|
|
17
12
|
width,
|
|
@@ -100,7 +100,6 @@ export const MediaSingleDimensionHelper = ({
|
|
|
100
100
|
fullWidthMode,
|
|
101
101
|
isResized,
|
|
102
102
|
layout,
|
|
103
|
-
pctWidth,
|
|
104
103
|
mediaSingleWidth,
|
|
105
104
|
width,
|
|
106
105
|
// original media width
|
|
@@ -115,7 +114,7 @@ export const MediaSingleDimensionHelper = ({
|
|
|
115
114
|
max-width: 100%;
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
width: ${isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth
|
|
117
|
+
width: ${isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized)};
|
|
119
118
|
${layout === 'full-width' &&
|
|
120
119
|
/* This causes issues for new experience where we don't strip layout attributes
|
|
121
120
|
when copying top-level node and pasting into a table/layout,
|
|
@@ -203,4 +202,24 @@ export const MediaWrapper = ({
|
|
|
203
202
|
}) => jsx("div", {
|
|
204
203
|
css: mediaWrapperStyle(rest)
|
|
205
204
|
}, children);
|
|
206
|
-
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
205
|
+
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
There was an issue with a small, intermittent white gap appearing between the images due to a small pixel difference in browser rendering.
|
|
209
|
+
|
|
210
|
+
The solution implemented below was adapted from: https://stackoverflow.com/a/68885576
|
|
211
|
+
It suggests adding an absolute div on top which matches the width and height and setting the border on that div.
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
export const MediaBorderGapFiller = ({
|
|
215
|
+
borderColor
|
|
216
|
+
}) => {
|
|
217
|
+
return jsx("div", {
|
|
218
|
+
style: {
|
|
219
|
+
position: 'absolute',
|
|
220
|
+
inset: '0px',
|
|
221
|
+
border: `0.5px solid ${borderColor}`,
|
|
222
|
+
borderRadius: '1px'
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
};
|
package/dist/es2019/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as Caption } from './Caption';
|
|
2
|
-
export { default as MediaSingle
|
|
3
|
-
export { MediaSingleDimensionHelper } from './MediaSingle/styled';
|
|
2
|
+
export { default as MediaSingle } from './MediaSingle';
|
|
3
|
+
export { MediaSingleDimensionHelper, MediaBorderGapFiller } from './MediaSingle/styled';
|
|
4
4
|
export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid, calcMediaPxWidth, wrappedLayouts } from './MediaSingle/grid';
|
|
5
5
|
export { mediaLinkStyle } from './MediaSingle/link';
|
|
6
6
|
export { default as Popup, findOverflowScrollParent } from './Popup';
|
|
@@ -184,6 +184,13 @@ export var getMaxWidthForNestedNodeNext = function getMaxWidthForNestedNodeNext(
|
|
|
184
184
|
}
|
|
185
185
|
return null;
|
|
186
186
|
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Get parent content width for nested media single node
|
|
190
|
+
* @param resolvedPos resolved Position of the node
|
|
191
|
+
* @param view editor view
|
|
192
|
+
* @returns parent content width for nested node
|
|
193
|
+
*/
|
|
187
194
|
export var getParentWidthForNestedMediaSingleNode = function getParentWidthForNestedMediaSingleNode(resolvedPos, view) {
|
|
188
195
|
var domNode = view.nodeDOM(resolvedPos.pos);
|
|
189
196
|
if (resolvedPos.nodeAfter && floatingLayouts.includes(resolvedPos.nodeAfter.attrs.layout) && domNode && domNode.parentElement) {
|
|
@@ -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 = "
|
|
9
|
+
var packageVersion = "75.0.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
|
|
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import Layer from '../Layer';
|
|
21
21
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "75.0.1";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -8,11 +8,6 @@ import { MEDIA_SINGLE_GUTTER_SIZE } from '../../media-single/constants';
|
|
|
8
8
|
import { getMediaSinglePixelWidth } from '../../media-single/utils';
|
|
9
9
|
import { shouldAddDefaultWrappedWidth } from '../../utils/rich-media-utils';
|
|
10
10
|
import { MediaSingleDimensionHelper, MediaWrapper } from './styled';
|
|
11
|
-
/*
|
|
12
|
-
This constant is used to proportionally adjust the image and its border to avoid any gaps. i.e. The value will simultaneously expand the width and height of the image by 2 pixels; and similarly contract the border by 2 pixels.
|
|
13
|
-
Read more: https://product-fabric.atlassian.net/browse/MEX-2481
|
|
14
|
-
*/
|
|
15
|
-
export var IMAGE_AND_BORDER_ADJUSTMENT = 2;
|
|
16
11
|
export default function MediaSingle(_ref) {
|
|
17
12
|
var layout = _ref.layout,
|
|
18
13
|
width = _ref.width,
|
|
@@ -109,13 +109,12 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
|
|
|
109
109
|
fullWidthMode = _ref.fullWidthMode,
|
|
110
110
|
isResized = _ref.isResized,
|
|
111
111
|
layout = _ref.layout,
|
|
112
|
-
pctWidth = _ref.pctWidth,
|
|
113
112
|
mediaSingleWidth = _ref.mediaSingleWidth,
|
|
114
113
|
width = _ref.width,
|
|
115
114
|
isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
|
|
116
115
|
_ref$isNestedNode = _ref.isNestedNode,
|
|
117
116
|
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 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
|
|
117
|
+
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 ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
|
|
119
118
|
/* This causes issues for new experience where we don't strip layout attributes
|
|
120
119
|
when copying top-level node and pasting into a table/layout,
|
|
121
120
|
because full-width layout will remain, causing node to be edge-to-edge */
|
|
@@ -137,4 +136,23 @@ export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
|
137
136
|
css: mediaWrapperStyle(rest)
|
|
138
137
|
}, children);
|
|
139
138
|
};
|
|
140
|
-
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
139
|
+
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
140
|
+
|
|
141
|
+
/*
|
|
142
|
+
There was an issue with a small, intermittent white gap appearing between the images due to a small pixel difference in browser rendering.
|
|
143
|
+
|
|
144
|
+
The solution implemented below was adapted from: https://stackoverflow.com/a/68885576
|
|
145
|
+
It suggests adding an absolute div on top which matches the width and height and setting the border on that div.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
export var MediaBorderGapFiller = function MediaBorderGapFiller(_ref4) {
|
|
149
|
+
var borderColor = _ref4.borderColor;
|
|
150
|
+
return jsx("div", {
|
|
151
|
+
style: {
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
inset: '0px',
|
|
154
|
+
border: "0.5px solid ".concat(borderColor),
|
|
155
|
+
borderRadius: '1px'
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
};
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as Caption } from './Caption';
|
|
2
|
-
export { default as MediaSingle
|
|
3
|
-
export { MediaSingleDimensionHelper } from './MediaSingle/styled';
|
|
2
|
+
export { default as MediaSingle } from './MediaSingle';
|
|
3
|
+
export { MediaSingleDimensionHelper, MediaBorderGapFiller } from './MediaSingle/styled';
|
|
4
4
|
export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid, calcMediaPxWidth, wrappedLayouts } from './MediaSingle/grid';
|
|
5
5
|
export { mediaLinkStyle } from './MediaSingle/link';
|
|
6
6
|
export { default as Popup, findOverflowScrollParent } from './Popup';
|
|
@@ -74,5 +74,11 @@ export declare const getMaxWidthForNestedNode: (view: EditorView, pos: number |
|
|
|
74
74
|
* @param pos node position
|
|
75
75
|
*/
|
|
76
76
|
export declare const getMaxWidthForNestedNodeNext: (view: EditorView, pos: number | undefined, forInsertion?: boolean) => number | null;
|
|
77
|
+
/**
|
|
78
|
+
* Get parent content width for nested media single node
|
|
79
|
+
* @param resolvedPos resolved Position of the node
|
|
80
|
+
* @param view editor view
|
|
81
|
+
* @returns parent content width for nested node
|
|
82
|
+
*/
|
|
77
83
|
export declare const getParentWidthForNestedMediaSingleNode: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
|
|
78
84
|
export declare const getParentWidthForNestedMediaSingleNodeForInsertion: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
|
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
5
5
|
import type { MediaSingleSize, MediaSingleWidthType } from './types';
|
|
6
|
-
export declare const IMAGE_AND_BORDER_ADJUSTMENT = 2;
|
|
7
6
|
export interface Props {
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
layout: MediaSingleLayout;
|
|
@@ -39,7 +39,7 @@ export interface MediaSingleWrapperProps {
|
|
|
39
39
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
40
40
|
* supporting `styled-components` v1.
|
|
41
41
|
*/
|
|
42
|
-
export declare const MediaSingleDimensionHelper: ({ containerWidth, fullWidthMode, isResized, layout,
|
|
42
|
+
export declare const MediaSingleDimensionHelper: ({ containerWidth, fullWidthMode, isResized, layout, mediaSingleWidth, width, isExtendedResizeExperienceOn, isNestedNode, }: MediaSingleWrapperProps) => import("@emotion/react").SerializedStyles;
|
|
43
43
|
export interface MediaWrapperProps {
|
|
44
44
|
paddingBottom?: string;
|
|
45
45
|
height?: number;
|
|
@@ -50,3 +50,8 @@ export declare const MediaWrapper: {
|
|
|
50
50
|
({ children, ...rest }: React.HTMLAttributes<HTMLDivElement> & MediaWrapperProps): jsx.JSX.Element;
|
|
51
51
|
displayName: string;
|
|
52
52
|
};
|
|
53
|
+
type MediaBorderGapFillerProps = {
|
|
54
|
+
borderColor: string;
|
|
55
|
+
};
|
|
56
|
+
export declare const MediaBorderGapFiller: React.FC<MediaBorderGapFillerProps>;
|
|
57
|
+
export {};
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Caption } from './Caption';
|
|
2
|
-
export { default as MediaSingle
|
|
2
|
+
export { default as MediaSingle } from './MediaSingle';
|
|
3
3
|
export type { Props as MediaSingleProps, MediaSingleWidthType, MediaSingleSize, } from './MediaSingle';
|
|
4
|
-
export { MediaSingleDimensionHelper } from './MediaSingle/styled';
|
|
4
|
+
export { MediaSingleDimensionHelper, MediaBorderGapFiller, } from './MediaSingle/styled';
|
|
5
5
|
export type { MediaSingleWrapperProps as MediaSingleDimensionHelperProps } from './MediaSingle/styled';
|
|
6
6
|
export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid, calcMediaPxWidth, wrappedLayouts, } from './MediaSingle/grid';
|
|
7
7
|
export { mediaLinkStyle } from './MediaSingle/link';
|
|
@@ -74,5 +74,11 @@ export declare const getMaxWidthForNestedNode: (view: EditorView, pos: number |
|
|
|
74
74
|
* @param pos node position
|
|
75
75
|
*/
|
|
76
76
|
export declare const getMaxWidthForNestedNodeNext: (view: EditorView, pos: number | undefined, forInsertion?: boolean) => number | null;
|
|
77
|
+
/**
|
|
78
|
+
* Get parent content width for nested media single node
|
|
79
|
+
* @param resolvedPos resolved Position of the node
|
|
80
|
+
* @param view editor view
|
|
81
|
+
* @returns parent content width for nested node
|
|
82
|
+
*/
|
|
77
83
|
export declare const getParentWidthForNestedMediaSingleNode: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
|
|
78
84
|
export declare const getParentWidthForNestedMediaSingleNodeForInsertion: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
|
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
5
5
|
import type { MediaSingleSize, MediaSingleWidthType } from './types';
|
|
6
|
-
export declare const IMAGE_AND_BORDER_ADJUSTMENT = 2;
|
|
7
6
|
export interface Props {
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
layout: MediaSingleLayout;
|
|
@@ -39,7 +39,7 @@ export interface MediaSingleWrapperProps {
|
|
|
39
39
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
40
40
|
* supporting `styled-components` v1.
|
|
41
41
|
*/
|
|
42
|
-
export declare const MediaSingleDimensionHelper: ({ containerWidth, fullWidthMode, isResized, layout,
|
|
42
|
+
export declare const MediaSingleDimensionHelper: ({ containerWidth, fullWidthMode, isResized, layout, mediaSingleWidth, width, isExtendedResizeExperienceOn, isNestedNode, }: MediaSingleWrapperProps) => import("@emotion/react").SerializedStyles;
|
|
43
43
|
export interface MediaWrapperProps {
|
|
44
44
|
paddingBottom?: string;
|
|
45
45
|
height?: number;
|
|
@@ -50,3 +50,8 @@ export declare const MediaWrapper: {
|
|
|
50
50
|
({ children, ...rest }: React.HTMLAttributes<HTMLDivElement> & MediaWrapperProps): jsx.JSX.Element;
|
|
51
51
|
displayName: string;
|
|
52
52
|
};
|
|
53
|
+
type MediaBorderGapFillerProps = {
|
|
54
|
+
borderColor: string;
|
|
55
|
+
};
|
|
56
|
+
export declare const MediaBorderGapFiller: React.FC<MediaBorderGapFillerProps>;
|
|
57
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Caption } from './Caption';
|
|
2
|
-
export { default as MediaSingle
|
|
2
|
+
export { default as MediaSingle } from './MediaSingle';
|
|
3
3
|
export type { Props as MediaSingleProps, MediaSingleWidthType, MediaSingleSize, } from './MediaSingle';
|
|
4
|
-
export { MediaSingleDimensionHelper } from './MediaSingle/styled';
|
|
4
|
+
export { MediaSingleDimensionHelper, MediaBorderGapFiller, } from './MediaSingle/styled';
|
|
5
5
|
export type { MediaSingleWrapperProps as MediaSingleDimensionHelperProps } from './MediaSingle/styled';
|
|
6
6
|
export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid, calcMediaPxWidth, wrappedLayouts, } from './MediaSingle/grid';
|
|
7
7
|
export { mediaLinkStyle } from './MediaSingle/link';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "75.0.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/"
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
103
103
|
"@atlaskit/link-datasource": "^1.1.0",
|
|
104
104
|
"@atlaskit/link-picker": "^1.29.0",
|
|
105
|
-
"@atlaskit/media-card": "^
|
|
105
|
+
"@atlaskit/media-card": "^77.0.0",
|
|
106
106
|
"@atlaskit/media-client": "^24.0.0",
|
|
107
107
|
"@atlaskit/media-picker": "^66.2.0",
|
|
108
108
|
"@atlaskit/mention": "^22.1.0",
|