@atlaskit/editor-plugin-media 9.5.4 → 9.5.5
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 9.5.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`231bc5802c7de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/231bc5802c7de) -
|
|
8
|
+
fix stale node position issue in media single
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 9.5.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -38,6 +38,16 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
38
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
39
39
|
|
|
40
40
|
var resizerNextTestId = exports.resizerNextTestId = 'mediaSingle.resizerNext.testid';
|
|
41
|
+
var getNodePosition = function getNodePosition(getPos) {
|
|
42
|
+
if (typeof getPos !== 'function') {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
var pos = getPos();
|
|
46
|
+
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return pos;
|
|
50
|
+
};
|
|
41
51
|
var calcPxHeight = function calcPxHeight(props) {
|
|
42
52
|
var newWidth = props.newWidth,
|
|
43
53
|
previousWidth = props.previousWidth,
|
|
@@ -204,15 +214,10 @@ var ResizableMediaSingleNextFunctional = exports.ResizableMediaSingleNextFunctio
|
|
|
204
214
|
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
205
215
|
hasResized = _useState0[0],
|
|
206
216
|
setHasResized = _useState0[1];
|
|
207
|
-
var nodePosition = (0,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var pos = getPos();
|
|
212
|
-
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
return pos;
|
|
217
|
+
var nodePosition = (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) ? getNodePosition(getPos) :
|
|
218
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
219
|
+
(0, _react.useMemo)(function () {
|
|
220
|
+
return getNodePosition(getPos);
|
|
216
221
|
}, [getPos]);
|
|
217
222
|
var isNestedNode = (0, _react.useMemo)(function () {
|
|
218
223
|
if (nodePosition === null) {
|
|
@@ -26,6 +26,16 @@ import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
|
|
|
26
26
|
import { ResizableMediaMigrationNotification } from './ResizableMediaMigrationNotification';
|
|
27
27
|
import { wrapperStyle } from './styled';
|
|
28
28
|
export const resizerNextTestId = 'mediaSingle.resizerNext.testid';
|
|
29
|
+
const getNodePosition = getPos => {
|
|
30
|
+
if (typeof getPos !== 'function') {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const pos = getPos();
|
|
34
|
+
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return pos;
|
|
38
|
+
};
|
|
29
39
|
const calcPxHeight = props => {
|
|
30
40
|
const {
|
|
31
41
|
newWidth,
|
|
@@ -181,16 +191,9 @@ export const ResizableMediaSingleNextFunctional = props => {
|
|
|
181
191
|
const [isResizing, setIsResizing] = useState(false);
|
|
182
192
|
const [isVideoFile, setIsVideoFile] = useState(!fg('platform_editor_media_video_check_fix_new'));
|
|
183
193
|
const [hasResized, setHasResized] = useState(false);
|
|
184
|
-
const nodePosition =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
const pos = getPos();
|
|
189
|
-
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
return pos;
|
|
193
|
-
}, [getPos]);
|
|
194
|
+
const nodePosition = expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? getNodePosition(getPos) :
|
|
195
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
196
|
+
useMemo(() => getNodePosition(getPos), [getPos]);
|
|
194
197
|
const isNestedNode = useMemo(() => {
|
|
195
198
|
if (nodePosition === null) {
|
|
196
199
|
return false;
|
|
@@ -28,6 +28,16 @@ import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
|
|
|
28
28
|
import { ResizableMediaMigrationNotification } from './ResizableMediaMigrationNotification';
|
|
29
29
|
import { wrapperStyle } from './styled';
|
|
30
30
|
export var resizerNextTestId = 'mediaSingle.resizerNext.testid';
|
|
31
|
+
var getNodePosition = function getNodePosition(getPos) {
|
|
32
|
+
if (typeof getPos !== 'function') {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
var pos = getPos();
|
|
36
|
+
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return pos;
|
|
40
|
+
};
|
|
31
41
|
var calcPxHeight = function calcPxHeight(props) {
|
|
32
42
|
var newWidth = props.newWidth,
|
|
33
43
|
previousWidth = props.previousWidth,
|
|
@@ -194,15 +204,10 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
194
204
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
195
205
|
hasResized = _useState0[0],
|
|
196
206
|
setHasResized = _useState0[1];
|
|
197
|
-
var nodePosition =
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
var pos = getPos();
|
|
202
|
-
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
203
|
-
return null;
|
|
204
|
-
}
|
|
205
|
-
return pos;
|
|
207
|
+
var nodePosition = expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? getNodePosition(getPos) :
|
|
208
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
209
|
+
useMemo(function () {
|
|
210
|
+
return getNodePosition(getPos);
|
|
206
211
|
}, [getPos]);
|
|
207
212
|
var isNestedNode = useMemo(function () {
|
|
208
213
|
if (nodePosition === null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.5",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/media-client": "^35.8.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^4.2.0",
|
|
60
60
|
"@atlaskit/media-common": "^12.4.0",
|
|
61
|
-
"@atlaskit/media-filmstrip": "^51.
|
|
61
|
+
"@atlaskit/media-filmstrip": "^51.2.0",
|
|
62
62
|
"@atlaskit/media-picker": "^70.1.0",
|
|
63
63
|
"@atlaskit/media-ui": "^28.7.0",
|
|
64
64
|
"@atlaskit/media-viewer": "^52.8.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@atlaskit/primitives": "^18.0.0",
|
|
67
67
|
"@atlaskit/textfield": "^8.2.0",
|
|
68
68
|
"@atlaskit/theme": "^21.0.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^29.
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^29.4.0",
|
|
70
70
|
"@atlaskit/tokens": "^11.0.0",
|
|
71
71
|
"@atlaskit/tooltip": "^20.14.0",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"uuid": "^3.1.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@atlaskit/editor-common": "^111.
|
|
81
|
+
"@atlaskit/editor-common": "^111.18.0",
|
|
82
82
|
"@atlaskit/media-core": "^37.0.0",
|
|
83
83
|
"react": "^18.2.0",
|
|
84
84
|
"react-dom": "^18.2.0",
|
|
@@ -130,9 +130,6 @@
|
|
|
130
130
|
"platform_editor_typography_ugc": {
|
|
131
131
|
"type": "boolean"
|
|
132
132
|
},
|
|
133
|
-
"platform-visual-refresh-icons": {
|
|
134
|
-
"type": "boolean"
|
|
135
|
-
},
|
|
136
133
|
"platform_editor_introduce_insert_media_command": {
|
|
137
134
|
"type": "boolean"
|
|
138
135
|
},
|