@atlaskit/editor-plugin-block-type 3.0.6 → 3.0.7
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 +6 -0
- package/dist/cjs/plugin/ui/ToolbarBlockType/blocktype-button.js +10 -7
- package/dist/cjs/plugin/ui/ToolbarBlockType/index.js +12 -15
- package/dist/cjs/plugin/ui/ToolbarBlockType/styled.js +1 -0
- package/dist/es2019/plugin/ui/ToolbarBlockType/blocktype-button.js +9 -7
- package/dist/es2019/plugin/ui/ToolbarBlockType/index.js +12 -14
- package/dist/es2019/plugin/ui/ToolbarBlockType/styled.js +1 -0
- package/dist/esm/plugin/ui/ToolbarBlockType/blocktype-button.js +9 -7
- package/dist/esm/plugin/ui/ToolbarBlockType/index.js +12 -14
- package/dist/esm/plugin/ui/ToolbarBlockType/styled.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 3.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
8
|
+
|
|
3
9
|
## 3.0.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.BlockTypeButton = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
@@ -14,9 +15,11 @@ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-
|
|
|
14
15
|
var _textStyle = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/text-style"));
|
|
15
16
|
var _blockTypes = require("../../block-types");
|
|
16
17
|
var _styled = require("./styled");
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
|
|
17
20
|
var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props) {
|
|
18
21
|
var labelTextStyles = props.formatMessage(_messages.toolbarMessages.textStyles);
|
|
19
|
-
return
|
|
22
|
+
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
20
23
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
|
21
24
|
selected: props.selected,
|
|
22
25
|
className: "block-type-btn",
|
|
@@ -27,23 +30,23 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
|
|
|
27
30
|
"aria-label": labelTextStyles,
|
|
28
31
|
"aria-haspopup": true,
|
|
29
32
|
"aria-expanded": props['aria-expanded'],
|
|
30
|
-
iconAfter:
|
|
33
|
+
iconAfter: (0, _react2.jsx)("span", {
|
|
31
34
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
32
35
|
css: [_styles.wrapperStyle, props.isSmall && _styled.wrapperSmallStyle],
|
|
33
36
|
"data-testid": "toolbar-block-type-text-styles-icon"
|
|
34
|
-
}, props.isSmall &&
|
|
37
|
+
}, props.isSmall && (0, _react2.jsx)(_textStyle.default, {
|
|
35
38
|
label: labelTextStyles
|
|
36
|
-
}),
|
|
39
|
+
}), (0, _react2.jsx)("span", {
|
|
37
40
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
38
41
|
css: _styled.expandIconWrapperStyle
|
|
39
|
-
},
|
|
42
|
+
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
40
43
|
label: ""
|
|
41
44
|
})))
|
|
42
|
-
}, !props.isSmall &&
|
|
45
|
+
}, !props.isSmall && (0, _react2.jsx)("span", {
|
|
43
46
|
css: [
|
|
44
47
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
45
48
|
_styled.buttonContentStyle,
|
|
46
49
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
47
50
|
props.isReducedSpacing && _styled.buttonContentReducedSpacingStyle]
|
|
48
|
-
},
|
|
51
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, props.title || _blockTypes.NORMAL_TEXT.title)));
|
|
49
52
|
};
|
|
@@ -13,6 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
16
17
|
var _reactIntlNext = require("react-intl-next");
|
|
17
18
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
18
19
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
@@ -23,7 +24,7 @@ var _styled = require("./styled");
|
|
|
23
24
|
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; }
|
|
24
25
|
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; }
|
|
25
26
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
26
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
27
28
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
28
29
|
var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
29
30
|
(0, _inherits2.default)(ToolbarBlockType, _React$PureComponent);
|
|
@@ -73,20 +74,18 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
73
74
|
var keyMap = (0, _keymaps.findKeymapByDescription)(blockType.title.defaultMessage);
|
|
74
75
|
return {
|
|
75
76
|
content:
|
|
76
|
-
/*#__PURE__*/
|
|
77
77
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
78
|
-
|
|
78
|
+
(0, _react2.jsx)("div", {
|
|
79
79
|
css: (0, _styled.blockTypeMenuItemStyle)(tagName, isActive)
|
|
80
|
-
},
|
|
80
|
+
}, (0, _react2.jsx)(Tag, null, formatMessage(blockType.title))),
|
|
81
81
|
value: blockType,
|
|
82
82
|
label: formatMessage(blockType.title),
|
|
83
83
|
'aria-label': (0, _keymaps.tooltip)(keyMap, formatMessage(blockType.title)),
|
|
84
84
|
keyShortcuts: (0, _keymaps.getAriaKeyshortcuts)(keyMap),
|
|
85
85
|
key: "".concat(blockType.name, "-").concat(index),
|
|
86
86
|
elemAfter:
|
|
87
|
-
/*#__PURE__*/
|
|
88
87
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
89
|
-
|
|
88
|
+
(0, _react2.jsx)("div", {
|
|
90
89
|
css: [_styled.keyboardShortcut, isActive && _styled.keyboardShortcutSelect]
|
|
91
90
|
}, (0, _keymaps.tooltip)(keyMap)),
|
|
92
91
|
isActive: isActive
|
|
@@ -142,11 +141,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
142
141
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
143
142
|
var items = this.createItems();
|
|
144
143
|
return (
|
|
145
|
-
/*#__PURE__*/
|
|
146
144
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
147
|
-
|
|
145
|
+
(0, _react2.jsx)("span", {
|
|
148
146
|
css: _styles.wrapperStyle
|
|
149
|
-
},
|
|
147
|
+
}, (0, _react2.jsx)(_uiMenu.DropdownMenuWithKeyboardNavigation, {
|
|
150
148
|
items: items,
|
|
151
149
|
onOpenChange: this.onOpenChange,
|
|
152
150
|
onItemActivated: this.handleSelectBlockType,
|
|
@@ -167,7 +165,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
167
165
|
}
|
|
168
166
|
return isOpenedByKeyboard;
|
|
169
167
|
}
|
|
170
|
-
},
|
|
168
|
+
}, (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
|
|
171
169
|
isSmall: isSmall,
|
|
172
170
|
isReducedSpacing: isReducedSpacing,
|
|
173
171
|
selected: active,
|
|
@@ -177,18 +175,17 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
177
175
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
178
176
|
formatMessage: formatMessage,
|
|
179
177
|
"aria-expanded": active
|
|
180
|
-
})),
|
|
178
|
+
})), (0, _react2.jsx)("span", {
|
|
181
179
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
182
180
|
css: _styles.separatorStyles
|
|
183
181
|
}))
|
|
184
182
|
);
|
|
185
183
|
}
|
|
186
184
|
return (
|
|
187
|
-
/*#__PURE__*/
|
|
188
185
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
189
|
-
|
|
186
|
+
(0, _react2.jsx)("span", {
|
|
190
187
|
css: _styles.wrapperStyle
|
|
191
|
-
},
|
|
188
|
+
}, (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
|
|
192
189
|
isSmall: isSmall,
|
|
193
190
|
isReducedSpacing: isReducedSpacing,
|
|
194
191
|
selected: active,
|
|
@@ -198,7 +195,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
198
195
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
199
196
|
formatMessage: formatMessage,
|
|
200
197
|
"aria-expanded": active
|
|
201
|
-
}),
|
|
198
|
+
}), (0, _react2.jsx)("span", {
|
|
202
199
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
203
200
|
css: _styles.separatorStyles
|
|
204
201
|
}))
|
|
@@ -11,6 +11,7 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
11
11
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
12
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
var blockTypeMenuItemStyle = exports.blockTypeMenuItemStyle = function blockTypeMenuItemStyle(tagName, selected) {
|
|
15
16
|
// TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
|
|
16
17
|
var selectedStyle = selected ? "".concat(tagName, " { color: ", "var(--ds-text, white)", " !important; }") : '';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
5
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
4
6
|
import { wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
@@ -9,7 +11,7 @@ import { NORMAL_TEXT } from '../../block-types';
|
|
|
9
11
|
import { buttonContentReducedSpacingStyle, buttonContentStyle, expandIconWrapperStyle, wrapperSmallStyle } from './styled';
|
|
10
12
|
export const BlockTypeButton = props => {
|
|
11
13
|
const labelTextStyles = props.formatMessage(toolbarMessages.textStyles);
|
|
12
|
-
return
|
|
14
|
+
return jsx(ToolbarButton, {
|
|
13
15
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
|
14
16
|
selected: props.selected,
|
|
15
17
|
className: "block-type-btn",
|
|
@@ -20,23 +22,23 @@ export const BlockTypeButton = props => {
|
|
|
20
22
|
"aria-label": labelTextStyles,
|
|
21
23
|
"aria-haspopup": true,
|
|
22
24
|
"aria-expanded": props['aria-expanded'],
|
|
23
|
-
iconAfter:
|
|
25
|
+
iconAfter: jsx("span", {
|
|
24
26
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
25
27
|
css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
|
|
26
28
|
"data-testid": "toolbar-block-type-text-styles-icon"
|
|
27
|
-
}, props.isSmall &&
|
|
29
|
+
}, props.isSmall && jsx(TextStyleIcon, {
|
|
28
30
|
label: labelTextStyles
|
|
29
|
-
}),
|
|
31
|
+
}), jsx("span", {
|
|
30
32
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
31
33
|
css: expandIconWrapperStyle
|
|
32
|
-
},
|
|
34
|
+
}, jsx(ExpandIcon, {
|
|
33
35
|
label: ""
|
|
34
36
|
})))
|
|
35
|
-
}, !props.isSmall &&
|
|
37
|
+
}, !props.isSmall && jsx("span", {
|
|
36
38
|
css: [
|
|
37
39
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
38
40
|
buttonContentStyle,
|
|
39
41
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
40
42
|
props.isReducedSpacing && buttonContentReducedSpacingStyle]
|
|
41
|
-
},
|
|
43
|
+
}, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)));
|
|
42
44
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import { injectIntl } from 'react-intl-next';
|
|
4
6
|
import { findKeymapByDescription, getAriaKeyshortcuts, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
7
|
import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
@@ -55,20 +57,18 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
55
57
|
const keyMap = findKeymapByDescription(blockType.title.defaultMessage);
|
|
56
58
|
return {
|
|
57
59
|
content:
|
|
58
|
-
/*#__PURE__*/
|
|
59
60
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
60
|
-
|
|
61
|
+
jsx("div", {
|
|
61
62
|
css: blockTypeMenuItemStyle(tagName, isActive)
|
|
62
|
-
},
|
|
63
|
+
}, jsx(Tag, null, formatMessage(blockType.title))),
|
|
63
64
|
value: blockType,
|
|
64
65
|
label: formatMessage(blockType.title),
|
|
65
66
|
'aria-label': tooltip(keyMap, formatMessage(blockType.title)),
|
|
66
67
|
keyShortcuts: getAriaKeyshortcuts(keyMap),
|
|
67
68
|
key: `${blockType.name}-${index}`,
|
|
68
69
|
elemAfter:
|
|
69
|
-
/*#__PURE__*/
|
|
70
70
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
71
|
-
|
|
71
|
+
jsx("div", {
|
|
72
72
|
css: [keyboardShortcut, isActive && keyboardShortcutSelect]
|
|
73
73
|
}, tooltip(keyMap)),
|
|
74
74
|
isActive
|
|
@@ -120,11 +120,10 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
120
120
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
121
121
|
const items = this.createItems();
|
|
122
122
|
return (
|
|
123
|
-
/*#__PURE__*/
|
|
124
123
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
125
|
-
|
|
124
|
+
jsx("span", {
|
|
126
125
|
css: wrapperStyle
|
|
127
|
-
},
|
|
126
|
+
}, jsx(DropdownMenu, {
|
|
128
127
|
items: items,
|
|
129
128
|
onOpenChange: this.onOpenChange,
|
|
130
129
|
onItemActivated: this.handleSelectBlockType,
|
|
@@ -146,7 +145,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
146
145
|
}
|
|
147
146
|
return isOpenedByKeyboard;
|
|
148
147
|
}
|
|
149
|
-
},
|
|
148
|
+
}, jsx(BlockTypeButton, {
|
|
150
149
|
isSmall: isSmall,
|
|
151
150
|
isReducedSpacing: isReducedSpacing,
|
|
152
151
|
selected: active,
|
|
@@ -156,18 +155,17 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
156
155
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
157
156
|
formatMessage: formatMessage,
|
|
158
157
|
"aria-expanded": active
|
|
159
|
-
})),
|
|
158
|
+
})), jsx("span", {
|
|
160
159
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
161
160
|
css: separatorStyles
|
|
162
161
|
}))
|
|
163
162
|
);
|
|
164
163
|
}
|
|
165
164
|
return (
|
|
166
|
-
/*#__PURE__*/
|
|
167
165
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
168
|
-
|
|
166
|
+
jsx("span", {
|
|
169
167
|
css: wrapperStyle
|
|
170
|
-
},
|
|
168
|
+
}, jsx(BlockTypeButton, {
|
|
171
169
|
isSmall: isSmall,
|
|
172
170
|
isReducedSpacing: isReducedSpacing,
|
|
173
171
|
selected: active,
|
|
@@ -177,7 +175,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
177
175
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
178
176
|
formatMessage: formatMessage,
|
|
179
177
|
"aria-expanded": active
|
|
180
|
-
}),
|
|
178
|
+
}), jsx("span", {
|
|
181
179
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
182
180
|
css: separatorStyles
|
|
183
181
|
}))
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
5
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
4
6
|
import { wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
@@ -9,7 +11,7 @@ import { NORMAL_TEXT } from '../../block-types';
|
|
|
9
11
|
import { buttonContentReducedSpacingStyle, buttonContentStyle, expandIconWrapperStyle, wrapperSmallStyle } from './styled';
|
|
10
12
|
export var BlockTypeButton = function BlockTypeButton(props) {
|
|
11
13
|
var labelTextStyles = props.formatMessage(toolbarMessages.textStyles);
|
|
12
|
-
return
|
|
14
|
+
return jsx(ToolbarButton, {
|
|
13
15
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
|
14
16
|
selected: props.selected,
|
|
15
17
|
className: "block-type-btn",
|
|
@@ -20,23 +22,23 @@ export var BlockTypeButton = function BlockTypeButton(props) {
|
|
|
20
22
|
"aria-label": labelTextStyles,
|
|
21
23
|
"aria-haspopup": true,
|
|
22
24
|
"aria-expanded": props['aria-expanded'],
|
|
23
|
-
iconAfter:
|
|
25
|
+
iconAfter: jsx("span", {
|
|
24
26
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
25
27
|
css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
|
|
26
28
|
"data-testid": "toolbar-block-type-text-styles-icon"
|
|
27
|
-
}, props.isSmall &&
|
|
29
|
+
}, props.isSmall && jsx(TextStyleIcon, {
|
|
28
30
|
label: labelTextStyles
|
|
29
|
-
}),
|
|
31
|
+
}), jsx("span", {
|
|
30
32
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
31
33
|
css: expandIconWrapperStyle
|
|
32
|
-
},
|
|
34
|
+
}, jsx(ExpandIcon, {
|
|
33
35
|
label: ""
|
|
34
36
|
})))
|
|
35
|
-
}, !props.isSmall &&
|
|
37
|
+
}, !props.isSmall && jsx("span", {
|
|
36
38
|
css: [
|
|
37
39
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
38
40
|
buttonContentStyle,
|
|
39
41
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
40
42
|
props.isReducedSpacing && buttonContentReducedSpacingStyle]
|
|
41
|
-
},
|
|
43
|
+
}, jsx(FormattedMessage, props.title || NORMAL_TEXT.title)));
|
|
42
44
|
};
|
|
@@ -9,7 +9,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
9
9
|
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) { _defineProperty(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; }
|
|
10
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
/** @jsx jsx */
|
|
12
13
|
import React from 'react';
|
|
14
|
+
import { jsx } from '@emotion/react';
|
|
13
15
|
import { injectIntl } from 'react-intl-next';
|
|
14
16
|
import { findKeymapByDescription, getAriaKeyshortcuts, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
15
17
|
import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
@@ -66,20 +68,18 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
68
|
var keyMap = findKeymapByDescription(blockType.title.defaultMessage);
|
|
67
69
|
return {
|
|
68
70
|
content:
|
|
69
|
-
/*#__PURE__*/
|
|
70
71
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
71
|
-
|
|
72
|
+
jsx("div", {
|
|
72
73
|
css: blockTypeMenuItemStyle(tagName, isActive)
|
|
73
|
-
},
|
|
74
|
+
}, jsx(Tag, null, formatMessage(blockType.title))),
|
|
74
75
|
value: blockType,
|
|
75
76
|
label: formatMessage(blockType.title),
|
|
76
77
|
'aria-label': tooltip(keyMap, formatMessage(blockType.title)),
|
|
77
78
|
keyShortcuts: getAriaKeyshortcuts(keyMap),
|
|
78
79
|
key: "".concat(blockType.name, "-").concat(index),
|
|
79
80
|
elemAfter:
|
|
80
|
-
/*#__PURE__*/
|
|
81
81
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
82
|
-
|
|
82
|
+
jsx("div", {
|
|
83
83
|
css: [keyboardShortcut, isActive && keyboardShortcutSelect]
|
|
84
84
|
}, tooltip(keyMap)),
|
|
85
85
|
isActive: isActive
|
|
@@ -135,11 +135,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
135
135
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
136
136
|
var items = this.createItems();
|
|
137
137
|
return (
|
|
138
|
-
/*#__PURE__*/
|
|
139
138
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
140
|
-
|
|
139
|
+
jsx("span", {
|
|
141
140
|
css: wrapperStyle
|
|
142
|
-
},
|
|
141
|
+
}, jsx(DropdownMenu, {
|
|
143
142
|
items: items,
|
|
144
143
|
onOpenChange: this.onOpenChange,
|
|
145
144
|
onItemActivated: this.handleSelectBlockType,
|
|
@@ -160,7 +159,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
160
159
|
}
|
|
161
160
|
return isOpenedByKeyboard;
|
|
162
161
|
}
|
|
163
|
-
},
|
|
162
|
+
}, jsx(BlockTypeButton, {
|
|
164
163
|
isSmall: isSmall,
|
|
165
164
|
isReducedSpacing: isReducedSpacing,
|
|
166
165
|
selected: active,
|
|
@@ -170,18 +169,17 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
170
169
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
171
170
|
formatMessage: formatMessage,
|
|
172
171
|
"aria-expanded": active
|
|
173
|
-
})),
|
|
172
|
+
})), jsx("span", {
|
|
174
173
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
175
174
|
css: separatorStyles
|
|
176
175
|
}))
|
|
177
176
|
);
|
|
178
177
|
}
|
|
179
178
|
return (
|
|
180
|
-
/*#__PURE__*/
|
|
181
179
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
182
|
-
|
|
180
|
+
jsx("span", {
|
|
183
181
|
css: wrapperStyle
|
|
184
|
-
},
|
|
182
|
+
}, jsx(BlockTypeButton, {
|
|
185
183
|
isSmall: isSmall,
|
|
186
184
|
isReducedSpacing: isReducedSpacing,
|
|
187
185
|
selected: active,
|
|
@@ -191,7 +189,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
191
189
|
onKeyDown: this.handleTriggerByKeyboard,
|
|
192
190
|
formatMessage: formatMessage,
|
|
193
191
|
"aria-expanded": active
|
|
194
|
-
}),
|
|
192
|
+
}), jsx("span", {
|
|
195
193
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
196
194
|
css: separatorStyles
|
|
197
195
|
}))
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
5
|
import { headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
5
6
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@atlaskit/adf-schema": "^35.0.0",
|
|
41
|
-
"@atlaskit/editor-common": "^76.
|
|
41
|
+
"@atlaskit/editor-common": "^76.25.0",
|
|
42
42
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^2.8.0",
|