@atlaskit/editor-plugin-panel 4.2.11 → 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 +17 -0
- package/dist/cjs/nodeviews/panel.js +2 -2
- package/dist/cjs/ui/toolbar.js +37 -27
- package/dist/es2019/nodeviews/panel.js +2 -2
- package/dist/es2019/ui/toolbar.js +27 -21
- package/dist/esm/nodeviews/panel.js +2 -2
- package/dist/esm/ui/toolbar.js +32 -22
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
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
|
+
|
|
12
|
+
## 4.3.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#128788](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128788)
|
|
17
|
+
[`83a4d1ba203b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/83a4d1ba203b0) -
|
|
18
|
+
[ux] update icons
|
|
19
|
+
|
|
3
20
|
## 4.2.11
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ var _icons = require("@atlaskit/editor-common/icons");
|
|
|
16
16
|
var _panel = require("@atlaskit/editor-common/panel");
|
|
17
17
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
18
18
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
19
|
-
var
|
|
19
|
+
var _lightbulbEditorHint = _interopRequireDefault(require("@atlaskit/icon/core/migration/lightbulb--editor-hint"));
|
|
20
20
|
var _utils = require("../pm-plugins/utils/utils");
|
|
21
21
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
22
22
|
// Mapping export
|
|
@@ -24,7 +24,7 @@ var panelIcons = exports.panelIcons = {
|
|
|
24
24
|
info: _icons.PanelInfoIcon,
|
|
25
25
|
success: _icons.PanelSuccessIcon,
|
|
26
26
|
note: _icons.PanelNoteIcon,
|
|
27
|
-
tip:
|
|
27
|
+
tip: _lightbulbEditorHint.default,
|
|
28
28
|
warning: _icons.PanelWarningIcon,
|
|
29
29
|
error: _icons.PanelErrorIcon,
|
|
30
30
|
custom: _icons.PanelInfoIcon
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -15,21 +15,18 @@ 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
|
-
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
|
|
20
20
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
21
|
-
var _discovery = _interopRequireDefault(require("@atlaskit/icon/core/discovery"));
|
|
22
21
|
var _emojiRemove = _interopRequireDefault(require("@atlaskit/icon/core/emoji-remove"));
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var _note = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/note"));
|
|
22
|
+
var _crossCircleEditorError = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross-circle--editor-error"));
|
|
23
|
+
var _discoveryEditorNote = _interopRequireDefault(require("@atlaskit/icon/core/migration/discovery--editor-note"));
|
|
24
|
+
var _informationEditorInfo = _interopRequireDefault(require("@atlaskit/icon/core/migration/information--editor-info"));
|
|
25
|
+
var _successEditorSuccess = _interopRequireDefault(require("@atlaskit/icon/core/migration/success--editor-success"));
|
|
26
|
+
var _warningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/warning--editor-warning"));
|
|
29
27
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
30
28
|
var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove-emoji"));
|
|
31
|
-
var
|
|
32
|
-
var _warning2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/warning"));
|
|
29
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
33
30
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
34
31
|
var _actions = require("../editor-actions/actions");
|
|
35
32
|
var _utils2 = require("../pm-plugins/utils/utils");
|
|
@@ -62,8 +59,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
62
59
|
var items = (0, _experiments.editorExperiment)('platform_editor_controls', 'control') ? [{
|
|
63
60
|
id: 'editor.panel.info',
|
|
64
61
|
type: 'button',
|
|
65
|
-
icon:
|
|
66
|
-
iconFallback: _info.default,
|
|
62
|
+
icon: _informationEditorInfo.default,
|
|
67
63
|
onClick: (0, _actions.changePanelType)(editorAnalyticsAPI)(_adfSchema.PanelType.INFO),
|
|
68
64
|
selected: activePanelType === _adfSchema.PanelType.INFO,
|
|
69
65
|
title: formatMessage(_messages.panelMessages.info),
|
|
@@ -71,8 +67,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
71
67
|
}, {
|
|
72
68
|
id: 'editor.panel.note',
|
|
73
69
|
type: 'button',
|
|
74
|
-
icon:
|
|
75
|
-
iconFallback: _note.default,
|
|
70
|
+
icon: _discoveryEditorNote.default,
|
|
76
71
|
onClick: (0, _actions.changePanelType)(editorAnalyticsAPI)(_adfSchema.PanelType.NOTE),
|
|
77
72
|
selected: activePanelType === _adfSchema.PanelType.NOTE,
|
|
78
73
|
title: formatMessage(_messages.panelMessages.note),
|
|
@@ -80,8 +75,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
80
75
|
}, {
|
|
81
76
|
id: 'editor.panel.success',
|
|
82
77
|
type: 'button',
|
|
83
|
-
icon:
|
|
84
|
-
iconFallback: _success2.default,
|
|
78
|
+
icon: _successEditorSuccess.default,
|
|
85
79
|
onClick: (0, _actions.changePanelType)(editorAnalyticsAPI)(_adfSchema.PanelType.SUCCESS),
|
|
86
80
|
selected: activePanelType === _adfSchema.PanelType.SUCCESS,
|
|
87
81
|
title: formatMessage(_messages.panelMessages.success),
|
|
@@ -89,8 +83,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
89
83
|
}, {
|
|
90
84
|
id: 'editor.panel.warning',
|
|
91
85
|
type: 'button',
|
|
92
|
-
icon:
|
|
93
|
-
iconFallback: _warning2.default,
|
|
86
|
+
icon: _warningEditorWarning.default,
|
|
94
87
|
onClick: (0, _actions.changePanelType)(editorAnalyticsAPI)(_adfSchema.PanelType.WARNING),
|
|
95
88
|
selected: activePanelType === _adfSchema.PanelType.WARNING,
|
|
96
89
|
title: formatMessage(_messages.panelMessages.warning),
|
|
@@ -98,8 +91,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
98
91
|
}, {
|
|
99
92
|
id: 'editor.panel.error',
|
|
100
93
|
type: 'button',
|
|
101
|
-
icon:
|
|
102
|
-
iconFallback: _error.default,
|
|
94
|
+
icon: _crossCircleEditorError.default,
|
|
103
95
|
onClick: (0, _actions.changePanelType)(editorAnalyticsAPI)(_adfSchema.PanelType.ERROR),
|
|
104
96
|
selected: activePanelType === _adfSchema.PanelType.ERROR,
|
|
105
97
|
title: formatMessage(_messages.panelMessages.error),
|
|
@@ -241,8 +233,13 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
241
233
|
var removeEmojiButton = {
|
|
242
234
|
id: 'editor.panel.removeEmoji',
|
|
243
235
|
type: 'button',
|
|
244
|
-
icon:
|
|
245
|
-
|
|
236
|
+
icon: function icon() {
|
|
237
|
+
return /*#__PURE__*/_react.default.createElement(_emojiRemove.default, {
|
|
238
|
+
LEGACY_fallbackIcon: _removeEmoji.default,
|
|
239
|
+
spacing: 'spacious',
|
|
240
|
+
label: ''
|
|
241
|
+
});
|
|
242
|
+
},
|
|
246
243
|
onClick: removeEmoji(),
|
|
247
244
|
title: formatMessage(_messages.default.removeEmoji),
|
|
248
245
|
disabled: activePanelIcon ? false : true
|
|
@@ -273,8 +270,13 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
273
270
|
type: 'button',
|
|
274
271
|
appearance: 'danger',
|
|
275
272
|
focusEditoronEnter: true,
|
|
276
|
-
icon:
|
|
277
|
-
|
|
273
|
+
icon: function icon() {
|
|
274
|
+
return /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
275
|
+
LEGACY_fallbackIcon: _remove.default,
|
|
276
|
+
spacing: 'spacious',
|
|
277
|
+
label: ''
|
|
278
|
+
});
|
|
279
|
+
},
|
|
278
280
|
onClick: (0, _actions.removePanel)(editorAnalyticsAPI),
|
|
279
281
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
280
282
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
@@ -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
|
}
|
|
@@ -7,7 +7,7 @@ import { PanelErrorIcon, PanelInfoIcon, PanelNoteIcon, PanelSuccessIcon, PanelWa
|
|
|
7
7
|
import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
8
8
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
10
|
-
import
|
|
10
|
+
import LightbulbIcon from '@atlaskit/icon/core/migration/lightbulb--editor-hint';
|
|
11
11
|
import { panelAttrsToDom } from '../pm-plugins/utils/utils';
|
|
12
12
|
|
|
13
13
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
@@ -16,7 +16,7 @@ export const panelIcons = {
|
|
|
16
16
|
info: PanelInfoIcon,
|
|
17
17
|
success: PanelSuccessIcon,
|
|
18
18
|
note: PanelNoteIcon,
|
|
19
|
-
tip:
|
|
19
|
+
tip: LightbulbIcon,
|
|
20
20
|
warning: PanelWarningIcon,
|
|
21
21
|
error: PanelErrorIcon,
|
|
22
22
|
custom: PanelInfoIcon
|
|
@@ -6,21 +6,18 @@ 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
|
-
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
11
11
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
12
|
-
import DiscoveryIcon from '@atlaskit/icon/core/discovery';
|
|
13
12
|
import EmojiRemoveIcon from '@atlaskit/icon/core/emoji-remove';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import LegacyNoteIcon from '@atlaskit/icon/glyph/editor/note';
|
|
13
|
+
import CrossCircleIcon from '@atlaskit/icon/core/migration/cross-circle--editor-error';
|
|
14
|
+
import DiscoveryIcon from '@atlaskit/icon/core/migration/discovery--editor-note';
|
|
15
|
+
import InformationIcon from '@atlaskit/icon/core/migration/information--editor-info';
|
|
16
|
+
import SuccessIcon from '@atlaskit/icon/core/migration/success--editor-success';
|
|
17
|
+
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
20
18
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
21
19
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
22
|
-
import
|
|
23
|
-
import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
22
|
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
26
23
|
import { findPanel } from '../pm-plugins/utils/utils';
|
|
@@ -57,7 +54,6 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
57
54
|
id: 'editor.panel.info',
|
|
58
55
|
type: 'button',
|
|
59
56
|
icon: InformationIcon,
|
|
60
|
-
iconFallback: InfoIcon,
|
|
61
57
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.INFO),
|
|
62
58
|
selected: activePanelType === PanelType.INFO,
|
|
63
59
|
title: formatMessage(messages.info),
|
|
@@ -66,7 +62,6 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
66
62
|
id: 'editor.panel.note',
|
|
67
63
|
type: 'button',
|
|
68
64
|
icon: DiscoveryIcon,
|
|
69
|
-
iconFallback: LegacyNoteIcon,
|
|
70
65
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.NOTE),
|
|
71
66
|
selected: activePanelType === PanelType.NOTE,
|
|
72
67
|
title: formatMessage(messages.note),
|
|
@@ -75,7 +70,6 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
75
70
|
id: 'editor.panel.success',
|
|
76
71
|
type: 'button',
|
|
77
72
|
icon: SuccessIcon,
|
|
78
|
-
iconFallback: LegacySuccessIcon,
|
|
79
73
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.SUCCESS),
|
|
80
74
|
selected: activePanelType === PanelType.SUCCESS,
|
|
81
75
|
title: formatMessage(messages.success),
|
|
@@ -84,7 +78,6 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
84
78
|
id: 'editor.panel.warning',
|
|
85
79
|
type: 'button',
|
|
86
80
|
icon: WarningIcon,
|
|
87
|
-
iconFallback: LegacyWarningIcon,
|
|
88
81
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.WARNING),
|
|
89
82
|
selected: activePanelType === PanelType.WARNING,
|
|
90
83
|
title: formatMessage(messages.warning),
|
|
@@ -93,7 +86,6 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
93
86
|
id: 'editor.panel.error',
|
|
94
87
|
type: 'button',
|
|
95
88
|
icon: CrossCircleIcon,
|
|
96
|
-
iconFallback: ErrorIcon,
|
|
97
89
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.ERROR),
|
|
98
90
|
selected: activePanelType === PanelType.ERROR,
|
|
99
91
|
title: formatMessage(messages.error),
|
|
@@ -225,8 +217,11 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
225
217
|
const removeEmojiButton = {
|
|
226
218
|
id: 'editor.panel.removeEmoji',
|
|
227
219
|
type: 'button',
|
|
228
|
-
icon: EmojiRemoveIcon,
|
|
229
|
-
|
|
220
|
+
icon: () => /*#__PURE__*/React.createElement(EmojiRemoveIcon, {
|
|
221
|
+
LEGACY_fallbackIcon: RemoveEmojiIcon,
|
|
222
|
+
spacing: 'spacious',
|
|
223
|
+
label: ''
|
|
224
|
+
}),
|
|
230
225
|
onClick: removeEmoji(),
|
|
231
226
|
title: formatMessage(commonMessages.removeEmoji),
|
|
232
227
|
disabled: activePanelIcon ? false : true
|
|
@@ -257,8 +252,11 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
257
252
|
type: 'button',
|
|
258
253
|
appearance: 'danger',
|
|
259
254
|
focusEditoronEnter: true,
|
|
260
|
-
icon: DeleteIcon,
|
|
261
|
-
|
|
255
|
+
icon: () => /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
256
|
+
LEGACY_fallbackIcon: RemoveIcon,
|
|
257
|
+
spacing: 'spacious',
|
|
258
|
+
label: ''
|
|
259
|
+
}),
|
|
262
260
|
onClick: removePanel(editorAnalyticsAPI),
|
|
263
261
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
264
262
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
@@ -268,6 +266,12 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
268
266
|
tabIndex: null
|
|
269
267
|
});
|
|
270
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;
|
|
271
275
|
const overflowMenuConfig = [{
|
|
272
276
|
type: 'separator',
|
|
273
277
|
fullHeight: true
|
|
@@ -283,13 +287,15 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
283
287
|
},
|
|
284
288
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
285
289
|
label: "Copy"
|
|
286
|
-
})
|
|
290
|
+
}),
|
|
291
|
+
...hoverDecorationProps(panelNodeType, akEditorSelectedNodeClassName)
|
|
287
292
|
}, {
|
|
288
293
|
title: 'Delete',
|
|
289
294
|
onClick: removePanel(editorAnalyticsAPI),
|
|
290
295
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
291
296
|
label: "Delete"
|
|
292
|
-
})
|
|
297
|
+
}),
|
|
298
|
+
...hoverDecorationProps(panelNodeType)
|
|
293
299
|
}]
|
|
294
300
|
}];
|
|
295
301
|
items.push(...overflowMenuConfig);
|
|
@@ -9,7 +9,7 @@ import { PanelErrorIcon, PanelInfoIcon, PanelNoteIcon, PanelSuccessIcon, PanelWa
|
|
|
9
9
|
import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
10
10
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
12
|
-
import
|
|
12
|
+
import LightbulbIcon from '@atlaskit/icon/core/migration/lightbulb--editor-hint';
|
|
13
13
|
import { panelAttrsToDom } from '../pm-plugins/utils/utils';
|
|
14
14
|
|
|
15
15
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
@@ -18,7 +18,7 @@ export var panelIcons = {
|
|
|
18
18
|
info: PanelInfoIcon,
|
|
19
19
|
success: PanelSuccessIcon,
|
|
20
20
|
note: PanelNoteIcon,
|
|
21
|
-
tip:
|
|
21
|
+
tip: LightbulbIcon,
|
|
22
22
|
warning: PanelWarningIcon,
|
|
23
23
|
error: PanelErrorIcon,
|
|
24
24
|
custom: PanelInfoIcon
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -9,21 +9,18 @@ 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
|
-
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
14
14
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
15
|
-
import DiscoveryIcon from '@atlaskit/icon/core/discovery';
|
|
16
15
|
import EmojiRemoveIcon from '@atlaskit/icon/core/emoji-remove';
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import LegacyNoteIcon from '@atlaskit/icon/glyph/editor/note';
|
|
16
|
+
import CrossCircleIcon from '@atlaskit/icon/core/migration/cross-circle--editor-error';
|
|
17
|
+
import DiscoveryIcon from '@atlaskit/icon/core/migration/discovery--editor-note';
|
|
18
|
+
import InformationIcon from '@atlaskit/icon/core/migration/information--editor-info';
|
|
19
|
+
import SuccessIcon from '@atlaskit/icon/core/migration/success--editor-success';
|
|
20
|
+
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
23
21
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
24
22
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
25
|
-
import
|
|
26
|
-
import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
23
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
24
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
28
25
|
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
29
26
|
import { findPanel } from '../pm-plugins/utils/utils';
|
|
@@ -53,7 +50,6 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
53
50
|
id: 'editor.panel.info',
|
|
54
51
|
type: 'button',
|
|
55
52
|
icon: InformationIcon,
|
|
56
|
-
iconFallback: InfoIcon,
|
|
57
53
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.INFO),
|
|
58
54
|
selected: activePanelType === PanelType.INFO,
|
|
59
55
|
title: formatMessage(messages.info),
|
|
@@ -62,7 +58,6 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
62
58
|
id: 'editor.panel.note',
|
|
63
59
|
type: 'button',
|
|
64
60
|
icon: DiscoveryIcon,
|
|
65
|
-
iconFallback: LegacyNoteIcon,
|
|
66
61
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.NOTE),
|
|
67
62
|
selected: activePanelType === PanelType.NOTE,
|
|
68
63
|
title: formatMessage(messages.note),
|
|
@@ -71,7 +66,6 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
71
66
|
id: 'editor.panel.success',
|
|
72
67
|
type: 'button',
|
|
73
68
|
icon: SuccessIcon,
|
|
74
|
-
iconFallback: LegacySuccessIcon,
|
|
75
69
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.SUCCESS),
|
|
76
70
|
selected: activePanelType === PanelType.SUCCESS,
|
|
77
71
|
title: formatMessage(messages.success),
|
|
@@ -80,7 +74,6 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
80
74
|
id: 'editor.panel.warning',
|
|
81
75
|
type: 'button',
|
|
82
76
|
icon: WarningIcon,
|
|
83
|
-
iconFallback: LegacyWarningIcon,
|
|
84
77
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.WARNING),
|
|
85
78
|
selected: activePanelType === PanelType.WARNING,
|
|
86
79
|
title: formatMessage(messages.warning),
|
|
@@ -89,7 +82,6 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
89
82
|
id: 'editor.panel.error',
|
|
90
83
|
type: 'button',
|
|
91
84
|
icon: CrossCircleIcon,
|
|
92
|
-
iconFallback: ErrorIcon,
|
|
93
85
|
onClick: changePanelType(editorAnalyticsAPI)(PanelType.ERROR),
|
|
94
86
|
selected: activePanelType === PanelType.ERROR,
|
|
95
87
|
title: formatMessage(messages.error),
|
|
@@ -231,8 +223,13 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
231
223
|
var removeEmojiButton = {
|
|
232
224
|
id: 'editor.panel.removeEmoji',
|
|
233
225
|
type: 'button',
|
|
234
|
-
icon:
|
|
235
|
-
|
|
226
|
+
icon: function icon() {
|
|
227
|
+
return /*#__PURE__*/React.createElement(EmojiRemoveIcon, {
|
|
228
|
+
LEGACY_fallbackIcon: RemoveEmojiIcon,
|
|
229
|
+
spacing: 'spacious',
|
|
230
|
+
label: ''
|
|
231
|
+
});
|
|
232
|
+
},
|
|
236
233
|
onClick: removeEmoji(),
|
|
237
234
|
title: formatMessage(commonMessages.removeEmoji),
|
|
238
235
|
disabled: activePanelIcon ? false : true
|
|
@@ -263,8 +260,13 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
263
260
|
type: 'button',
|
|
264
261
|
appearance: 'danger',
|
|
265
262
|
focusEditoronEnter: true,
|
|
266
|
-
icon:
|
|
267
|
-
|
|
263
|
+
icon: function icon() {
|
|
264
|
+
return /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
265
|
+
LEGACY_fallbackIcon: RemoveIcon,
|
|
266
|
+
spacing: 'spacious',
|
|
267
|
+
label: ''
|
|
268
|
+
});
|
|
269
|
+
},
|
|
268
270
|
onClick: removePanel(editorAnalyticsAPI),
|
|
269
271
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
270
272
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
@@ -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
|
+
"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": {
|