@atlaskit/editor-plugin-selection-extension 7.1.3 → 7.2.0
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 +11 -0
- package/dist/cjs/ui/toolbar-components/MenuItem.js +9 -1
- package/dist/es2019/ui/toolbar-components/MenuItem.js +9 -1
- package/dist/esm/ui/toolbar-components/MenuItem.js +9 -1
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types-ts4.5/types/index.d.ts +6 -0
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 7.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ed556ceff1790`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ed556ceff1790) -
|
|
8
|
+
Update selectionExtension config to accept lozenge in menu button
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 7.1.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -8,6 +8,9 @@ exports.MenuItem = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
|
+
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
11
14
|
var _main = require("../../pm-plugins/main");
|
|
12
15
|
var _utils = require("../../pm-plugins/utils");
|
|
13
16
|
var _types = require("../../types");
|
|
@@ -53,6 +56,11 @@ var MenuItem = exports.MenuItem = function MenuItem(_ref) {
|
|
|
53
56
|
}),
|
|
54
57
|
onClick: onClickHandle(extension),
|
|
55
58
|
isDisabled: extension.isDisabled
|
|
56
|
-
}, extension.label)
|
|
59
|
+
}, extension.label, extension.lozenge && (0, _platformFeatureFlags.fg)('platform_editor_selection_extension_lozenge') && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
60
|
+
as: "span",
|
|
61
|
+
paddingInline: "space.100"
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
63
|
+
appearance: 'new'
|
|
64
|
+
}, extension.lozenge.label)));
|
|
57
65
|
}));
|
|
58
66
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
4
7
|
import { selectionExtensionPluginKey } from '../../pm-plugins/main';
|
|
5
8
|
import { getSelectionAdfInfoNew, getSelectionTextInfo } from '../../pm-plugins/utils';
|
|
6
9
|
import { SelectionExtensionActionTypes } from '../../types';
|
|
@@ -48,6 +51,11 @@ export const MenuItem = ({
|
|
|
48
51
|
}),
|
|
49
52
|
onClick: onClickHandle(extension),
|
|
50
53
|
isDisabled: extension.isDisabled
|
|
51
|
-
}, extension.label)
|
|
54
|
+
}, extension.label, extension.lozenge && fg('platform_editor_selection_extension_lozenge') && /*#__PURE__*/React.createElement(Box, {
|
|
55
|
+
as: "span",
|
|
56
|
+
paddingInline: "space.100"
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
58
|
+
appearance: 'new'
|
|
59
|
+
}, extension.lozenge.label)));
|
|
52
60
|
}));
|
|
53
61
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
4
7
|
import { selectionExtensionPluginKey } from '../../pm-plugins/main';
|
|
5
8
|
import { getSelectionAdfInfoNew, getSelectionTextInfo } from '../../pm-plugins/utils';
|
|
6
9
|
import { SelectionExtensionActionTypes } from '../../types';
|
|
@@ -46,6 +49,11 @@ export var MenuItem = function MenuItem(_ref) {
|
|
|
46
49
|
}),
|
|
47
50
|
onClick: onClickHandle(extension),
|
|
48
51
|
isDisabled: extension.isDisabled
|
|
49
|
-
}, extension.label)
|
|
52
|
+
}, extension.label, extension.lozenge && fg('platform_editor_selection_extension_lozenge') && /*#__PURE__*/React.createElement(Box, {
|
|
53
|
+
as: "span",
|
|
54
|
+
paddingInline: "space.100"
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
56
|
+
appearance: 'new'
|
|
57
|
+
}, extension.lozenge.label)));
|
|
50
58
|
}));
|
|
51
59
|
};
|
|
@@ -155,6 +155,12 @@ export type ExtensionMenuItemConfiguration = {
|
|
|
155
155
|
}>>;
|
|
156
156
|
isDisabled?: boolean;
|
|
157
157
|
label: string;
|
|
158
|
+
/**
|
|
159
|
+
* Optional lozenge to display next to the label in the menu
|
|
160
|
+
*/
|
|
161
|
+
lozenge?: {
|
|
162
|
+
label: string;
|
|
163
|
+
};
|
|
158
164
|
onClick?: () => void;
|
|
159
165
|
/**
|
|
160
166
|
* Optional menu-section to declare grouping - only used for menu items
|
|
@@ -155,6 +155,12 @@ export type ExtensionMenuItemConfiguration = {
|
|
|
155
155
|
}>>;
|
|
156
156
|
isDisabled?: boolean;
|
|
157
157
|
label: string;
|
|
158
|
+
/**
|
|
159
|
+
* Optional lozenge to display next to the label in the menu
|
|
160
|
+
*/
|
|
161
|
+
lozenge?: {
|
|
162
|
+
label: string;
|
|
163
|
+
};
|
|
158
164
|
onClick?: () => void;
|
|
159
165
|
/**
|
|
160
166
|
* Optional menu-section to declare grouping - only used for menu items
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,9 +47,11 @@
|
|
|
47
47
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
48
48
|
"@atlaskit/editor-toolbar": "^0.18.0",
|
|
49
49
|
"@atlaskit/icon": "^29.0.0",
|
|
50
|
+
"@atlaskit/lozenge": "^13.1.0",
|
|
50
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
52
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
52
|
-
"@atlaskit/
|
|
53
|
+
"@atlaskit/primitives": "^16.4.0",
|
|
54
|
+
"@atlaskit/tmp-editor-statsig": "^14.6.0",
|
|
53
55
|
"@babel/runtime": "^7.0.0",
|
|
54
56
|
"lodash": "^4.17.21",
|
|
55
57
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
@@ -106,6 +108,9 @@
|
|
|
106
108
|
"platform_editor_use_preferences_plugin": {
|
|
107
109
|
"type": "boolean"
|
|
108
110
|
},
|
|
111
|
+
"platform_editor_selection_extension_lozenge": {
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
},
|
|
109
114
|
"platform_editor_selection_extension_improvement": {
|
|
110
115
|
"type": "boolean"
|
|
111
116
|
}
|