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