@atlaskit/editor-plugin-block-type 5.2.5 → 5.2.6
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 +8 -0
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/blocktype-button.js +1 -1
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/index.js +6 -10
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/blocktype-button.js +1 -1
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/index.js +6 -10
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/blocktype-button.js +1 -1
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/index.js +6 -10
- package/package.json +7 -14
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
2
2
|
|
3
|
+
## 5.2.6
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#180492](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/180492)
|
8
|
+
[`2341110d5c5a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2341110d5c5a1) -
|
9
|
+
Clean up platform_editor_comments_toolbar_responsiveness
|
10
|
+
|
3
11
|
## 5.2.5
|
4
12
|
|
5
13
|
### Patch Changes
|
@@ -47,7 +47,7 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
|
|
47
47
|
color: "currentColor",
|
48
48
|
LEGACY_fallbackIcon: _textStyle.default
|
49
49
|
});
|
50
|
-
var chevronIconSpacing = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall
|
50
|
+
var chevronIconSpacing = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall || !props.isSmall && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
|
51
51
|
var shouldUseIconAsButton = props.isSmall || (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13');
|
52
52
|
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
53
53
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
@@ -20,13 +20,11 @@ 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
22
|
var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
|
23
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
24
23
|
var _primitives = require("@atlaskit/primitives");
|
25
24
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
26
25
|
var _tokens = require("@atlaskit/tokens");
|
27
26
|
var _blockTypes = require("../../block-types");
|
28
27
|
var _blocktypeButton = require("./blocktype-button");
|
29
|
-
var _icons = require("./icons");
|
30
28
|
var _styled = require("./styled");
|
31
29
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
32
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -90,7 +88,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
90
88
|
}) : blockType.title.defaultMessage;
|
91
89
|
var description = typeof defaultMessage === 'string' ? defaultMessage : defaultMessage && 'value' in defaultMessage ? defaultMessage.value : '';
|
92
90
|
var keyMap = (0, _keymaps.findKeymapByDescription)(description);
|
93
|
-
var icon =
|
91
|
+
var icon = blockType === null || blockType === void 0 ? void 0 : blockType.icon;
|
94
92
|
var item = {
|
95
93
|
content:
|
96
94
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
@@ -219,10 +217,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
219
217
|
}).map(function (blockType) {
|
220
218
|
return blockType.title;
|
221
219
|
});
|
222
|
-
var defaultIcon = (0,
|
220
|
+
var defaultIcon = (0, _react2.jsx)(_text.default, {
|
223
221
|
label: ""
|
224
|
-
})
|
225
|
-
var currentIcon =
|
222
|
+
});
|
223
|
+
var currentIcon = currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon;
|
226
224
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
227
225
|
var items = this.createItems();
|
228
226
|
var button = (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
|
@@ -270,11 +268,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
270
268
|
}
|
271
269
|
return isOpenedByKeyboard;
|
272
270
|
}
|
273
|
-
}, (0,
|
274
|
-
// extra wrapper added to prevent flex shrinking of the button
|
275
|
-
(0, _react2.jsx)(_primitives.Box, {
|
271
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
276
272
|
xcss: buttonWrapperStyles
|
277
|
-
}, button)
|
273
|
+
}, button)), !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _react2.jsx)("span", {
|
278
274
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
279
275
|
css: _styles.separatorStyles
|
280
276
|
}));
|
@@ -39,7 +39,7 @@ export const BlockTypeButton = props => {
|
|
39
39
|
color: "currentColor",
|
40
40
|
LEGACY_fallbackIcon: TextStyleIconLegacy
|
41
41
|
});
|
42
|
-
const chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall
|
42
|
+
const chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall || !props.isSmall && fg('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
|
43
43
|
const shouldUseIconAsButton = props.isSmall || expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13');
|
44
44
|
return jsx(ToolbarButton, {
|
45
45
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
@@ -14,13 +14,11 @@ 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
16
|
import TextIcon from '@atlaskit/icon/core/text';
|
17
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
18
17
|
import { Box, xcss } from '@atlaskit/primitives';
|
19
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
20
19
|
import { ThemeMutationObserver } from '@atlaskit/tokens';
|
21
20
|
import { NORMAL_TEXT } from '../../block-types';
|
22
21
|
import { BlockTypeButton } from './blocktype-button';
|
23
|
-
import { Text } from './icons';
|
24
22
|
import { blockTypeMenuItemStyle, floatingToolbarWrapperStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
25
23
|
const buttonWrapperStyles = xcss({
|
26
24
|
flexShrink: 0
|
@@ -74,7 +72,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
74
72
|
const defaultMessage = Array.isArray(blockType.title.defaultMessage) ? blockType.title.defaultMessage.find(message => 'value' in message) : blockType.title.defaultMessage;
|
75
73
|
const description = typeof defaultMessage === 'string' ? defaultMessage : defaultMessage && 'value' in defaultMessage ? defaultMessage.value : '';
|
76
74
|
const keyMap = findKeymapByDescription(description);
|
77
|
-
const icon =
|
75
|
+
const icon = blockType === null || blockType === void 0 ? void 0 : blockType.icon;
|
78
76
|
const item = {
|
79
77
|
content:
|
80
78
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
@@ -189,10 +187,10 @@ class ToolbarBlockType extends React.PureComponent {
|
|
189
187
|
return null;
|
190
188
|
}
|
191
189
|
const blockTypeTitles = availableBlockTypesInDropdown.filter(blockType => blockType.name === (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name)).map(blockType => blockType.title);
|
192
|
-
const defaultIcon =
|
190
|
+
const defaultIcon = jsx(TextIcon, {
|
193
191
|
label: ""
|
194
|
-
})
|
195
|
-
const currentIcon =
|
192
|
+
});
|
193
|
+
const currentIcon = currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon;
|
196
194
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
197
195
|
const items = this.createItems();
|
198
196
|
const button = jsx(BlockTypeButton, {
|
@@ -241,11 +239,9 @@ class ToolbarBlockType extends React.PureComponent {
|
|
241
239
|
}
|
242
240
|
return isOpenedByKeyboard;
|
243
241
|
}
|
244
|
-
},
|
245
|
-
// extra wrapper added to prevent flex shrinking of the button
|
246
|
-
jsx(Box, {
|
242
|
+
}, jsx(Box, {
|
247
243
|
xcss: buttonWrapperStyles
|
248
|
-
}, button)
|
244
|
+
}, button)), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
|
249
245
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
250
246
|
css: separatorStyles
|
251
247
|
}));
|
@@ -39,7 +39,7 @@ export var BlockTypeButton = function BlockTypeButton(props) {
|
|
39
39
|
color: "currentColor",
|
40
40
|
LEGACY_fallbackIcon: TextStyleIconLegacy
|
41
41
|
});
|
42
|
-
var chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall
|
42
|
+
var chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall || !props.isSmall && fg('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
|
43
43
|
var shouldUseIconAsButton = props.isSmall || expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13');
|
44
44
|
return jsx(ToolbarButton, {
|
45
45
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
@@ -23,13 +23,11 @@ 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
25
|
import TextIcon from '@atlaskit/icon/core/text';
|
26
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
27
26
|
import { Box, xcss } from '@atlaskit/primitives';
|
28
27
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
29
28
|
import { ThemeMutationObserver } from '@atlaskit/tokens';
|
30
29
|
import { NORMAL_TEXT } from '../../block-types';
|
31
30
|
import { BlockTypeButton } from './blocktype-button';
|
32
|
-
import { Text } from './icons';
|
33
31
|
import { blockTypeMenuItemStyle, floatingToolbarWrapperStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
|
34
32
|
var buttonWrapperStyles = xcss({
|
35
33
|
flexShrink: 0
|
@@ -86,7 +84,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
86
84
|
}) : blockType.title.defaultMessage;
|
87
85
|
var description = typeof defaultMessage === 'string' ? defaultMessage : defaultMessage && 'value' in defaultMessage ? defaultMessage.value : '';
|
88
86
|
var keyMap = findKeymapByDescription(description);
|
89
|
-
var icon =
|
87
|
+
var icon = blockType === null || blockType === void 0 ? void 0 : blockType.icon;
|
90
88
|
var item = {
|
91
89
|
content:
|
92
90
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
@@ -215,10 +213,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
215
213
|
}).map(function (blockType) {
|
216
214
|
return blockType.title;
|
217
215
|
});
|
218
|
-
var defaultIcon =
|
216
|
+
var defaultIcon = jsx(TextIcon, {
|
219
217
|
label: ""
|
220
|
-
})
|
221
|
-
var currentIcon =
|
218
|
+
});
|
219
|
+
var currentIcon = currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon;
|
222
220
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
223
221
|
var items = this.createItems();
|
224
222
|
var button = jsx(BlockTypeButton, {
|
@@ -266,11 +264,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
266
264
|
}
|
267
265
|
return isOpenedByKeyboard;
|
268
266
|
}
|
269
|
-
},
|
270
|
-
// extra wrapper added to prevent flex shrinking of the button
|
271
|
-
jsx(Box, {
|
267
|
+
}, jsx(Box, {
|
272
268
|
xcss: buttonWrapperStyles
|
273
|
-
}, button)
|
269
|
+
}, button)), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
|
274
270
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
275
271
|
css: separatorStyles
|
276
272
|
}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "5.2.
|
3
|
+
"version": "5.2.6",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -9,8 +9,7 @@
|
|
9
9
|
},
|
10
10
|
"atlassian": {
|
11
11
|
"team": "Editor: Lego",
|
12
|
-
"singleton": true
|
13
|
-
"runReact18": true
|
12
|
+
"singleton": true
|
14
13
|
},
|
15
14
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
16
15
|
"main": "dist/cjs/index.js",
|
@@ -36,20 +35,20 @@
|
|
36
35
|
},
|
37
36
|
"dependencies": {
|
38
37
|
"@atlaskit/adf-schema": "^47.6.0",
|
39
|
-
"@atlaskit/editor-common": "^107.
|
38
|
+
"@atlaskit/editor-common": "^107.4.0",
|
40
39
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
41
40
|
"@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
|
42
|
-
"@atlaskit/editor-plugin-selection-toolbar": "^3.
|
41
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^3.8.0",
|
43
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
44
43
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
45
44
|
"@atlaskit/editor-tables": "^2.9.0",
|
46
45
|
"@atlaskit/icon": "^27.2.0",
|
47
|
-
"@atlaskit/icon-lab": "^5.
|
46
|
+
"@atlaskit/icon-lab": "^5.1.0",
|
48
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
49
|
-
"@atlaskit/primitives": "^14.
|
48
|
+
"@atlaskit/primitives": "^14.10.0",
|
50
49
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
51
50
|
"@atlaskit/theme": "^18.0.0",
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^8.6.0",
|
53
52
|
"@atlaskit/tokens": "^5.4.0",
|
54
53
|
"@babel/runtime": "^7.0.0",
|
55
54
|
"@emotion/react": "^11.7.1"
|
@@ -117,14 +116,8 @@
|
|
117
116
|
"platform_editor_controls_patch_13": {
|
118
117
|
"type": "boolean"
|
119
118
|
},
|
120
|
-
"platform_editor_comments_toolbar_responsiveness": {
|
121
|
-
"type": "boolean"
|
122
|
-
},
|
123
119
|
"platform_editor_use_preferences_plugin": {
|
124
120
|
"type": "boolean"
|
125
|
-
},
|
126
|
-
"platform_editor_controls_patch_4": {
|
127
|
-
"type": "boolean"
|
128
121
|
}
|
129
122
|
}
|
130
123
|
}
|