@atlaskit/editor-plugin-block-type 23.0.4 → 23.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 +15 -0
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +7 -68
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +1 -64
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +7 -68
- package/package.json +3 -3
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +0 -14
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +0 -14
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 23.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 23.0.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`f6bcd3f08033d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f6bcd3f08033d) -
|
|
14
|
+
Cleanup `experiment` `platform_editor_fix_block_type_dropdown_no_style`. Block type dropdown
|
|
15
|
+
heading previews now always use the extracted style.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 23.0.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.HeadingButton = void 0;
|
|
9
|
-
require("./HeadingButton.compiled.css");
|
|
10
9
|
var _runtime = require("@compiled/react/runtime");
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _reactIntl = require("react-intl");
|
|
@@ -17,60 +16,12 @@ var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
|
17
16
|
var _ugcTokens = require("@atlaskit/editor-common/ugc-tokens");
|
|
18
17
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
19
18
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
20
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
21
19
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
22
20
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
23
21
|
var _utils = require("../../utils");
|
|
24
22
|
var _editorUGCToken;
|
|
25
23
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
26
24
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
27
|
-
var smallTextStyle = null;
|
|
28
|
-
var normalStyle = null;
|
|
29
|
-
var heading1Style = null;
|
|
30
|
-
var heading2Style = null;
|
|
31
|
-
var heading3Style = null;
|
|
32
|
-
var heading4Style = null;
|
|
33
|
-
var heading5Style = null;
|
|
34
|
-
var heading6Style = null;
|
|
35
|
-
var LegacyHeadingText = function LegacyHeadingText(_ref) {
|
|
36
|
-
var children = _ref.children,
|
|
37
|
-
headingType = _ref.headingType;
|
|
38
|
-
switch (headingType) {
|
|
39
|
-
case 'heading1':
|
|
40
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
42
|
-
}, children);
|
|
43
|
-
case 'heading2':
|
|
44
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
46
|
-
}, children);
|
|
47
|
-
case 'heading3':
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
50
|
-
}, children);
|
|
51
|
-
case 'heading4':
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
54
|
-
}, children);
|
|
55
|
-
case 'heading5':
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
58
|
-
}, children);
|
|
59
|
-
case 'heading6':
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
62
|
-
}, children);
|
|
63
|
-
case 'smallText':
|
|
64
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
66
|
-
}, children);
|
|
67
|
-
case 'normal':
|
|
68
|
-
default:
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className: (0, _runtime.ax)(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
71
|
-
}, children);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
25
|
var headingTextProps = {
|
|
75
26
|
normal: {
|
|
76
27
|
style: {
|
|
@@ -113,23 +64,11 @@ var headingTextProps = {
|
|
|
113
64
|
}
|
|
114
65
|
}
|
|
115
66
|
};
|
|
116
|
-
var HeadingText = function HeadingText(
|
|
117
|
-
var children =
|
|
118
|
-
headingType =
|
|
67
|
+
var HeadingText = function HeadingText(_ref) {
|
|
68
|
+
var children = _ref.children,
|
|
69
|
+
headingType = _ref.headingType;
|
|
119
70
|
return /*#__PURE__*/_react.default.createElement('div', headingTextProps[headingType], children);
|
|
120
71
|
};
|
|
121
|
-
var HeadingPreview = function HeadingPreview(_ref3) {
|
|
122
|
-
var children = _ref3.children,
|
|
123
|
-
headingType = _ref3.headingType;
|
|
124
|
-
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_fix_block_type_dropdown_no_style')) {
|
|
125
|
-
return /*#__PURE__*/_react.default.createElement(HeadingText, {
|
|
126
|
-
headingType: headingType
|
|
127
|
-
}, children);
|
|
128
|
-
}
|
|
129
|
-
return /*#__PURE__*/_react.default.createElement(LegacyHeadingText, {
|
|
130
|
-
headingType: headingType
|
|
131
|
-
}, children);
|
|
132
|
-
};
|
|
133
72
|
var shortcuts = {
|
|
134
73
|
normal: _keymaps.setNormalText,
|
|
135
74
|
smallText: _keymaps.toggleSmallText,
|
|
@@ -146,9 +85,9 @@ var shouldDisableHeadingButton = function shouldDisableHeadingButton(state, bloc
|
|
|
146
85
|
}
|
|
147
86
|
return (0, _utils.isSelectionInsideListNode)(state) && blockType.name !== 'normal' && blockType.name !== 'smallText';
|
|
148
87
|
};
|
|
149
|
-
var HeadingButton = exports.HeadingButton = function HeadingButton(
|
|
150
|
-
var blockType =
|
|
151
|
-
api =
|
|
88
|
+
var HeadingButton = exports.HeadingButton = function HeadingButton(_ref2) {
|
|
89
|
+
var blockType = _ref2.blockType,
|
|
90
|
+
api = _ref2.api;
|
|
152
91
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
153
92
|
formatMessage = _useIntl.formatMessage;
|
|
154
93
|
var currentBlockType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.currentBlockType');
|
|
@@ -232,7 +171,7 @@ var HeadingButton = exports.HeadingButton = function HeadingButton(_ref4) {
|
|
|
232
171
|
isSelected: isSelected,
|
|
233
172
|
isDisabled: isDisabled,
|
|
234
173
|
ariaKeyshortcuts: shortcut
|
|
235
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
174
|
+
}, /*#__PURE__*/_react.default.createElement(HeadingText, {
|
|
236
175
|
headingType: blockType.name
|
|
237
176
|
}, formatMessage(blockType.title)));
|
|
238
177
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* HeadingButton.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
var _editorUGCToken;
|
|
3
|
-
import "./HeadingButton.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
6
5
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
@@ -14,58 +13,9 @@ import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
|
14
13
|
import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
|
|
15
14
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
16
15
|
import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
17
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
18
16
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
19
17
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
20
18
|
import { isSelectionInsideListNode } from '../../utils';
|
|
21
|
-
const smallTextStyle = null;
|
|
22
|
-
const normalStyle = null;
|
|
23
|
-
const heading1Style = null;
|
|
24
|
-
const heading2Style = null;
|
|
25
|
-
const heading3Style = null;
|
|
26
|
-
const heading4Style = null;
|
|
27
|
-
const heading5Style = null;
|
|
28
|
-
const heading6Style = null;
|
|
29
|
-
const LegacyHeadingText = ({
|
|
30
|
-
children,
|
|
31
|
-
headingType
|
|
32
|
-
}) => {
|
|
33
|
-
switch (headingType) {
|
|
34
|
-
case 'heading1':
|
|
35
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
37
|
-
}, children);
|
|
38
|
-
case 'heading2':
|
|
39
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
41
|
-
}, children);
|
|
42
|
-
case 'heading3':
|
|
43
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
45
|
-
}, children);
|
|
46
|
-
case 'heading4':
|
|
47
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
49
|
-
}, children);
|
|
50
|
-
case 'heading5':
|
|
51
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
53
|
-
}, children);
|
|
54
|
-
case 'heading6':
|
|
55
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
57
|
-
}, children);
|
|
58
|
-
case 'smallText':
|
|
59
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
61
|
-
}, children);
|
|
62
|
-
case 'normal':
|
|
63
|
-
default:
|
|
64
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
66
|
-
}, children);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
19
|
const headingTextProps = {
|
|
70
20
|
normal: {
|
|
71
21
|
style: {
|
|
@@ -114,19 +64,6 @@ const HeadingText = ({
|
|
|
114
64
|
}) => {
|
|
115
65
|
return /*#__PURE__*/React.createElement('div', headingTextProps[headingType], children);
|
|
116
66
|
};
|
|
117
|
-
const HeadingPreview = ({
|
|
118
|
-
children,
|
|
119
|
-
headingType
|
|
120
|
-
}) => {
|
|
121
|
-
if (isExperimentEnabled('platform_editor_fix_block_type_dropdown_no_style')) {
|
|
122
|
-
return /*#__PURE__*/React.createElement(HeadingText, {
|
|
123
|
-
headingType: headingType
|
|
124
|
-
}, children);
|
|
125
|
-
}
|
|
126
|
-
return /*#__PURE__*/React.createElement(LegacyHeadingText, {
|
|
127
|
-
headingType: headingType
|
|
128
|
-
}, children);
|
|
129
|
-
};
|
|
130
67
|
const shortcuts = {
|
|
131
68
|
normal: setNormalText,
|
|
132
69
|
smallText: toggleSmallText,
|
|
@@ -231,7 +168,7 @@ export const HeadingButton = ({
|
|
|
231
168
|
isSelected: isSelected,
|
|
232
169
|
isDisabled: isDisabled,
|
|
233
170
|
ariaKeyshortcuts: shortcut
|
|
234
|
-
}, /*#__PURE__*/React.createElement(
|
|
171
|
+
}, /*#__PURE__*/React.createElement(HeadingText, {
|
|
235
172
|
headingType: blockType.name
|
|
236
173
|
}, formatMessage(blockType.title)));
|
|
237
174
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* HeadingButton.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
var _editorUGCToken;
|
|
3
|
-
import "./HeadingButton.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
6
5
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
@@ -14,57 +13,9 @@ import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
|
14
13
|
import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
|
|
15
14
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
16
15
|
import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
17
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
18
16
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
19
17
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
20
18
|
import { isSelectionInsideListNode } from '../../utils';
|
|
21
|
-
var smallTextStyle = null;
|
|
22
|
-
var normalStyle = null;
|
|
23
|
-
var heading1Style = null;
|
|
24
|
-
var heading2Style = null;
|
|
25
|
-
var heading3Style = null;
|
|
26
|
-
var heading4Style = null;
|
|
27
|
-
var heading5Style = null;
|
|
28
|
-
var heading6Style = null;
|
|
29
|
-
var LegacyHeadingText = function LegacyHeadingText(_ref) {
|
|
30
|
-
var children = _ref.children,
|
|
31
|
-
headingType = _ref.headingType;
|
|
32
|
-
switch (headingType) {
|
|
33
|
-
case 'heading1':
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
36
|
-
}, children);
|
|
37
|
-
case 'heading2':
|
|
38
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
40
|
-
}, children);
|
|
41
|
-
case 'heading3':
|
|
42
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
44
|
-
}, children);
|
|
45
|
-
case 'heading4':
|
|
46
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
48
|
-
}, children);
|
|
49
|
-
case 'heading5':
|
|
50
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
52
|
-
}, children);
|
|
53
|
-
case 'heading6':
|
|
54
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
56
|
-
}, children);
|
|
57
|
-
case 'smallText':
|
|
58
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
60
|
-
}, children);
|
|
61
|
-
case 'normal':
|
|
62
|
-
default:
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: ax(["_djwm111w _5vbmmnnt _1k511xgx _2qeye8o0 _1xjn1kpd _1db31m24 _1c77t7zq _1tkzeeh4 _1obv1fw0 _coj31fw0 _1sxz1fw0 _sumi1fw0 _1osd1fw0 _yb941fw0"])
|
|
65
|
-
}, children);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
19
|
var headingTextProps = {
|
|
69
20
|
normal: {
|
|
70
21
|
style: {
|
|
@@ -107,23 +58,11 @@ var headingTextProps = {
|
|
|
107
58
|
}
|
|
108
59
|
}
|
|
109
60
|
};
|
|
110
|
-
var HeadingText = function HeadingText(
|
|
111
|
-
var children =
|
|
112
|
-
headingType =
|
|
61
|
+
var HeadingText = function HeadingText(_ref) {
|
|
62
|
+
var children = _ref.children,
|
|
63
|
+
headingType = _ref.headingType;
|
|
113
64
|
return /*#__PURE__*/React.createElement('div', headingTextProps[headingType], children);
|
|
114
65
|
};
|
|
115
|
-
var HeadingPreview = function HeadingPreview(_ref3) {
|
|
116
|
-
var children = _ref3.children,
|
|
117
|
-
headingType = _ref3.headingType;
|
|
118
|
-
if (isExperimentEnabled('platform_editor_fix_block_type_dropdown_no_style')) {
|
|
119
|
-
return /*#__PURE__*/React.createElement(HeadingText, {
|
|
120
|
-
headingType: headingType
|
|
121
|
-
}, children);
|
|
122
|
-
}
|
|
123
|
-
return /*#__PURE__*/React.createElement(LegacyHeadingText, {
|
|
124
|
-
headingType: headingType
|
|
125
|
-
}, children);
|
|
126
|
-
};
|
|
127
66
|
var shortcuts = {
|
|
128
67
|
normal: setNormalText,
|
|
129
68
|
smallText: toggleSmallText,
|
|
@@ -140,9 +79,9 @@ var shouldDisableHeadingButton = function shouldDisableHeadingButton(state, bloc
|
|
|
140
79
|
}
|
|
141
80
|
return isSelectionInsideListNode(state) && blockType.name !== 'normal' && blockType.name !== 'smallText';
|
|
142
81
|
};
|
|
143
|
-
export var HeadingButton = function HeadingButton(
|
|
144
|
-
var blockType =
|
|
145
|
-
api =
|
|
82
|
+
export var HeadingButton = function HeadingButton(_ref2) {
|
|
83
|
+
var blockType = _ref2.blockType,
|
|
84
|
+
api = _ref2.api;
|
|
146
85
|
var _useIntl = useIntl(),
|
|
147
86
|
formatMessage = _useIntl.formatMessage;
|
|
148
87
|
var currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
|
|
@@ -226,7 +165,7 @@ export var HeadingButton = function HeadingButton(_ref4) {
|
|
|
226
165
|
isSelected: isSelected,
|
|
227
166
|
isDisabled: isDisabled,
|
|
228
167
|
ariaKeyshortcuts: shortcut
|
|
229
|
-
}, /*#__PURE__*/React.createElement(
|
|
168
|
+
}, /*#__PURE__*/React.createElement(HeadingText, {
|
|
230
169
|
headingType: blockType.name
|
|
231
170
|
}, formatMessage(blockType.title)));
|
|
232
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.6",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"@atlaskit/primitives": "^22.5.0",
|
|
44
44
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
45
45
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^204.0.0",
|
|
47
47
|
"@atlaskit/tokens": "^19.0.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@compiled/react": "^1.0.2",
|
|
50
50
|
"@emotion/react": "^11.7.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^123.
|
|
53
|
+
"@atlaskit/editor-common": "^123.8.0",
|
|
54
54
|
"react": "^18.2.0 || ^19.2.0",
|
|
55
55
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
56
56
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
._1c77t7zq font{editor.font.body:normal 400 1em/1.714 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
2
|
-
._1db31m24 font{editor.font.heading.h6:normal 600 .785714em/1.45455 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
3
|
-
._1k511xgx font{editor.font.heading.h3:normal 600 1.14286em/1.25 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
4
|
-
._1obv1fw0 font{editor.font.weight.heading.h1.bold:700}
|
|
5
|
-
._1osd1fw0 font{editor.font.weight.heading.h5.bold:700}
|
|
6
|
-
._1sxz1fw0 font{editor.font.weight.heading.h3.bold:700}
|
|
7
|
-
._1tkzeeh4 font{editor.font.body.small:normal 400 .875em/1.714 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
8
|
-
._1xjn1kpd font{editor.font.heading.h5:normal 600 .857143em/1.33333 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
9
|
-
._2qeye8o0 font{editor.font.heading.h4:normal 600 1em/1.14286 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
10
|
-
._5vbmmnnt font{editor.font.heading.h2:normal 600 1.42857em/1.2 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
11
|
-
._coj31fw0 font{editor.font.weight.heading.h2.bold:700}
|
|
12
|
-
._djwm111w font{editor.font.heading.h1:normal 600 1.71429em/1.16667 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
13
|
-
._sumi1fw0 font{editor.font.weight.heading.h4.bold:700}
|
|
14
|
-
._yb941fw0 font{editor.font.weight.heading.h6.bold:700}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
._1c77t7zq font{editor.font.body:normal 400 1em/1.714 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
2
|
-
._1db31m24 font{editor.font.heading.h6:normal 600 .785714em/1.45455 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
3
|
-
._1k511xgx font{editor.font.heading.h3:normal 600 1.14286em/1.25 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
4
|
-
._1obv1fw0 font{editor.font.weight.heading.h1.bold:700}
|
|
5
|
-
._1osd1fw0 font{editor.font.weight.heading.h5.bold:700}
|
|
6
|
-
._1sxz1fw0 font{editor.font.weight.heading.h3.bold:700}
|
|
7
|
-
._1tkzeeh4 font{editor.font.body.small:normal 400 .875em/1.714 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
8
|
-
._1xjn1kpd font{editor.font.heading.h5:normal 600 .857143em/1.33333 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
9
|
-
._2qeye8o0 font{editor.font.heading.h4:normal 600 1em/1.14286 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
10
|
-
._5vbmmnnt font{editor.font.heading.h2:normal 600 1.42857em/1.2 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
11
|
-
._coj31fw0 font{editor.font.weight.heading.h2.bold:700}
|
|
12
|
-
._djwm111w font{editor.font.heading.h1:normal 600 1.71429em/1.16667 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
13
|
-
._sumi1fw0 font{editor.font.weight.heading.h4.bold:700}
|
|
14
|
-
._yb941fw0 font{editor.font.weight.heading.h6.bold:700}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
._1c77t7zq font{editor.font.body:normal 400 1em/1.714 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
2
|
-
._1db31m24 font{editor.font.heading.h6:normal 600 .785714em/1.45455 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
3
|
-
._1k511xgx font{editor.font.heading.h3:normal 600 1.14286em/1.25 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
4
|
-
._1obv1fw0 font{editor.font.weight.heading.h1.bold:700}
|
|
5
|
-
._1osd1fw0 font{editor.font.weight.heading.h5.bold:700}
|
|
6
|
-
._1sxz1fw0 font{editor.font.weight.heading.h3.bold:700}
|
|
7
|
-
._1tkzeeh4 font{editor.font.body.small:normal 400 .875em/1.714 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
8
|
-
._1xjn1kpd font{editor.font.heading.h5:normal 600 .857143em/1.33333 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
9
|
-
._2qeye8o0 font{editor.font.heading.h4:normal 600 1em/1.14286 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
10
|
-
._5vbmmnnt font{editor.font.heading.h2:normal 600 1.42857em/1.2 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
11
|
-
._coj31fw0 font{editor.font.weight.heading.h2.bold:700}
|
|
12
|
-
._djwm111w font{editor.font.heading.h1:normal 600 1.71429em/1.16667 "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif}
|
|
13
|
-
._sumi1fw0 font{editor.font.weight.heading.h4.bold:700}
|
|
14
|
-
._yb941fw0 font{editor.font.weight.heading.h6.bold:700}
|