@atlaskit/editor-plugin-block-type 5.1.8 → 5.1.10
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,22 @@
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
2
2
|
|
3
|
+
## 5.1.10
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#134532](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134532)
|
8
|
+
[`0348d508d8954`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0348d508d8954) -
|
9
|
+
[ux] Do not show icons in the Text styles dropdown when Editor Controls is disabled
|
10
|
+
- [#134202](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134202)
|
11
|
+
[`1c44e9c82bcce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c44e9c82bcce) -
|
12
|
+
[ux] ED-27384 fix comments toolbar responsiveness
|
13
|
+
|
14
|
+
## 5.1.9
|
15
|
+
|
16
|
+
### Patch Changes
|
17
|
+
|
18
|
+
- Updated dependencies
|
19
|
+
|
3
20
|
## 5.1.8
|
4
21
|
|
5
22
|
### Patch Changes
|
@@ -19,6 +19,8 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
19
19
|
var _styles = require("@atlaskit/editor-common/styles");
|
20
20
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
21
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
23
|
+
var _primitives = require("@atlaskit/primitives");
|
22
24
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
23
25
|
var _tokens = require("@atlaskit/tokens");
|
24
26
|
var _blockTypes = require("../../block-types");
|
@@ -32,6 +34,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
32
34
|
* @jsxRuntime classic
|
33
35
|
* @jsx jsx
|
34
36
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
37
|
+
var buttonWrapperStyles = (0, _primitives.xcss)({
|
38
|
+
flexShrink: 0
|
39
|
+
});
|
35
40
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
36
41
|
var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
37
42
|
function ToolbarBlockType() {
|
@@ -89,7 +94,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
89
94
|
value: blockType,
|
90
95
|
'aria-label': (0, _keymaps.tooltip)(keyMap, formatMessage(blockType.title)),
|
91
96
|
key: "".concat(blockType.name, "-").concat(index),
|
92
|
-
elemBefore: blockType === null || blockType === void 0 ? void 0 : blockType.icon,
|
97
|
+
elemBefore: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? blockType === null || blockType === void 0 ? void 0 : blockType.icon : undefined,
|
93
98
|
elemAfter:
|
94
99
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
95
100
|
(0, _react2.jsx)("div", {
|
@@ -208,6 +213,19 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
208
213
|
});
|
209
214
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
210
215
|
var items = this.createItems();
|
216
|
+
var button = (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
|
217
|
+
isSmall: isSmall,
|
218
|
+
isReducedSpacing: isReducedSpacing,
|
219
|
+
selected: active,
|
220
|
+
disabled: false,
|
221
|
+
title: blockTypeTitles[0],
|
222
|
+
onClick: this.handleTriggerClick,
|
223
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
224
|
+
formatMessage: formatMessage,
|
225
|
+
"aria-expanded": active,
|
226
|
+
blockTypeName: currentBlockType.name,
|
227
|
+
blockTypeIcon: (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon) || (0, _react2.jsx)(_icons.Text, null)
|
228
|
+
});
|
211
229
|
return (0, _react2.jsx)("span", {
|
212
230
|
css: (0, _experiments.editorExperiment)('platform_editor_blockquote_in_text_formatting_menu', true) ?
|
213
231
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
@@ -240,19 +258,11 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
240
258
|
}
|
241
259
|
return isOpenedByKeyboard;
|
242
260
|
}
|
243
|
-
}, (0,
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
title: blockTypeTitles[0],
|
249
|
-
onClick: this.handleTriggerClick,
|
250
|
-
onKeyDown: this.handleTriggerByKeyboard,
|
251
|
-
formatMessage: formatMessage,
|
252
|
-
"aria-expanded": active,
|
253
|
-
blockTypeName: currentBlockType.name,
|
254
|
-
blockTypeIcon: (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon) || (0, _react2.jsx)(_icons.Text, null)
|
255
|
-
})), !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _react2.jsx)("span", {
|
261
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_comments_toolbar_responsiveness') ?
|
262
|
+
// extra wrapper added to prevent flex shrinking of the button
|
263
|
+
(0, _react2.jsx)(_primitives.Box, {
|
264
|
+
xcss: buttonWrapperStyles
|
265
|
+
}, button) : button), !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _react2.jsx)("span", {
|
256
266
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
257
267
|
css: _styles.separatorStyles
|
258
268
|
}));
|
@@ -8,17 +8,22 @@ import React from 'react';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
9
9
|
import { jsx } from '@emotion/react';
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
11
|
-
import { findKeymapByDescription, tooltip
|
11
|
+
import { clearFormatting, findKeymapByDescription, tooltip } from '@atlaskit/editor-common/keymaps';
|
12
12
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
13
13
|
import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
14
14
|
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
15
15
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
17
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
16
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
17
19
|
import { ThemeMutationObserver } from '@atlaskit/tokens';
|
18
20
|
import { NORMAL_TEXT } from '../../block-types';
|
19
21
|
import { BlockTypeButton } from './blocktype-button';
|
20
22
|
import { Text } from './icons';
|
21
|
-
import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect
|
23
|
+
import { blockTypeMenuItemStyle, floatingToolbarWrapperStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
24
|
+
const buttonWrapperStyles = xcss({
|
25
|
+
flexShrink: 0
|
26
|
+
});
|
22
27
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
23
28
|
class ToolbarBlockType extends React.PureComponent {
|
24
29
|
constructor(...args) {
|
@@ -77,7 +82,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
77
82
|
value: blockType,
|
78
83
|
'aria-label': tooltip(keyMap, formatMessage(blockType.title)),
|
79
84
|
key: `${blockType.name}-${index}`,
|
80
|
-
elemBefore: blockType === null || blockType === void 0 ? void 0 : blockType.icon,
|
85
|
+
elemBefore: editorExperiment('platform_editor_controls', 'variant1') ? blockType === null || blockType === void 0 ? void 0 : blockType.icon : undefined,
|
81
86
|
elemAfter:
|
82
87
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
83
88
|
jsx("div", {
|
@@ -185,6 +190,19 @@ class ToolbarBlockType extends React.PureComponent {
|
|
185
190
|
const blockTypeTitles = availableBlockTypesInDropdown.filter(blockType => blockType.name === currentBlockType.name).map(blockType => blockType.title);
|
186
191
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
187
192
|
const items = this.createItems();
|
193
|
+
const button = jsx(BlockTypeButton, {
|
194
|
+
isSmall: isSmall,
|
195
|
+
isReducedSpacing: isReducedSpacing,
|
196
|
+
selected: active,
|
197
|
+
disabled: false,
|
198
|
+
title: blockTypeTitles[0],
|
199
|
+
onClick: this.handleTriggerClick,
|
200
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
201
|
+
formatMessage: formatMessage,
|
202
|
+
"aria-expanded": active,
|
203
|
+
blockTypeName: currentBlockType.name,
|
204
|
+
blockTypeIcon: (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon) || jsx(Text, null)
|
205
|
+
});
|
188
206
|
return jsx("span", {
|
189
207
|
css: editorExperiment('platform_editor_blockquote_in_text_formatting_menu', true) ?
|
190
208
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
@@ -218,19 +236,11 @@ class ToolbarBlockType extends React.PureComponent {
|
|
218
236
|
}
|
219
237
|
return isOpenedByKeyboard;
|
220
238
|
}
|
221
|
-
},
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
title: blockTypeTitles[0],
|
227
|
-
onClick: this.handleTriggerClick,
|
228
|
-
onKeyDown: this.handleTriggerByKeyboard,
|
229
|
-
formatMessage: formatMessage,
|
230
|
-
"aria-expanded": active,
|
231
|
-
blockTypeName: currentBlockType.name,
|
232
|
-
blockTypeIcon: (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon) || jsx(Text, null)
|
233
|
-
})), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
|
239
|
+
}, fg('platform_editor_comments_toolbar_responsiveness') ?
|
240
|
+
// extra wrapper added to prevent flex shrinking of the button
|
241
|
+
jsx(Box, {
|
242
|
+
xcss: buttonWrapperStyles
|
243
|
+
}, button) : button), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
|
234
244
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
235
245
|
css: separatorStyles
|
236
246
|
}));
|
@@ -17,17 +17,22 @@ import React from 'react';
|
|
17
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
18
18
|
import { jsx } from '@emotion/react';
|
19
19
|
import { injectIntl } from 'react-intl-next';
|
20
|
-
import { findKeymapByDescription, tooltip
|
20
|
+
import { clearFormatting, findKeymapByDescription, tooltip } from '@atlaskit/editor-common/keymaps';
|
21
21
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
22
22
|
import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
23
23
|
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
24
24
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
25
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
26
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
25
27
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
26
28
|
import { ThemeMutationObserver } from '@atlaskit/tokens';
|
27
29
|
import { NORMAL_TEXT } from '../../block-types';
|
28
30
|
import { BlockTypeButton } from './blocktype-button';
|
29
31
|
import { Text } from './icons';
|
30
|
-
import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect
|
32
|
+
import { blockTypeMenuItemStyle, floatingToolbarWrapperStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
33
|
+
var buttonWrapperStyles = xcss({
|
34
|
+
flexShrink: 0
|
35
|
+
});
|
31
36
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
32
37
|
var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
33
38
|
function ToolbarBlockType() {
|
@@ -85,7 +90,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
85
90
|
value: blockType,
|
86
91
|
'aria-label': tooltip(keyMap, formatMessage(blockType.title)),
|
87
92
|
key: "".concat(blockType.name, "-").concat(index),
|
88
|
-
elemBefore: blockType === null || blockType === void 0 ? void 0 : blockType.icon,
|
93
|
+
elemBefore: editorExperiment('platform_editor_controls', 'variant1') ? blockType === null || blockType === void 0 ? void 0 : blockType.icon : undefined,
|
89
94
|
elemAfter:
|
90
95
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
91
96
|
jsx("div", {
|
@@ -204,6 +209,19 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
204
209
|
});
|
205
210
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
206
211
|
var items = this.createItems();
|
212
|
+
var button = jsx(BlockTypeButton, {
|
213
|
+
isSmall: isSmall,
|
214
|
+
isReducedSpacing: isReducedSpacing,
|
215
|
+
selected: active,
|
216
|
+
disabled: false,
|
217
|
+
title: blockTypeTitles[0],
|
218
|
+
onClick: this.handleTriggerClick,
|
219
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
220
|
+
formatMessage: formatMessage,
|
221
|
+
"aria-expanded": active,
|
222
|
+
blockTypeName: currentBlockType.name,
|
223
|
+
blockTypeIcon: (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon) || jsx(Text, null)
|
224
|
+
});
|
207
225
|
return jsx("span", {
|
208
226
|
css: editorExperiment('platform_editor_blockquote_in_text_formatting_menu', true) ?
|
209
227
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
@@ -236,19 +254,11 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
236
254
|
}
|
237
255
|
return isOpenedByKeyboard;
|
238
256
|
}
|
239
|
-
},
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
title: blockTypeTitles[0],
|
245
|
-
onClick: this.handleTriggerClick,
|
246
|
-
onKeyDown: this.handleTriggerByKeyboard,
|
247
|
-
formatMessage: formatMessage,
|
248
|
-
"aria-expanded": active,
|
249
|
-
blockTypeName: currentBlockType.name,
|
250
|
-
blockTypeIcon: (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon) || jsx(Text, null)
|
251
|
-
})), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
|
257
|
+
}, fg('platform_editor_comments_toolbar_responsiveness') ?
|
258
|
+
// extra wrapper added to prevent flex shrinking of the button
|
259
|
+
jsx(Box, {
|
260
|
+
xcss: buttonWrapperStyles
|
261
|
+
}, button) : button), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
|
252
262
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
253
263
|
css: separatorStyles
|
254
264
|
}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "5.1.
|
3
|
+
"version": "5.1.10",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -36,19 +36,19 @@
|
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
38
|
"@atlaskit/adf-schema": "^47.6.0",
|
39
|
-
"@atlaskit/editor-common": "^102.
|
39
|
+
"@atlaskit/editor-common": "^102.15.0",
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
41
41
|
"@atlaskit/editor-plugin-primary-toolbar": "^3.1.0",
|
42
|
-
"@atlaskit/editor-plugin-selection-toolbar": "^
|
42
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^3.0.0",
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
44
44
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
45
45
|
"@atlaskit/editor-tables": "^2.9.0",
|
46
|
-
"@atlaskit/icon": "^25.
|
46
|
+
"@atlaskit/icon": "^25.3.0",
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
48
48
|
"@atlaskit/primitives": "^14.2.0",
|
49
49
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
50
50
|
"@atlaskit/theme": "^18.0.0",
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^4.5.0",
|
52
52
|
"@atlaskit/tokens": "^4.5.0",
|
53
53
|
"@babel/runtime": "^7.0.0",
|
54
54
|
"@emotion/react": "^11.7.1"
|
@@ -109,6 +109,9 @@
|
|
109
109
|
"platform-feature-flags": {
|
110
110
|
"platform_editor_toolbar_responsive_fixes": {
|
111
111
|
"type": "boolean"
|
112
|
+
},
|
113
|
+
"platform_editor_comments_toolbar_responsiveness": {
|
114
|
+
"type": "boolean"
|
112
115
|
}
|
113
116
|
}
|
114
117
|
}
|