@atlaskit/editor-plugin-panel 4.3.0 → 4.3.2
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 +18 -0
- package/dist/cjs/ui/toolbar.js +17 -7
- package/dist/es2019/ui/toolbar.js +16 -6
- package/dist/esm/ui/toolbar.js +17 -7
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 4.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#135586](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/135586)
|
|
8
|
+
[`3aeba66081612`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3aeba66081612) -
|
|
9
|
+
ED-26593 Add missing i18n for editor control
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 4.3.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#134468](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134468)
|
|
17
|
+
[`e312ec529d05a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e312ec529d05a) -
|
|
18
|
+
[ux] Apply hover decoration when hovering on copy/delete button on overflow menu
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 4.3.0
|
|
4
22
|
|
|
5
23
|
### 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,13 +286,21 @@ 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: [{
|
|
293
|
-
title:
|
|
302
|
+
options: [_objectSpread({
|
|
303
|
+
title: formatMessage(_messages.default.copyToClipboard),
|
|
294
304
|
onClick: function onClick() {
|
|
295
305
|
var _api$core, _api$floatingToolbar;
|
|
296
306
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute( // @ts-ignore
|
|
@@ -298,15 +308,15 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
298
308
|
return true;
|
|
299
309
|
},
|
|
300
310
|
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
301
|
-
label: "
|
|
311
|
+
label: ""
|
|
302
312
|
})
|
|
303
|
-
}, {
|
|
304
|
-
title:
|
|
313
|
+
}, hoverDecorationProps(panelNodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
|
|
314
|
+
title: formatMessage(_messages.default.delete),
|
|
305
315
|
onClick: (0, _actions.removePanel)(editorAnalyticsAPI),
|
|
306
316
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
307
|
-
label: "
|
|
317
|
+
label: ""
|
|
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,13 +266,19 @@ 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
|
|
270
278
|
}, {
|
|
271
279
|
type: 'overflow-dropdown',
|
|
272
280
|
options: [{
|
|
273
|
-
title:
|
|
281
|
+
title: formatMessage(commonMessages.copyToClipboard),
|
|
274
282
|
onClick: () => {
|
|
275
283
|
var _api$core, _api$floatingToolbar;
|
|
276
284
|
api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute( // @ts-ignore
|
|
@@ -278,14 +286,16 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
278
286
|
return true;
|
|
279
287
|
},
|
|
280
288
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
281
|
-
label: "
|
|
282
|
-
})
|
|
289
|
+
label: ""
|
|
290
|
+
}),
|
|
291
|
+
...hoverDecorationProps(panelNodeType, akEditorSelectedNodeClassName)
|
|
283
292
|
}, {
|
|
284
|
-
title:
|
|
293
|
+
title: formatMessage(commonMessages.delete),
|
|
285
294
|
onClick: removePanel(editorAnalyticsAPI),
|
|
286
295
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
287
|
-
label: "
|
|
288
|
-
})
|
|
296
|
+
label: ""
|
|
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,13 +276,21 @@ 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: [{
|
|
283
|
-
title:
|
|
292
|
+
options: [_objectSpread({
|
|
293
|
+
title: formatMessage(commonMessages.copyToClipboard),
|
|
284
294
|
onClick: function onClick() {
|
|
285
295
|
var _api$core, _api$floatingToolbar;
|
|
286
296
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute( // @ts-ignore
|
|
@@ -288,15 +298,15 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
288
298
|
return true;
|
|
289
299
|
},
|
|
290
300
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
291
|
-
label: "
|
|
301
|
+
label: ""
|
|
292
302
|
})
|
|
293
|
-
}, {
|
|
294
|
-
title:
|
|
303
|
+
}, hoverDecorationProps(panelNodeType, akEditorSelectedNodeClassName)), _objectSpread({
|
|
304
|
+
title: formatMessage(commonMessages.delete),
|
|
295
305
|
onClick: removePanel(editorAnalyticsAPI),
|
|
296
306
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
297
|
-
label: "
|
|
307
|
+
label: ""
|
|
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.2",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
|
-
"@atlaskit/editor-common": "^102.
|
|
35
|
+
"@atlaskit/editor-common": "^102.18.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",
|
|
39
|
-
"@atlaskit/editor-plugin-emoji": "^3.
|
|
39
|
+
"@atlaskit/editor-plugin-emoji": "^3.4.0",
|
|
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.5.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/theme": "^18.0.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
47
|
-
"@atlaskit/tokens": "^4.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
47
|
+
"@atlaskit/tokens": "^4.6.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"uuid": "^3.1.0"
|
|
50
50
|
},
|
|
@@ -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": {
|