@atlaskit/editor-plugin-block-type 7.1.1 → 7.1.3
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 +16 -0
- package/dist/cjs/blockTypePlugin.js +5 -3
- package/dist/cjs/pm-plugins/block-types.js +29 -0
- package/dist/es2019/blockTypePlugin.js +5 -3
- package/dist/es2019/pm-plugins/block-types.js +30 -1
- package/dist/esm/blockTypePlugin.js +5 -3
- package/dist/esm/pm-plugins/block-types.js +30 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 7.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`555ac8f256674`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/555ac8f256674) -
|
|
8
|
+
Update menu item icon size to small, tweak paddings and font styles
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`db97eb262cc5a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/db97eb262cc5a) -
|
|
16
|
+
replace platform_editor_toolbar_aifc with separate experiements for jira and confluence
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 7.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -15,7 +15,6 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
15
15
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
16
16
|
var _types = require("@atlaskit/editor-common/types");
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
18
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
20
19
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
21
20
|
var _blockType = require("./pm-plugins/commands/block-type");
|
|
@@ -106,6 +105,9 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
|
106
105
|
var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
107
106
|
var options = _ref3.config,
|
|
108
107
|
api = _ref3.api;
|
|
108
|
+
var isToolbarAIFCEnabled = (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
|
|
109
|
+
exposure: true
|
|
110
|
+
});
|
|
109
111
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
|
|
110
112
|
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
111
113
|
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
@@ -128,7 +130,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
|
128
130
|
shouldUseDefaultRole: false
|
|
129
131
|
});
|
|
130
132
|
};
|
|
131
|
-
if (
|
|
133
|
+
if (isToolbarAIFCEnabled) {
|
|
132
134
|
var _api$toolbar;
|
|
133
135
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api));
|
|
134
136
|
} else {
|
|
@@ -219,7 +221,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
|
219
221
|
return _main.pluginKey.getState(editorState);
|
|
220
222
|
},
|
|
221
223
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
|
222
|
-
pluginsOptions: _objectSpread(_objectSpread({}, !
|
|
224
|
+
pluginsOptions: _objectSpread(_objectSpread({}, !isToolbarAIFCEnabled && {
|
|
223
225
|
selectionToolbar: function selectionToolbar() {
|
|
224
226
|
var _api$userPreferences, _api$selectionToolbar;
|
|
225
227
|
var toolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
|
|
@@ -133,35 +133,64 @@ var ToolbarBlockTypes = /*#__PURE__*/function (ToolbarBlockTypes) {
|
|
|
133
133
|
var toolbarBlockTypesWithRank = exports.toolbarBlockTypesWithRank = function toolbarBlockTypesWithRank() {
|
|
134
134
|
return {
|
|
135
135
|
normal: _objectSpread(_objectSpread({}, NORMAL_TEXT), {}, {
|
|
136
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.TextIcon, {
|
|
137
|
+
size: "small",
|
|
138
|
+
label: ""
|
|
139
|
+
}),
|
|
136
140
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.NORMAL_TEXT_MENU_ITEM.key],
|
|
137
141
|
toolbarKey: _toolbar.NORMAL_TEXT_MENU_ITEM.key
|
|
138
142
|
}),
|
|
139
143
|
heading1: _objectSpread(_objectSpread({}, HEADING_1), {}, {
|
|
144
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.HeadingOneIcon, {
|
|
145
|
+
size: "small",
|
|
146
|
+
label: ""
|
|
147
|
+
}),
|
|
140
148
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.HEADING_1_MENU_ITEM.key],
|
|
141
149
|
toolbarKey: _toolbar.HEADING_1_MENU_ITEM.key
|
|
142
150
|
}),
|
|
143
151
|
heading2: _objectSpread(_objectSpread({}, HEADING_2), {}, {
|
|
152
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.HeadingTwoIcon, {
|
|
153
|
+
size: "small",
|
|
154
|
+
label: ""
|
|
155
|
+
}),
|
|
144
156
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.HEADING_2_MENU_ITEM.key],
|
|
145
157
|
toolbarKey: _toolbar.HEADING_2_MENU_ITEM.key
|
|
146
158
|
}),
|
|
147
159
|
heading3: _objectSpread(_objectSpread({}, HEADING_3), {}, {
|
|
160
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.HeadingThreeIcon, {
|
|
161
|
+
size: "small",
|
|
162
|
+
label: ""
|
|
163
|
+
}),
|
|
148
164
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.HEADING_3_MENU_ITEM.key],
|
|
149
165
|
toolbarKey: _toolbar.HEADING_3_MENU_ITEM.key
|
|
150
166
|
}),
|
|
151
167
|
heading4: _objectSpread(_objectSpread({}, HEADING_4), {}, {
|
|
168
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.HeadingFourIcon, {
|
|
169
|
+
size: "small",
|
|
170
|
+
label: ""
|
|
171
|
+
}),
|
|
152
172
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.HEADING_4_MENU_ITEM.key],
|
|
153
173
|
toolbarKey: _toolbar.HEADING_4_MENU_ITEM.key
|
|
154
174
|
}),
|
|
155
175
|
heading5: _objectSpread(_objectSpread({}, HEADING_5), {}, {
|
|
176
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.HeadingFiveIcon, {
|
|
177
|
+
size: "small",
|
|
178
|
+
label: ""
|
|
179
|
+
}),
|
|
156
180
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.HEADING_5_MENU_ITEM.key],
|
|
157
181
|
toolbarKey: _toolbar.HEADING_5_MENU_ITEM.key
|
|
158
182
|
}),
|
|
159
183
|
heading6: _objectSpread(_objectSpread({}, HEADING_6), {}, {
|
|
184
|
+
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.HeadingSixIcon, {
|
|
185
|
+
size: "small",
|
|
186
|
+
label: ""
|
|
187
|
+
}),
|
|
160
188
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.HEADING_6_MENU_ITEM.key],
|
|
161
189
|
toolbarKey: _toolbar.HEADING_6_MENU_ITEM.key
|
|
162
190
|
}),
|
|
163
191
|
blockquote: _objectSpread(_objectSpread({}, BLOCK_QUOTE), {}, {
|
|
164
192
|
icon: /*#__PURE__*/_react.default.createElement(_editorToolbar.QuoteIcon, {
|
|
193
|
+
size: "small",
|
|
165
194
|
label: ""
|
|
166
195
|
}),
|
|
167
196
|
toolbarRank: _toolbar.TEXT_STYLES_MENU_SECTION_RANK[_toolbar.BLOCK_QUOTE_MENU_ITEM.key],
|
|
@@ -6,7 +6,6 @@ import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages'
|
|
|
6
6
|
import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
7
7
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
9
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
11
|
import { clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
|
@@ -94,6 +93,9 @@ const blockTypePlugin = ({
|
|
|
94
93
|
config: options,
|
|
95
94
|
api
|
|
96
95
|
}) => {
|
|
96
|
+
const isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
|
|
97
|
+
exposure: true
|
|
98
|
+
});
|
|
97
99
|
const primaryToolbarComponent = ({
|
|
98
100
|
popupsMountPoint,
|
|
99
101
|
popupsBoundariesElement,
|
|
@@ -117,7 +119,7 @@ const blockTypePlugin = ({
|
|
|
117
119
|
shouldUseDefaultRole: false
|
|
118
120
|
});
|
|
119
121
|
};
|
|
120
|
-
if (
|
|
122
|
+
if (isToolbarAIFCEnabled) {
|
|
121
123
|
var _api$toolbar;
|
|
122
124
|
api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api));
|
|
123
125
|
} else {
|
|
@@ -207,7 +209,7 @@ const blockTypePlugin = ({
|
|
|
207
209
|
},
|
|
208
210
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
|
209
211
|
pluginsOptions: {
|
|
210
|
-
...(!
|
|
212
|
+
...(!isToolbarAIFCEnabled && {
|
|
211
213
|
selectionToolbar: () => {
|
|
212
214
|
var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
|
|
213
215
|
const toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.preferences) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.toolbarDockingPosition : api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
3
|
import { BLOCK_QUOTE_MENU_ITEM, HEADING_1_MENU_ITEM, HEADING_2_MENU_ITEM, HEADING_3_MENU_ITEM, HEADING_4_MENU_ITEM, HEADING_5_MENU_ITEM, HEADING_6_MENU_ITEM, NORMAL_TEXT_MENU_ITEM, TEXT_STYLES_MENU_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
|
|
4
|
-
import { QuoteIcon } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { TextIcon as EditorToolbarTextIcon, QuoteIcon, HeadingOneIcon, HeadingTwoIcon, HeadingThreeIcon, HeadingFourIcon, HeadingFiveIcon, HeadingSixIcon } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
|
|
6
6
|
import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
|
|
7
7
|
import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
|
|
@@ -123,42 +123,71 @@ var ToolbarBlockTypes = /*#__PURE__*/function (ToolbarBlockTypes) {
|
|
|
123
123
|
export const toolbarBlockTypesWithRank = () => ({
|
|
124
124
|
normal: {
|
|
125
125
|
...NORMAL_TEXT,
|
|
126
|
+
icon: /*#__PURE__*/React.createElement(EditorToolbarTextIcon, {
|
|
127
|
+
size: "small",
|
|
128
|
+
label: ""
|
|
129
|
+
}),
|
|
126
130
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[NORMAL_TEXT_MENU_ITEM.key],
|
|
127
131
|
toolbarKey: NORMAL_TEXT_MENU_ITEM.key
|
|
128
132
|
},
|
|
129
133
|
heading1: {
|
|
130
134
|
...HEADING_1,
|
|
135
|
+
icon: /*#__PURE__*/React.createElement(HeadingOneIcon, {
|
|
136
|
+
size: "small",
|
|
137
|
+
label: ""
|
|
138
|
+
}),
|
|
131
139
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_1_MENU_ITEM.key],
|
|
132
140
|
toolbarKey: HEADING_1_MENU_ITEM.key
|
|
133
141
|
},
|
|
134
142
|
heading2: {
|
|
135
143
|
...HEADING_2,
|
|
144
|
+
icon: /*#__PURE__*/React.createElement(HeadingTwoIcon, {
|
|
145
|
+
size: "small",
|
|
146
|
+
label: ""
|
|
147
|
+
}),
|
|
136
148
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_2_MENU_ITEM.key],
|
|
137
149
|
toolbarKey: HEADING_2_MENU_ITEM.key
|
|
138
150
|
},
|
|
139
151
|
heading3: {
|
|
140
152
|
...HEADING_3,
|
|
153
|
+
icon: /*#__PURE__*/React.createElement(HeadingThreeIcon, {
|
|
154
|
+
size: "small",
|
|
155
|
+
label: ""
|
|
156
|
+
}),
|
|
141
157
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_3_MENU_ITEM.key],
|
|
142
158
|
toolbarKey: HEADING_3_MENU_ITEM.key
|
|
143
159
|
},
|
|
144
160
|
heading4: {
|
|
145
161
|
...HEADING_4,
|
|
162
|
+
icon: /*#__PURE__*/React.createElement(HeadingFourIcon, {
|
|
163
|
+
size: "small",
|
|
164
|
+
label: ""
|
|
165
|
+
}),
|
|
146
166
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_4_MENU_ITEM.key],
|
|
147
167
|
toolbarKey: HEADING_4_MENU_ITEM.key
|
|
148
168
|
},
|
|
149
169
|
heading5: {
|
|
150
170
|
...HEADING_5,
|
|
171
|
+
icon: /*#__PURE__*/React.createElement(HeadingFiveIcon, {
|
|
172
|
+
size: "small",
|
|
173
|
+
label: ""
|
|
174
|
+
}),
|
|
151
175
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_5_MENU_ITEM.key],
|
|
152
176
|
toolbarKey: HEADING_5_MENU_ITEM.key
|
|
153
177
|
},
|
|
154
178
|
heading6: {
|
|
155
179
|
...HEADING_6,
|
|
180
|
+
icon: /*#__PURE__*/React.createElement(HeadingSixIcon, {
|
|
181
|
+
size: "small",
|
|
182
|
+
label: ""
|
|
183
|
+
}),
|
|
156
184
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_6_MENU_ITEM.key],
|
|
157
185
|
toolbarKey: HEADING_6_MENU_ITEM.key
|
|
158
186
|
},
|
|
159
187
|
blockquote: {
|
|
160
188
|
...BLOCK_QUOTE,
|
|
161
189
|
icon: /*#__PURE__*/React.createElement(QuoteIcon, {
|
|
190
|
+
size: "small",
|
|
162
191
|
label: ""
|
|
163
192
|
}),
|
|
164
193
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[BLOCK_QUOTE_MENU_ITEM.key],
|
|
@@ -10,7 +10,6 @@ import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages'
|
|
|
10
10
|
import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
11
11
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
15
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
15
|
import { clearFormatting as _clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
|
@@ -99,6 +98,9 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
|
99
98
|
var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
100
99
|
var options = _ref3.config,
|
|
101
100
|
api = _ref3.api;
|
|
101
|
+
var isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
|
|
102
|
+
exposure: true
|
|
103
|
+
});
|
|
102
104
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
|
|
103
105
|
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
104
106
|
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
@@ -121,7 +123,7 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
|
121
123
|
shouldUseDefaultRole: false
|
|
122
124
|
});
|
|
123
125
|
};
|
|
124
|
-
if (
|
|
126
|
+
if (isToolbarAIFCEnabled) {
|
|
125
127
|
var _api$toolbar;
|
|
126
128
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api));
|
|
127
129
|
} else {
|
|
@@ -212,7 +214,7 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
|
212
214
|
return pluginKey.getState(editorState);
|
|
213
215
|
},
|
|
214
216
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
|
215
|
-
pluginsOptions: _objectSpread(_objectSpread({}, !
|
|
217
|
+
pluginsOptions: _objectSpread(_objectSpread({}, !isToolbarAIFCEnabled && {
|
|
216
218
|
selectionToolbar: function selectionToolbar() {
|
|
217
219
|
var _api$userPreferences, _api$selectionToolbar;
|
|
218
220
|
var toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { BLOCK_QUOTE_MENU_ITEM, HEADING_1_MENU_ITEM, HEADING_2_MENU_ITEM, HEADING_3_MENU_ITEM, HEADING_4_MENU_ITEM, HEADING_5_MENU_ITEM, HEADING_6_MENU_ITEM, NORMAL_TEXT_MENU_ITEM, TEXT_STYLES_MENU_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
|
|
7
|
-
import { QuoteIcon } from '@atlaskit/editor-toolbar';
|
|
7
|
+
import { TextIcon as EditorToolbarTextIcon, QuoteIcon, HeadingOneIcon, HeadingTwoIcon, HeadingThreeIcon, HeadingFourIcon, HeadingFiveIcon, HeadingSixIcon } from '@atlaskit/editor-toolbar';
|
|
8
8
|
import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
|
|
9
9
|
import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
|
|
10
10
|
import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
|
|
@@ -126,35 +126,64 @@ var ToolbarBlockTypes = /*#__PURE__*/function (ToolbarBlockTypes) {
|
|
|
126
126
|
export var toolbarBlockTypesWithRank = function toolbarBlockTypesWithRank() {
|
|
127
127
|
return {
|
|
128
128
|
normal: _objectSpread(_objectSpread({}, NORMAL_TEXT), {}, {
|
|
129
|
+
icon: /*#__PURE__*/React.createElement(EditorToolbarTextIcon, {
|
|
130
|
+
size: "small",
|
|
131
|
+
label: ""
|
|
132
|
+
}),
|
|
129
133
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[NORMAL_TEXT_MENU_ITEM.key],
|
|
130
134
|
toolbarKey: NORMAL_TEXT_MENU_ITEM.key
|
|
131
135
|
}),
|
|
132
136
|
heading1: _objectSpread(_objectSpread({}, HEADING_1), {}, {
|
|
137
|
+
icon: /*#__PURE__*/React.createElement(HeadingOneIcon, {
|
|
138
|
+
size: "small",
|
|
139
|
+
label: ""
|
|
140
|
+
}),
|
|
133
141
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_1_MENU_ITEM.key],
|
|
134
142
|
toolbarKey: HEADING_1_MENU_ITEM.key
|
|
135
143
|
}),
|
|
136
144
|
heading2: _objectSpread(_objectSpread({}, HEADING_2), {}, {
|
|
145
|
+
icon: /*#__PURE__*/React.createElement(HeadingTwoIcon, {
|
|
146
|
+
size: "small",
|
|
147
|
+
label: ""
|
|
148
|
+
}),
|
|
137
149
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_2_MENU_ITEM.key],
|
|
138
150
|
toolbarKey: HEADING_2_MENU_ITEM.key
|
|
139
151
|
}),
|
|
140
152
|
heading3: _objectSpread(_objectSpread({}, HEADING_3), {}, {
|
|
153
|
+
icon: /*#__PURE__*/React.createElement(HeadingThreeIcon, {
|
|
154
|
+
size: "small",
|
|
155
|
+
label: ""
|
|
156
|
+
}),
|
|
141
157
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_3_MENU_ITEM.key],
|
|
142
158
|
toolbarKey: HEADING_3_MENU_ITEM.key
|
|
143
159
|
}),
|
|
144
160
|
heading4: _objectSpread(_objectSpread({}, HEADING_4), {}, {
|
|
161
|
+
icon: /*#__PURE__*/React.createElement(HeadingFourIcon, {
|
|
162
|
+
size: "small",
|
|
163
|
+
label: ""
|
|
164
|
+
}),
|
|
145
165
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_4_MENU_ITEM.key],
|
|
146
166
|
toolbarKey: HEADING_4_MENU_ITEM.key
|
|
147
167
|
}),
|
|
148
168
|
heading5: _objectSpread(_objectSpread({}, HEADING_5), {}, {
|
|
169
|
+
icon: /*#__PURE__*/React.createElement(HeadingFiveIcon, {
|
|
170
|
+
size: "small",
|
|
171
|
+
label: ""
|
|
172
|
+
}),
|
|
149
173
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_5_MENU_ITEM.key],
|
|
150
174
|
toolbarKey: HEADING_5_MENU_ITEM.key
|
|
151
175
|
}),
|
|
152
176
|
heading6: _objectSpread(_objectSpread({}, HEADING_6), {}, {
|
|
177
|
+
icon: /*#__PURE__*/React.createElement(HeadingSixIcon, {
|
|
178
|
+
size: "small",
|
|
179
|
+
label: ""
|
|
180
|
+
}),
|
|
153
181
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[HEADING_6_MENU_ITEM.key],
|
|
154
182
|
toolbarKey: HEADING_6_MENU_ITEM.key
|
|
155
183
|
}),
|
|
156
184
|
blockquote: _objectSpread(_objectSpread({}, BLOCK_QUOTE), {}, {
|
|
157
185
|
icon: /*#__PURE__*/React.createElement(QuoteIcon, {
|
|
186
|
+
size: "small",
|
|
158
187
|
label: ""
|
|
159
188
|
}),
|
|
160
189
|
toolbarRank: TEXT_STYLES_MENU_SECTION_RANK[BLOCK_QUOTE_MENU_ITEM.key],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"@atlaskit/primitives": "^14.13.0",
|
|
50
50
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
51
51
|
"@atlaskit/theme": "^20.0.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^12.5.0",
|
|
53
53
|
"@atlaskit/tokens": "^6.2.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^108.
|
|
58
|
+
"@atlaskit/editor-common": "^108.5.0",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
61
61
|
"react-intl-next": "npm:react-intl@^5.18.1"
|