@atlaskit/editor-plugin-panel 4.3.0 → 4.3.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 +9 -0
- package/dist/cjs/ui/toolbar.js +13 -3
- package/dist/es2019/ui/toolbar.js +12 -2
- package/dist/esm/ui/toolbar.js +13 -3
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 4.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134468](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134468)
|
|
8
|
+
[`e312ec529d05a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e312ec529d05a) -
|
|
9
|
+
[ux] Apply hover decoration when hovering on copy/delete button on overflow menu
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 4.3.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -15,6 +15,7 @@ var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/message
|
|
|
15
15
|
var _panel = require("@atlaskit/editor-common/panel");
|
|
16
16
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
17
17
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
18
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
19
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
19
20
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
20
21
|
var _emojiRemove = _interopRequireDefault(require("@atlaskit/icon/core/emoji-remove"));
|
|
@@ -25,6 +26,7 @@ var _successEditorSuccess = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
|
25
26
|
var _warningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/warning--editor-warning"));
|
|
26
27
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
27
28
|
var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove-emoji"));
|
|
29
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
30
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
29
31
|
var _actions = require("../editor-actions/actions");
|
|
30
32
|
var _utils2 = require("../pm-plugins/utils/utils");
|
|
@@ -284,12 +286,20 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
284
286
|
tabIndex: null
|
|
285
287
|
});
|
|
286
288
|
} else {
|
|
289
|
+
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
290
|
+
return (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_1') ? {
|
|
291
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
292
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
|
|
293
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
294
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
|
|
295
|
+
} : undefined;
|
|
296
|
+
};
|
|
287
297
|
var overflowMenuConfig = [{
|
|
288
298
|
type: 'separator',
|
|
289
299
|
fullHeight: true
|
|
290
300
|
}, {
|
|
291
301
|
type: 'overflow-dropdown',
|
|
292
|
-
options: [{
|
|
302
|
+
options: [_objectSpread({
|
|
293
303
|
title: 'Copy',
|
|
294
304
|
onClick: function onClick() {
|
|
295
305
|
var _api$core, _api$floatingToolbar;
|
|
@@ -300,13 +310,13 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
300
310
|
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
301
311
|
label: "Copy"
|
|
302
312
|
})
|
|
303
|
-
}, {
|
|
313
|
+
}, hoverDecorationProps(panelNodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
|
|
304
314
|
title: 'Delete',
|
|
305
315
|
onClick: (0, _actions.removePanel)(editorAnalyticsAPI),
|
|
306
316
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
307
317
|
label: "Delete"
|
|
308
318
|
})
|
|
309
|
-
}]
|
|
319
|
+
}, hoverDecorationProps(panelNodeType))]
|
|
310
320
|
}];
|
|
311
321
|
items.push.apply(items, overflowMenuConfig);
|
|
312
322
|
}
|
|
@@ -6,6 +6,7 @@ import commonMessages, { panelMessages as messages } from '@atlaskit/editor-comm
|
|
|
6
6
|
import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
7
7
|
import { DEFAULT_BORDER_COLOR, panelBackgroundPalette } from '@atlaskit/editor-common/ui-color';
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
10
11
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
11
12
|
import EmojiRemoveIcon from '@atlaskit/icon/core/emoji-remove';
|
|
@@ -16,6 +17,7 @@ import SuccessIcon from '@atlaskit/icon/core/migration/success--editor-success';
|
|
|
16
17
|
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
17
18
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
18
19
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
22
|
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
21
23
|
import { findPanel } from '../pm-plugins/utils/utils';
|
|
@@ -264,6 +266,12 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
264
266
|
tabIndex: null
|
|
265
267
|
});
|
|
266
268
|
} else {
|
|
269
|
+
const hoverDecorationProps = (nodeType, className) => fg('platform_editor_controls_patch_1') ? {
|
|
270
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
271
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
|
|
272
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
273
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
|
|
274
|
+
} : undefined;
|
|
267
275
|
const overflowMenuConfig = [{
|
|
268
276
|
type: 'separator',
|
|
269
277
|
fullHeight: true
|
|
@@ -279,13 +287,15 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
279
287
|
},
|
|
280
288
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
281
289
|
label: "Copy"
|
|
282
|
-
})
|
|
290
|
+
}),
|
|
291
|
+
...hoverDecorationProps(panelNodeType, akEditorSelectedNodeClassName)
|
|
283
292
|
}, {
|
|
284
293
|
title: 'Delete',
|
|
285
294
|
onClick: removePanel(editorAnalyticsAPI),
|
|
286
295
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
287
296
|
label: "Delete"
|
|
288
|
-
})
|
|
297
|
+
}),
|
|
298
|
+
...hoverDecorationProps(panelNodeType)
|
|
289
299
|
}]
|
|
290
300
|
}];
|
|
291
301
|
items.push(...overflowMenuConfig);
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -9,6 +9,7 @@ import commonMessages, { panelMessages as messages } from '@atlaskit/editor-comm
|
|
|
9
9
|
import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
10
10
|
import { DEFAULT_BORDER_COLOR, panelBackgroundPalette } from '@atlaskit/editor-common/ui-color';
|
|
11
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
12
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
12
13
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
13
14
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
14
15
|
import EmojiRemoveIcon from '@atlaskit/icon/core/emoji-remove';
|
|
@@ -19,6 +20,7 @@ import SuccessIcon from '@atlaskit/icon/core/migration/success--editor-success';
|
|
|
19
20
|
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
20
21
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
21
22
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
23
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
24
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
23
25
|
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
24
26
|
import { findPanel } from '../pm-plugins/utils/utils';
|
|
@@ -274,12 +276,20 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
274
276
|
tabIndex: null
|
|
275
277
|
});
|
|
276
278
|
} else {
|
|
279
|
+
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
280
|
+
return fg('platform_editor_controls_patch_1') ? {
|
|
281
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
282
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className),
|
|
283
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
284
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false, className)
|
|
285
|
+
} : undefined;
|
|
286
|
+
};
|
|
277
287
|
var overflowMenuConfig = [{
|
|
278
288
|
type: 'separator',
|
|
279
289
|
fullHeight: true
|
|
280
290
|
}, {
|
|
281
291
|
type: 'overflow-dropdown',
|
|
282
|
-
options: [{
|
|
292
|
+
options: [_objectSpread({
|
|
283
293
|
title: 'Copy',
|
|
284
294
|
onClick: function onClick() {
|
|
285
295
|
var _api$core, _api$floatingToolbar;
|
|
@@ -290,13 +300,13 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
290
300
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
291
301
|
label: "Copy"
|
|
292
302
|
})
|
|
293
|
-
}, {
|
|
303
|
+
}, hoverDecorationProps(panelNodeType, akEditorSelectedNodeClassName)), _objectSpread({
|
|
294
304
|
title: 'Delete',
|
|
295
305
|
onClick: removePanel(editorAnalyticsAPI),
|
|
296
306
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
297
307
|
label: "Delete"
|
|
298
308
|
})
|
|
299
|
-
}]
|
|
309
|
+
}, hoverDecorationProps(panelNodeType))]
|
|
300
310
|
}];
|
|
301
311
|
items.push.apply(items, overflowMenuConfig);
|
|
302
312
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
|
-
"@atlaskit/editor-common": "^102.
|
|
35
|
+
"@atlaskit/editor-common": "^102.15.0",
|
|
36
36
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
42
42
|
"@atlaskit/emoji": "^69.0.0",
|
|
43
|
-
"@atlaskit/icon": "^25.
|
|
43
|
+
"@atlaskit/icon": "^25.3.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/theme": "^18.0.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
47
47
|
"@atlaskit/tokens": "^4.5.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"uuid": "^3.1.0"
|
|
@@ -95,6 +95,9 @@
|
|
|
95
95
|
"platform-feature-flags": {
|
|
96
96
|
"platform_editor_nbm_backspace_fixes": {
|
|
97
97
|
"type": "boolean"
|
|
98
|
+
},
|
|
99
|
+
"platform_editor_controls_patch_1": {
|
|
100
|
+
"type": "boolean"
|
|
98
101
|
}
|
|
99
102
|
},
|
|
100
103
|
"stricter": {
|