@atlaskit/editor-plugin-card 2.5.0 → 2.5.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,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 2.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#119163](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119163)
|
|
8
|
+
[`45ae1b9a97c16`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/45ae1b9a97c16) -
|
|
9
|
+
[ux] Added onDropdownChange prop to overlay in editor-common. Used this prop to keep link
|
|
10
|
+
configure overlay open when dropdown is open, and hide overlay when dropdown is hidden.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 2.5.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -26,19 +26,32 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
|
|
|
26
26
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
27
27
|
showConfigureButton = _useState2[0],
|
|
28
28
|
setShowConfigureButton = _useState2[1];
|
|
29
|
+
var _useState3 = (0, _react.useState)(false),
|
|
30
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
31
|
+
dropdownOpen = _useState4[0],
|
|
32
|
+
setDropdownOpen = _useState4[1];
|
|
33
|
+
var onDropdownChange = (0, _react.useCallback)(function (isOpen) {
|
|
34
|
+
setDropdownOpen(isOpen);
|
|
35
|
+
if (!isOpen) {
|
|
36
|
+
setShowConfigureButton(false);
|
|
37
|
+
}
|
|
38
|
+
}, []);
|
|
29
39
|
return (0, _react2.jsx)("span", {
|
|
30
40
|
onMouseEnter: function onMouseEnter() {
|
|
31
41
|
return setShowConfigureButton(true);
|
|
32
42
|
},
|
|
33
43
|
onMouseLeave: function onMouseLeave() {
|
|
34
|
-
|
|
44
|
+
if (!dropdownOpen) {
|
|
45
|
+
setShowConfigureButton(false);
|
|
46
|
+
}
|
|
35
47
|
},
|
|
36
48
|
"data-testid": "inline-card-overlay-wrapper"
|
|
37
49
|
}, (0, _react2.jsx)("span", {
|
|
38
50
|
css: ConfigureOverlayWrapperStyles
|
|
39
51
|
}, showConfigureButton && (0, _react2.jsx)(_link.OverlayButton, {
|
|
40
52
|
editorView: view,
|
|
41
|
-
targetElementPos: targetElementPos
|
|
53
|
+
targetElementPos: targetElementPos,
|
|
54
|
+
onDropdownChange: onDropdownChange
|
|
42
55
|
})), children);
|
|
43
56
|
};
|
|
44
57
|
var _default = exports.default = OverlayWrapper;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
// not permitted to migrate atlaskit packages to compiled yet, see https://hello.atlassian.net/wiki/spaces/UAF/pages/3006969423/Migrating+AFM+platform+components+to+Compiled+a+guide
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
@@ -15,15 +15,27 @@ const OverlayWrapper = ({
|
|
|
15
15
|
children
|
|
16
16
|
}) => {
|
|
17
17
|
const [showConfigureButton, setShowConfigureButton] = useState(false);
|
|
18
|
+
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
19
|
+
const onDropdownChange = useCallback(isOpen => {
|
|
20
|
+
setDropdownOpen(isOpen);
|
|
21
|
+
if (!isOpen) {
|
|
22
|
+
setShowConfigureButton(false);
|
|
23
|
+
}
|
|
24
|
+
}, []);
|
|
18
25
|
return jsx("span", {
|
|
19
26
|
onMouseEnter: () => setShowConfigureButton(true),
|
|
20
|
-
onMouseLeave: () =>
|
|
27
|
+
onMouseLeave: () => {
|
|
28
|
+
if (!dropdownOpen) {
|
|
29
|
+
setShowConfigureButton(false);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
21
32
|
"data-testid": "inline-card-overlay-wrapper"
|
|
22
33
|
}, jsx("span", {
|
|
23
34
|
css: ConfigureOverlayWrapperStyles
|
|
24
35
|
}, showConfigureButton && jsx(OverlayButton, {
|
|
25
36
|
editorView: view,
|
|
26
|
-
targetElementPos: targetElementPos
|
|
37
|
+
targetElementPos: targetElementPos,
|
|
38
|
+
onDropdownChange: onDropdownChange
|
|
27
39
|
})), children);
|
|
28
40
|
};
|
|
29
41
|
export default OverlayWrapper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { useCallback, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
// not permitted to migrate atlaskit packages to compiled yet, see https://hello.atlassian.net/wiki/spaces/UAF/pages/3006969423/Migrating+AFM+platform+components+to+Compiled+a+guide
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
@@ -18,19 +18,32 @@ var OverlayWrapper = function OverlayWrapper(_ref) {
|
|
|
18
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
19
19
|
showConfigureButton = _useState2[0],
|
|
20
20
|
setShowConfigureButton = _useState2[1];
|
|
21
|
+
var _useState3 = useState(false),
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
dropdownOpen = _useState4[0],
|
|
24
|
+
setDropdownOpen = _useState4[1];
|
|
25
|
+
var onDropdownChange = useCallback(function (isOpen) {
|
|
26
|
+
setDropdownOpen(isOpen);
|
|
27
|
+
if (!isOpen) {
|
|
28
|
+
setShowConfigureButton(false);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
21
31
|
return jsx("span", {
|
|
22
32
|
onMouseEnter: function onMouseEnter() {
|
|
23
33
|
return setShowConfigureButton(true);
|
|
24
34
|
},
|
|
25
35
|
onMouseLeave: function onMouseLeave() {
|
|
26
|
-
|
|
36
|
+
if (!dropdownOpen) {
|
|
37
|
+
setShowConfigureButton(false);
|
|
38
|
+
}
|
|
27
39
|
},
|
|
28
40
|
"data-testid": "inline-card-overlay-wrapper"
|
|
29
41
|
}, jsx("span", {
|
|
30
42
|
css: ConfigureOverlayWrapperStyles
|
|
31
43
|
}, showConfigureButton && jsx(OverlayButton, {
|
|
32
44
|
editorView: view,
|
|
33
|
-
targetElementPos: targetElementPos
|
|
45
|
+
targetElementPos: targetElementPos,
|
|
46
|
+
onDropdownChange: onDropdownChange
|
|
34
47
|
})), children);
|
|
35
48
|
};
|
|
36
49
|
export default OverlayWrapper;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/button": "^18.3.0",
|
|
38
38
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
39
39
|
"@atlaskit/dropdown-menu": "^12.14.0",
|
|
40
|
-
"@atlaskit/editor-common": "^84.
|
|
40
|
+
"@atlaskit/editor-common": "^84.5.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
42
42
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/link-client-extension": "^1.9.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^2.5.0",
|
|
56
56
|
"@atlaskit/linking-common": "^5.7.0",
|
|
57
|
-
"@atlaskit/linking-types": "^8.
|
|
57
|
+
"@atlaskit/linking-types": "^8.10.0",
|
|
58
58
|
"@atlaskit/menu": "2.7.4",
|
|
59
59
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
60
60
|
"@atlaskit/primitives": "^11.0.0",
|