@atlaskit/editor-plugin-block-type 11.2.7 → 11.2.9
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.compiled.css +7 -0
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +78 -8
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +7 -0
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +72 -2
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +7 -0
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +74 -5
- package/dist/types/pm-plugins/ui/ToolbarBlockType/HeadingButton.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/HeadingButton.d.ts +0 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 11.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0a4441336cdd0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0a4441336cdd0) -
|
|
8
|
+
Add platform_editor_toolbar_aifc_use_editor_typography experiment, and use editor custom
|
|
9
|
+
typography tokens in dropdown menus
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 11.2.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 11.2.7
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
._11c810sd{font:var(--ds-font-heading-large,normal 653 24px/28px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._11c812ln{font:var(--ds-font-heading-xlarge,normal 653 28px/2pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
+
._11c812rg{font:var(--_1h4o6ch)}
|
|
3
4
|
._11c81af2{font:var(--ds-font-heading-medium,normal 653 20px/24px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
5
|
._11c81e3o{font:var(--ds-font-heading-small,normal 653 1pc/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
6
|
+
._11c81fq3{font:var(--_1d0ko3v)}
|
|
7
|
+
._11c81og0{font:var(--_13pg0ac)}
|
|
5
8
|
._11c81qyo{font:var(--ds-font-heading-xsmall,normal 653 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
9
|
+
._11c81td5{font:var(--_1kn1hjn)}
|
|
10
|
+
._11c81u7j{font:var(--_goypne)}
|
|
11
|
+
._11c81vog{font:var(--_1c98jvx)}
|
|
12
|
+
._11c846ty{font:var(--_j67hki)}
|
|
6
13
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
7
14
|
._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
@@ -1,20 +1,88 @@
|
|
|
1
1
|
/* HeadingButton.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
3
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
2
4
|
"use strict";
|
|
3
5
|
|
|
4
|
-
var
|
|
6
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.HeadingButton = void 0;
|
|
9
11
|
require("./HeadingButton.compiled.css");
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
13
|
var _runtime = require("@compiled/react/runtime");
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
14
|
var _reactIntlNext = require("react-intl-next");
|
|
13
15
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
16
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
17
|
+
var _ugcTokens = require("@atlaskit/editor-common/ugc-tokens");
|
|
15
18
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
19
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
17
20
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
23
|
+
var normalStyle = null;
|
|
24
|
+
var heading1Style = null;
|
|
25
|
+
var heading2Style = null;
|
|
26
|
+
var heading3Style = null;
|
|
27
|
+
var heading4Style = null;
|
|
28
|
+
var heading5Style = null;
|
|
29
|
+
var heading6Style = null;
|
|
30
|
+
var HeadingText = function HeadingText(_ref) {
|
|
31
|
+
var children = _ref.children,
|
|
32
|
+
headingType = _ref.headingType;
|
|
33
|
+
switch (headingType) {
|
|
34
|
+
case 'heading1':
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: (0, _runtime.ax)(["_11c812rg"]),
|
|
37
|
+
style: {
|
|
38
|
+
"--_1h4o6ch": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.heading.h1'))
|
|
39
|
+
}
|
|
40
|
+
}, children);
|
|
41
|
+
case 'heading2':
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: (0, _runtime.ax)(["_11c81td5"]),
|
|
44
|
+
style: {
|
|
45
|
+
"--_1kn1hjn": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.heading.h2'))
|
|
46
|
+
}
|
|
47
|
+
}, children);
|
|
48
|
+
case 'heading3':
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: (0, _runtime.ax)(["_11c81og0"]),
|
|
51
|
+
style: {
|
|
52
|
+
"--_13pg0ac": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.heading.h3'))
|
|
53
|
+
}
|
|
54
|
+
}, children);
|
|
55
|
+
case 'heading4':
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: (0, _runtime.ax)(["_11c846ty"]),
|
|
58
|
+
style: {
|
|
59
|
+
"--_j67hki": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.heading.h4'))
|
|
60
|
+
}
|
|
61
|
+
}, children);
|
|
62
|
+
case 'heading5':
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: (0, _runtime.ax)(["_11c81fq3"]),
|
|
65
|
+
style: {
|
|
66
|
+
"--_1d0ko3v": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.heading.h5'))
|
|
67
|
+
}
|
|
68
|
+
}, children);
|
|
69
|
+
case 'heading6':
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: (0, _runtime.ax)(["_11c81vog"]),
|
|
72
|
+
style: {
|
|
73
|
+
"--_1c98jvx": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.heading.h6'))
|
|
74
|
+
}
|
|
75
|
+
}, children);
|
|
76
|
+
case 'normal':
|
|
77
|
+
default:
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: (0, _runtime.ax)(["_11c81u7j"]),
|
|
80
|
+
style: {
|
|
81
|
+
"--_goypne": (0, _runtime.ix)((0, _ugcTokens.editorUGCToken)('editor.font.body'))
|
|
82
|
+
}
|
|
83
|
+
}, children);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
18
86
|
var headingSizeStylesMap = {
|
|
19
87
|
normal: "_11c8fhey",
|
|
20
88
|
heading1: "_11c812ln",
|
|
@@ -33,9 +101,9 @@ var shortcuts = {
|
|
|
33
101
|
heading5: _keymaps.toggleHeading5,
|
|
34
102
|
heading6: _keymaps.toggleHeading6
|
|
35
103
|
};
|
|
36
|
-
var HeadingButton = exports.HeadingButton = function HeadingButton(
|
|
37
|
-
var blockType =
|
|
38
|
-
api =
|
|
104
|
+
var HeadingButton = exports.HeadingButton = function HeadingButton(_ref2) {
|
|
105
|
+
var blockType = _ref2.blockType,
|
|
106
|
+
api = _ref2.api;
|
|
39
107
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
40
108
|
formatMessage = _useIntl.formatMessage;
|
|
41
109
|
var currentBlockType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.currentBlockType');
|
|
@@ -52,15 +120,17 @@ var HeadingButton = exports.HeadingButton = function HeadingButton(_ref) {
|
|
|
52
120
|
};
|
|
53
121
|
var shortcut = (0, _keymaps.formatShortcut)(shortcuts[blockType.name]);
|
|
54
122
|
var isSelected = (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name;
|
|
55
|
-
return /*#__PURE__*/
|
|
123
|
+
return /*#__PURE__*/React.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
56
124
|
elemBefore: blockType.icon,
|
|
57
|
-
elemAfter: shortcut ? /*#__PURE__*/
|
|
125
|
+
elemAfter: shortcut ? /*#__PURE__*/React.createElement(_editorToolbar.ToolbarKeyboardShortcutHint, {
|
|
58
126
|
shortcut: shortcut
|
|
59
127
|
}) : undefined,
|
|
60
128
|
onClick: onClick,
|
|
61
129
|
isSelected: isSelected,
|
|
62
130
|
ariaKeyshortcuts: shortcut
|
|
63
|
-
}, /*#__PURE__*/
|
|
131
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_use_editor_typography', 'isEnabled', true) ? /*#__PURE__*/React.createElement(HeadingText, {
|
|
132
|
+
headingType: blockType.name
|
|
133
|
+
}, formatMessage(blockType.title)) : /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
64
134
|
xcss: headingSizeStylesMap[blockType.name]
|
|
65
135
|
}, formatMessage(blockType.title)));
|
|
66
136
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
._11c810sd{font:var(--ds-font-heading-large,normal 653 24px/28px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._11c812ln{font:var(--ds-font-heading-xlarge,normal 653 28px/2pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
+
._11c812rg{font:var(--_1h4o6ch)}
|
|
3
4
|
._11c81af2{font:var(--ds-font-heading-medium,normal 653 20px/24px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
5
|
._11c81e3o{font:var(--ds-font-heading-small,normal 653 1pc/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
6
|
+
._11c81fq3{font:var(--_1d0ko3v)}
|
|
7
|
+
._11c81og0{font:var(--_13pg0ac)}
|
|
5
8
|
._11c81qyo{font:var(--ds-font-heading-xsmall,normal 653 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
9
|
+
._11c81td5{font:var(--_1kn1hjn)}
|
|
10
|
+
._11c81u7j{font:var(--_goypne)}
|
|
11
|
+
._11c81vog{font:var(--_1c98jvx)}
|
|
12
|
+
._11c846ty{font:var(--_j67hki)}
|
|
6
13
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
7
14
|
._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
@@ -1,13 +1,81 @@
|
|
|
1
1
|
/* HeadingButton.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
3
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
2
4
|
import "./HeadingButton.compiled.css";
|
|
5
|
+
import * as React from 'react';
|
|
3
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
5
7
|
import { useIntl } from 'react-intl-next';
|
|
6
8
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
9
|
import { formatShortcut, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6 } from '@atlaskit/editor-common/keymaps';
|
|
10
|
+
import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
|
|
8
11
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
9
12
|
import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
10
13
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
|
+
const normalStyle = null;
|
|
16
|
+
const heading1Style = null;
|
|
17
|
+
const heading2Style = null;
|
|
18
|
+
const heading3Style = null;
|
|
19
|
+
const heading4Style = null;
|
|
20
|
+
const heading5Style = null;
|
|
21
|
+
const heading6Style = null;
|
|
22
|
+
const HeadingText = ({
|
|
23
|
+
children,
|
|
24
|
+
headingType
|
|
25
|
+
}) => {
|
|
26
|
+
switch (headingType) {
|
|
27
|
+
case 'heading1':
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: ax(["_11c812rg"]),
|
|
30
|
+
style: {
|
|
31
|
+
"--_1h4o6ch": ix(editorUGCToken('editor.font.heading.h1'))
|
|
32
|
+
}
|
|
33
|
+
}, children);
|
|
34
|
+
case 'heading2':
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: ax(["_11c81td5"]),
|
|
37
|
+
style: {
|
|
38
|
+
"--_1kn1hjn": ix(editorUGCToken('editor.font.heading.h2'))
|
|
39
|
+
}
|
|
40
|
+
}, children);
|
|
41
|
+
case 'heading3':
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: ax(["_11c81og0"]),
|
|
44
|
+
style: {
|
|
45
|
+
"--_13pg0ac": ix(editorUGCToken('editor.font.heading.h3'))
|
|
46
|
+
}
|
|
47
|
+
}, children);
|
|
48
|
+
case 'heading4':
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: ax(["_11c846ty"]),
|
|
51
|
+
style: {
|
|
52
|
+
"--_j67hki": ix(editorUGCToken('editor.font.heading.h4'))
|
|
53
|
+
}
|
|
54
|
+
}, children);
|
|
55
|
+
case 'heading5':
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: ax(["_11c81fq3"]),
|
|
58
|
+
style: {
|
|
59
|
+
"--_1d0ko3v": ix(editorUGCToken('editor.font.heading.h5'))
|
|
60
|
+
}
|
|
61
|
+
}, children);
|
|
62
|
+
case 'heading6':
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: ax(["_11c81vog"]),
|
|
65
|
+
style: {
|
|
66
|
+
"--_1c98jvx": ix(editorUGCToken('editor.font.heading.h6'))
|
|
67
|
+
}
|
|
68
|
+
}, children);
|
|
69
|
+
case 'normal':
|
|
70
|
+
default:
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: ax(["_11c81u7j"]),
|
|
73
|
+
style: {
|
|
74
|
+
"--_goypne": ix(editorUGCToken('editor.font.body'))
|
|
75
|
+
}
|
|
76
|
+
}, children);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
11
79
|
const headingSizeStylesMap = {
|
|
12
80
|
normal: "_11c8fhey",
|
|
13
81
|
heading1: "_11c812ln",
|
|
@@ -53,7 +121,9 @@ export const HeadingButton = ({
|
|
|
53
121
|
onClick: onClick,
|
|
54
122
|
isSelected: isSelected,
|
|
55
123
|
ariaKeyshortcuts: shortcut
|
|
56
|
-
}, /*#__PURE__*/React.createElement(
|
|
124
|
+
}, expValEquals('platform_editor_toolbar_aifc_use_editor_typography', 'isEnabled', true) ? /*#__PURE__*/React.createElement(HeadingText, {
|
|
125
|
+
headingType: blockType.name
|
|
126
|
+
}, formatMessage(blockType.title)) : /*#__PURE__*/React.createElement(Box, {
|
|
57
127
|
xcss: headingSizeStylesMap[blockType.name]
|
|
58
128
|
}, formatMessage(blockType.title)));
|
|
59
129
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
._11c810sd{font:var(--ds-font-heading-large,normal 653 24px/28px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._11c812ln{font:var(--ds-font-heading-xlarge,normal 653 28px/2pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
+
._11c812rg{font:var(--_1h4o6ch)}
|
|
3
4
|
._11c81af2{font:var(--ds-font-heading-medium,normal 653 20px/24px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
4
5
|
._11c81e3o{font:var(--ds-font-heading-small,normal 653 1pc/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
6
|
+
._11c81fq3{font:var(--_1d0ko3v)}
|
|
7
|
+
._11c81og0{font:var(--_13pg0ac)}
|
|
5
8
|
._11c81qyo{font:var(--ds-font-heading-xsmall,normal 653 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
9
|
+
._11c81td5{font:var(--_1kn1hjn)}
|
|
10
|
+
._11c81u7j{font:var(--_goypne)}
|
|
11
|
+
._11c81vog{font:var(--_1c98jvx)}
|
|
12
|
+
._11c846ty{font:var(--_j67hki)}
|
|
6
13
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
7
14
|
._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
@@ -1,13 +1,80 @@
|
|
|
1
1
|
/* HeadingButton.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
3
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
2
4
|
import "./HeadingButton.compiled.css";
|
|
5
|
+
import * as React from 'react';
|
|
3
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
5
7
|
import { useIntl } from 'react-intl-next';
|
|
6
8
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
9
|
import { formatShortcut, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6 } from '@atlaskit/editor-common/keymaps';
|
|
10
|
+
import { editorUGCToken } from '@atlaskit/editor-common/ugc-tokens';
|
|
8
11
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
9
12
|
import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
10
13
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
|
+
var normalStyle = null;
|
|
16
|
+
var heading1Style = null;
|
|
17
|
+
var heading2Style = null;
|
|
18
|
+
var heading3Style = null;
|
|
19
|
+
var heading4Style = null;
|
|
20
|
+
var heading5Style = null;
|
|
21
|
+
var heading6Style = null;
|
|
22
|
+
var HeadingText = function HeadingText(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
headingType = _ref.headingType;
|
|
25
|
+
switch (headingType) {
|
|
26
|
+
case 'heading1':
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: ax(["_11c812rg"]),
|
|
29
|
+
style: {
|
|
30
|
+
"--_1h4o6ch": ix(editorUGCToken('editor.font.heading.h1'))
|
|
31
|
+
}
|
|
32
|
+
}, children);
|
|
33
|
+
case 'heading2':
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: ax(["_11c81td5"]),
|
|
36
|
+
style: {
|
|
37
|
+
"--_1kn1hjn": ix(editorUGCToken('editor.font.heading.h2'))
|
|
38
|
+
}
|
|
39
|
+
}, children);
|
|
40
|
+
case 'heading3':
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: ax(["_11c81og0"]),
|
|
43
|
+
style: {
|
|
44
|
+
"--_13pg0ac": ix(editorUGCToken('editor.font.heading.h3'))
|
|
45
|
+
}
|
|
46
|
+
}, children);
|
|
47
|
+
case 'heading4':
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: ax(["_11c846ty"]),
|
|
50
|
+
style: {
|
|
51
|
+
"--_j67hki": ix(editorUGCToken('editor.font.heading.h4'))
|
|
52
|
+
}
|
|
53
|
+
}, children);
|
|
54
|
+
case 'heading5':
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: ax(["_11c81fq3"]),
|
|
57
|
+
style: {
|
|
58
|
+
"--_1d0ko3v": ix(editorUGCToken('editor.font.heading.h5'))
|
|
59
|
+
}
|
|
60
|
+
}, children);
|
|
61
|
+
case 'heading6':
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: ax(["_11c81vog"]),
|
|
64
|
+
style: {
|
|
65
|
+
"--_1c98jvx": ix(editorUGCToken('editor.font.heading.h6'))
|
|
66
|
+
}
|
|
67
|
+
}, children);
|
|
68
|
+
case 'normal':
|
|
69
|
+
default:
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: ax(["_11c81u7j"]),
|
|
72
|
+
style: {
|
|
73
|
+
"--_goypne": ix(editorUGCToken('editor.font.body'))
|
|
74
|
+
}
|
|
75
|
+
}, children);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
11
78
|
var headingSizeStylesMap = {
|
|
12
79
|
normal: "_11c8fhey",
|
|
13
80
|
heading1: "_11c812ln",
|
|
@@ -26,9 +93,9 @@ var shortcuts = {
|
|
|
26
93
|
heading5: toggleHeading5,
|
|
27
94
|
heading6: toggleHeading6
|
|
28
95
|
};
|
|
29
|
-
export var HeadingButton = function HeadingButton(
|
|
30
|
-
var blockType =
|
|
31
|
-
api =
|
|
96
|
+
export var HeadingButton = function HeadingButton(_ref2) {
|
|
97
|
+
var blockType = _ref2.blockType,
|
|
98
|
+
api = _ref2.api;
|
|
32
99
|
var _useIntl = useIntl(),
|
|
33
100
|
formatMessage = _useIntl.formatMessage;
|
|
34
101
|
var currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
|
|
@@ -53,7 +120,9 @@ export var HeadingButton = function HeadingButton(_ref) {
|
|
|
53
120
|
onClick: onClick,
|
|
54
121
|
isSelected: isSelected,
|
|
55
122
|
ariaKeyshortcuts: shortcut
|
|
56
|
-
}, /*#__PURE__*/React.createElement(
|
|
123
|
+
}, expValEquals('platform_editor_toolbar_aifc_use_editor_typography', 'isEnabled', true) ? /*#__PURE__*/React.createElement(HeadingText, {
|
|
124
|
+
headingType: blockType.name
|
|
125
|
+
}, formatMessage(blockType.title)) : /*#__PURE__*/React.createElement(Box, {
|
|
57
126
|
xcss: headingSizeStylesMap[blockType.name]
|
|
58
127
|
}, formatMessage(blockType.title)));
|
|
59
128
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.9",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,9 +50,10 @@
|
|
|
50
50
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
51
51
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
52
52
|
"@atlaskit/theme": "^21.0.0",
|
|
53
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^20.3.0",
|
|
54
54
|
"@atlaskit/tokens": "^11.0.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|
|
56
|
+
"@compiled/react": "^0.18.6",
|
|
56
57
|
"@emotion/react": "^11.7.1"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|