@atlaskit/renderer 109.0.1 → 109.0.3
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 +12 -0
- package/dist/cjs/react/nodes/mediaSingle/index.js +4 -1
- package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/mediaSingle/index.js +4 -1
- package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -3
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/mediaSingle/index.js +4 -1
- package/dist/esm/ui/Renderer/breakout-ssr.js +6 -3
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#62165](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62165) [`b44ac0968d79`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b44ac0968d79) - [ED-21562] Bump @atlaskit/adf-schema to 35.2.0 for border mark update
|
|
8
|
+
|
|
9
|
+
## 109.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#61186](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61186) [`56c310f67664`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/56c310f67664) - [ED-20481] Update media breakout calculation in SSR mode for pixel resizing experience
|
|
14
|
+
|
|
3
15
|
## 109.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -126,7 +126,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
126
126
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
127
127
|
var calcDimensions = function calcDimensions(mediaContainerWidth) {
|
|
128
128
|
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
129
|
-
var
|
|
129
|
+
var isPixel = widthType === 'pixel';
|
|
130
|
+
|
|
131
|
+
// max width and height are already handled in mediaSingle
|
|
132
|
+
var maxWidth = isPixel && widthAttr ? widthAttr : containerWidth;
|
|
130
133
|
var maxHeight = height / width * maxWidth;
|
|
131
134
|
var cardDimensions = {
|
|
132
135
|
width: "".concat(maxWidth, "px"),
|
|
@@ -106,8 +106,8 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
106
106
|
* The mutation observer is only called once per added node.
|
|
107
107
|
* The above condition only deals with direct children of <div class="ak-renderer-document" />
|
|
108
108
|
* When it is initially called on the direct children, not all the sub children have loaded.
|
|
109
|
-
* So nested media elements which are not immediately loaded as sub children are not
|
|
110
|
-
* Thus adding this conditional to deal with all
|
|
109
|
+
* So nested media elements which are not immediately loaded as sub children are not available in the above conditional.
|
|
110
|
+
* Thus adding this conditional to deal with all media elements directly.
|
|
111
111
|
*/
|
|
112
112
|
item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
|
|
113
113
|
applyMediaBreakout(item.target);
|
|
@@ -130,9 +130,12 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
130
130
|
}
|
|
131
131
|
var mode = card.dataset.mode || card.dataset.layout || '';
|
|
132
132
|
var width = card.dataset.width;
|
|
133
|
+
var isPixelBasedResizing = card.dataset.widthType === 'pixel';
|
|
133
134
|
if (WIDE_LAYOUT_MODES.includes(mode)) {
|
|
134
135
|
card.style.width = '100%';
|
|
135
|
-
} else if (width) {
|
|
136
|
+
} else if (width && !isPixelBasedResizing) {
|
|
137
|
+
// Pixel based resizing has width set in pixels based on its width attribute
|
|
138
|
+
// Thus, no need to override for non-wide layouts
|
|
136
139
|
card.style.width = "".concat(width, "%");
|
|
137
140
|
}
|
|
138
141
|
};
|
|
@@ -54,7 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
54
54
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
var packageName = "@atlaskit/renderer";
|
|
57
|
-
var packageVersion = "109.0.
|
|
57
|
+
var packageVersion = "109.0.3";
|
|
58
58
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
59
59
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
60
60
|
var _super = _createSuper(Renderer);
|
|
@@ -111,7 +111,10 @@ const MediaSingle = props => {
|
|
|
111
111
|
const isFullWidth = rendererAppearance === 'full-width';
|
|
112
112
|
const calcDimensions = mediaContainerWidth => {
|
|
113
113
|
const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
114
|
-
const
|
|
114
|
+
const isPixel = widthType === 'pixel';
|
|
115
|
+
|
|
116
|
+
// max width and height are already handled in mediaSingle
|
|
117
|
+
const maxWidth = isPixel && widthAttr ? widthAttr : containerWidth;
|
|
115
118
|
const maxHeight = height / width * maxWidth;
|
|
116
119
|
const cardDimensions = {
|
|
117
120
|
width: `${maxWidth}px`,
|
|
@@ -110,8 +110,8 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
110
110
|
* The mutation observer is only called once per added node.
|
|
111
111
|
* The above condition only deals with direct children of <div class="ak-renderer-document" />
|
|
112
112
|
* When it is initially called on the direct children, not all the sub children have loaded.
|
|
113
|
-
* So nested media elements which are not immediately loaded as sub children are not
|
|
114
|
-
* Thus adding this conditional to deal with all
|
|
113
|
+
* So nested media elements which are not immediately loaded as sub children are not available in the above conditional.
|
|
114
|
+
* Thus adding this conditional to deal with all media elements directly.
|
|
115
115
|
*/
|
|
116
116
|
item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
|
|
117
117
|
applyMediaBreakout(item.target);
|
|
@@ -132,9 +132,12 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
132
132
|
}
|
|
133
133
|
const mode = card.dataset.mode || card.dataset.layout || '';
|
|
134
134
|
const width = card.dataset.width;
|
|
135
|
+
const isPixelBasedResizing = card.dataset.widthType === 'pixel';
|
|
135
136
|
if (WIDE_LAYOUT_MODES.includes(mode)) {
|
|
136
137
|
card.style.width = '100%';
|
|
137
|
-
} else if (width) {
|
|
138
|
+
} else if (width && !isPixelBasedResizing) {
|
|
139
|
+
// Pixel based resizing has width set in pixels based on its width attribute
|
|
140
|
+
// Thus, no need to override for non-wide layouts
|
|
138
141
|
card.style.width = `${width}%`;
|
|
139
142
|
}
|
|
140
143
|
};
|
|
@@ -35,7 +35,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "109.0.
|
|
38
|
+
const packageVersion = "109.0.3";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
|
@@ -116,7 +116,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
116
116
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
117
117
|
var calcDimensions = function calcDimensions(mediaContainerWidth) {
|
|
118
118
|
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
119
|
-
var
|
|
119
|
+
var isPixel = widthType === 'pixel';
|
|
120
|
+
|
|
121
|
+
// max width and height are already handled in mediaSingle
|
|
122
|
+
var maxWidth = isPixel && widthAttr ? widthAttr : containerWidth;
|
|
120
123
|
var maxHeight = height / width * maxWidth;
|
|
121
124
|
var cardDimensions = {
|
|
122
125
|
width: "".concat(maxWidth, "px"),
|
|
@@ -98,8 +98,8 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
98
98
|
* The mutation observer is only called once per added node.
|
|
99
99
|
* The above condition only deals with direct children of <div class="ak-renderer-document" />
|
|
100
100
|
* When it is initially called on the direct children, not all the sub children have loaded.
|
|
101
|
-
* So nested media elements which are not immediately loaded as sub children are not
|
|
102
|
-
* Thus adding this conditional to deal with all
|
|
101
|
+
* So nested media elements which are not immediately loaded as sub children are not available in the above conditional.
|
|
102
|
+
* Thus adding this conditional to deal with all media elements directly.
|
|
103
103
|
*/
|
|
104
104
|
item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
|
|
105
105
|
applyMediaBreakout(item.target);
|
|
@@ -122,9 +122,12 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
122
122
|
}
|
|
123
123
|
var mode = card.dataset.mode || card.dataset.layout || '';
|
|
124
124
|
var width = card.dataset.width;
|
|
125
|
+
var isPixelBasedResizing = card.dataset.widthType === 'pixel';
|
|
125
126
|
if (WIDE_LAYOUT_MODES.includes(mode)) {
|
|
126
127
|
card.style.width = '100%';
|
|
127
|
-
} else if (width) {
|
|
128
|
+
} else if (width && !isPixelBasedResizing) {
|
|
129
|
+
// Pixel based resizing has width set in pixels based on its width attribute
|
|
130
|
+
// Thus, no need to override for non-wide layouts
|
|
128
131
|
card.style.width = "".concat(width, "%");
|
|
129
132
|
}
|
|
130
133
|
};
|
|
@@ -45,7 +45,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "109.0.
|
|
48
|
+
var packageVersion = "109.0.3";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.0.
|
|
3
|
+
"version": "109.0.3",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"runReact18": true
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@atlaskit/adf-schema": "^35.
|
|
28
|
+
"@atlaskit/adf-schema": "^35.2.0",
|
|
29
29
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
30
30
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
31
31
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|