@atlaskit/editor-plugin-block-type 6.2.18 → 6.2.19

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/blockTypePlugin.js +1 -1
  3. package/dist/cjs/ui/HeadingBlockMenuItem.js +63 -0
  4. package/dist/cjs/ui/ParagraphBlockMenuItem.js +50 -0
  5. package/dist/cjs/ui/QuoteBlockMenuItem.js +42 -0
  6. package/dist/cjs/ui/index.js +34 -42
  7. package/dist/es2019/blockTypePlugin.js +1 -1
  8. package/dist/es2019/ui/HeadingBlockMenuItem.js +57 -0
  9. package/dist/es2019/ui/ParagraphBlockMenuItem.js +44 -0
  10. package/dist/es2019/ui/QuoteBlockMenuItem.js +36 -0
  11. package/dist/es2019/ui/index.js +28 -19
  12. package/dist/esm/blockTypePlugin.js +1 -1
  13. package/dist/esm/ui/HeadingBlockMenuItem.js +56 -0
  14. package/dist/esm/ui/ParagraphBlockMenuItem.js +43 -0
  15. package/dist/esm/ui/QuoteBlockMenuItem.js +35 -0
  16. package/dist/esm/ui/index.js +34 -41
  17. package/dist/types/blockTypePluginType.d.ts +5 -1
  18. package/dist/types/ui/HeadingBlockMenuItem.d.ts +9 -0
  19. package/dist/types/ui/ParagraphBlockMenuItem.d.ts +8 -0
  20. package/dist/types/ui/QuoteBlockMenuItem.d.ts +8 -0
  21. package/dist/types/ui/index.d.ts +3 -1
  22. package/dist/types-ts4.5/blockTypePluginType.d.ts +5 -1
  23. package/dist/types-ts4.5/ui/HeadingBlockMenuItem.d.ts +9 -0
  24. package/dist/types-ts4.5/ui/ParagraphBlockMenuItem.d.ts +8 -0
  25. package/dist/types-ts4.5/ui/QuoteBlockMenuItem.d.ts +8 -0
  26. package/dist/types-ts4.5/ui/index.d.ts +3 -1
  27. package/package.json +4 -2
  28. package/dist/cjs/ui/HeadingMenuItem.js +0 -31
  29. package/dist/cjs/ui/ParagraphMenuItem.js +0 -21
  30. package/dist/cjs/ui/QuoteMenuItem.js +0 -21
  31. package/dist/es2019/ui/HeadingMenuItem.js +0 -26
  32. package/dist/es2019/ui/ParagraphMenuItem.js +0 -15
  33. package/dist/es2019/ui/QuoteMenuItem.js +0 -15
  34. package/dist/esm/ui/HeadingMenuItem.js +0 -24
  35. package/dist/esm/ui/ParagraphMenuItem.js +0 -14
  36. package/dist/esm/ui/QuoteMenuItem.js +0 -14
  37. package/dist/types/ui/HeadingMenuItem.d.ts +0 -6
  38. package/dist/types/ui/ParagraphMenuItem.d.ts +0 -2
  39. package/dist/types/ui/QuoteMenuItem.d.ts +0 -2
  40. package/dist/types-ts4.5/ui/HeadingMenuItem.d.ts +0 -6
  41. package/dist/types-ts4.5/ui/ParagraphMenuItem.d.ts +0 -2
  42. package/dist/types-ts4.5/ui/QuoteMenuItem.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 6.2.19
4
+
5
+ ### Patch Changes
6
+
7
+ - [`652bf219a308e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/652bf219a308e) -
8
+ [ux] ED-28581: Added isSelected state for block type and lists"
9
+ - [`652bf219a308e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/652bf219a308e) -
10
+ [ux] ED-28581: isSelected for block type and list
11
+ - Updated dependencies
12
+
3
13
  ## 6.2.18
4
14
 
5
15
  ### Patch Changes
@@ -140,7 +140,7 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
140
140
  }
141
141
  if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
142
142
  var _api$blockMenu;
143
- api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents((0, _ui.getBlockTypeComponents)());
143
+ api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents((0, _ui.getBlockTypeComponents)(api));
144
144
  }
145
145
  return {
146
146
  name: 'blockType',
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createHeadingBlockMenuItem = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactIntlNext = require("react-intl-next");
10
+ var _messages = require("@atlaskit/editor-common/messages");
11
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
12
+ var _state = require("@atlaskit/editor-prosemirror/state");
13
+ var _editorToolbar = require("@atlaskit/editor-toolbar");
14
+ var _textHeadingFive = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-five"));
15
+ var _textHeadingFour = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-four"));
16
+ var _textHeadingOne = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-one"));
17
+ var _textHeadingSix = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-six"));
18
+ var _textHeadingThree = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-three"));
19
+ var _textHeadingTwo = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-two"));
20
+ var _consts = require("./consts");
21
+ var headingIcons = [_textHeadingOne.default, _textHeadingTwo.default, _textHeadingThree.default, _textHeadingFour.default, _textHeadingFive.default, _textHeadingSix.default];
22
+ var headingMessages = [_messages.blockTypeMessages.heading1, _messages.blockTypeMessages.heading2, _messages.blockTypeMessages.heading3, _messages.blockTypeMessages.heading4, _messages.blockTypeMessages.heading5, _messages.blockTypeMessages.heading6];
23
+ var HeadingBlockTypes = [_consts.HEADING_1, _consts.HEADING_2, _consts.HEADING_3, _consts.HEADING_4, _consts.HEADING_5, _consts.HEADING_6];
24
+ var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
25
+ var level = _ref.level,
26
+ api = _ref.api;
27
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
28
+ formatMessage = _useIntl.formatMessage;
29
+ var Icon = headingIcons[level - 1];
30
+ var message = headingMessages[level - 1];
31
+ var currentBlockType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.currentBlockType');
32
+ var selection = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selection.selection');
33
+ var isTextSelection = selection instanceof _state.TextSelection;
34
+ var isHeading = isTextSelection && currentBlockType && HeadingBlockTypes.includes(currentBlockType);
35
+ var currentHeadingLevel = isHeading ? currentBlockType.level : undefined;
36
+ var isSelected = isHeading && currentHeadingLevel === level;
37
+ var handleClick = function handleClick() {
38
+ if (!selection) {
39
+ return;
40
+ }
41
+ if (!isSelected) {
42
+ var _api$blockMenu;
43
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode("heading".concat(level)));
44
+ }
45
+ };
46
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
47
+ onClick: handleClick,
48
+ isSelected: isSelected,
49
+ elemBefore: /*#__PURE__*/_react.default.createElement(Icon, {
50
+ label: ""
51
+ })
52
+ }, formatMessage(message));
53
+ };
54
+ var createHeadingBlockMenuItem = exports.createHeadingBlockMenuItem = function createHeadingBlockMenuItem(_ref2) {
55
+ var level = _ref2.level,
56
+ api = _ref2.api;
57
+ return function () {
58
+ return /*#__PURE__*/_react.default.createElement(HeadingBlockMenuItem, {
59
+ level: level,
60
+ api: api
61
+ });
62
+ };
63
+ };
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createParagraphBlockMenuItem = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactIntlNext = require("react-intl-next");
10
+ var _messages = require("@atlaskit/editor-common/messages");
11
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
12
+ var _state = require("@atlaskit/editor-prosemirror/state");
13
+ var _editorToolbar = require("@atlaskit/editor-toolbar");
14
+ var _textParagraph = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-paragraph"));
15
+ var _consts = require("./consts");
16
+ var ParagraphBlockMenuItem = function ParagraphBlockMenuItem(_ref) {
17
+ var api = _ref.api;
18
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
19
+ formatMessage = _useIntl.formatMessage;
20
+ var currentBlockType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.currentBlockType');
21
+ var bulletListActive = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'list.bulletListActive');
22
+ var orderedListActive = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'list.orderedListActive');
23
+ var selection = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selection.selection');
24
+ var isTextSelection = selection instanceof _state.TextSelection;
25
+ var isParagraph = isTextSelection && currentBlockType && currentBlockType === _consts.NORMAL_TEXT && !bulletListActive && !orderedListActive;
26
+ var handleClick = function handleClick() {
27
+ if (!selection) {
28
+ return;
29
+ }
30
+ if (!isParagraph) {
31
+ var _api$blockMenu;
32
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode("paragraph"));
33
+ }
34
+ };
35
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
36
+ onClick: handleClick,
37
+ isSelected: isParagraph,
38
+ elemBefore: /*#__PURE__*/_react.default.createElement(_textParagraph.default, {
39
+ label: ""
40
+ })
41
+ }, formatMessage(_messages.blockMenuMessages.paragraph));
42
+ };
43
+ var createParagraphBlockMenuItem = exports.createParagraphBlockMenuItem = function createParagraphBlockMenuItem(_ref2) {
44
+ var api = _ref2.api;
45
+ return function () {
46
+ return /*#__PURE__*/_react.default.createElement(ParagraphBlockMenuItem, {
47
+ api: api
48
+ });
49
+ };
50
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createQuoteBlockMenuItem = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactIntlNext = require("react-intl-next");
10
+ var _messages = require("@atlaskit/editor-common/messages");
11
+ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
12
+ var _editorToolbar = require("@atlaskit/editor-toolbar");
13
+ var _quotationMark = _interopRequireDefault(require("@atlaskit/icon/core/quotation-mark"));
14
+ var _consts = require("./consts");
15
+ var QuoteBlockMenuItem = function QuoteBlockMenuItem(_ref) {
16
+ var api = _ref.api;
17
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
18
+ formatMessage = _useIntl.formatMessage;
19
+ var currentBlockType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.currentBlockType');
20
+ var isBlockQuote = currentBlockType && currentBlockType === _consts.BLOCK_QUOTE;
21
+ var handleClick = function handleClick() {
22
+ if (!isBlockQuote) {
23
+ var _api$blockMenu;
24
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode("blockquote"));
25
+ }
26
+ };
27
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
28
+ onClick: handleClick,
29
+ isSelected: isBlockQuote,
30
+ elemBefore: /*#__PURE__*/_react.default.createElement(_quotationMark.default, {
31
+ label: ""
32
+ })
33
+ }, formatMessage(_messages.blockTypeMessages.blockquote));
34
+ };
35
+ var createQuoteBlockMenuItem = exports.createQuoteBlockMenuItem = function createQuoteBlockMenuItem(_ref2) {
36
+ var api = _ref2.api;
37
+ return function () {
38
+ return /*#__PURE__*/_react.default.createElement(QuoteBlockMenuItem, {
39
+ api: api
40
+ });
41
+ };
42
+ };
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.getBlockTypeComponents = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
7
  var _blockMenu = require("@atlaskit/editor-common/block-menu");
10
- var _HeadingMenuItem = require("./HeadingMenuItem");
11
- var _ParagraphMenuItem = require("./ParagraphMenuItem");
12
- var _QuoteMenuItem = require("./QuoteMenuItem");
13
- var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockTypeComponents() {
8
+ var _HeadingBlockMenuItem = require("./HeadingBlockMenuItem");
9
+ var _ParagraphBlockMenuItem = require("./ParagraphBlockMenuItem");
10
+ var _QuoteBlockMenuItem = require("./QuoteBlockMenuItem");
11
+ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockTypeComponents(api) {
14
12
  return [{
15
13
  type: 'block-menu-item',
16
14
  key: _blockMenu.FORMAT_HEADING_1_MENU_ITEM.key,
@@ -19,11 +17,10 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
19
17
  key: 'nested-menu-format-section-primary',
20
18
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_HEADING_1_MENU_ITEM.key]
21
19
  },
22
- component: function component() {
23
- return /*#__PURE__*/_react.default.createElement(_HeadingMenuItem.HeadingMenuItem, {
24
- level: 1
25
- });
26
- }
20
+ component: (0, _HeadingBlockMenuItem.createHeadingBlockMenuItem)({
21
+ level: 1,
22
+ api: api
23
+ })
27
24
  }, {
28
25
  type: 'block-menu-item',
29
26
  key: _blockMenu.FORMAT_HEADING_2_MENU_ITEM.key,
@@ -32,11 +29,10 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
32
29
  key: 'nested-menu-format-section-primary',
33
30
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_HEADING_2_MENU_ITEM.key]
34
31
  },
35
- component: function component() {
36
- return /*#__PURE__*/_react.default.createElement(_HeadingMenuItem.HeadingMenuItem, {
37
- level: 2
38
- });
39
- }
32
+ component: (0, _HeadingBlockMenuItem.createHeadingBlockMenuItem)({
33
+ level: 2,
34
+ api: api
35
+ })
40
36
  }, {
41
37
  type: 'block-menu-item',
42
38
  key: _blockMenu.FORMAT_HEADING_3_MENU_ITEM.key,
@@ -45,11 +41,10 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
45
41
  key: 'nested-menu-format-section-primary',
46
42
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_HEADING_3_MENU_ITEM.key]
47
43
  },
48
- component: function component() {
49
- return /*#__PURE__*/_react.default.createElement(_HeadingMenuItem.HeadingMenuItem, {
50
- level: 3
51
- });
52
- }
44
+ component: (0, _HeadingBlockMenuItem.createHeadingBlockMenuItem)({
45
+ level: 3,
46
+ api: api
47
+ })
53
48
  }, {
54
49
  type: 'block-menu-item',
55
50
  key: _blockMenu.FORMAT_HEADING_4_MENU_ITEM.key,
@@ -58,11 +53,10 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
58
53
  key: 'nested-menu-format-section-primary',
59
54
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_HEADING_4_MENU_ITEM.key]
60
55
  },
61
- component: function component() {
62
- return /*#__PURE__*/_react.default.createElement(_HeadingMenuItem.HeadingMenuItem, {
63
- level: 4
64
- });
65
- }
56
+ component: (0, _HeadingBlockMenuItem.createHeadingBlockMenuItem)({
57
+ level: 4,
58
+ api: api
59
+ })
66
60
  }, {
67
61
  type: 'block-menu-item',
68
62
  key: _blockMenu.FORMAT_HEADING_5_MENU_ITEM.key,
@@ -71,11 +65,10 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
71
65
  key: 'nested-menu-format-section-primary',
72
66
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_HEADING_5_MENU_ITEM.key]
73
67
  },
74
- component: function component() {
75
- return /*#__PURE__*/_react.default.createElement(_HeadingMenuItem.HeadingMenuItem, {
76
- level: 5
77
- });
78
- }
68
+ component: (0, _HeadingBlockMenuItem.createHeadingBlockMenuItem)({
69
+ level: 5,
70
+ api: api
71
+ })
79
72
  }, {
80
73
  type: 'block-menu-item',
81
74
  key: _blockMenu.FORMAT_HEADING_6_MENU_ITEM.key,
@@ -84,11 +77,10 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
84
77
  key: 'nested-menu-format-section-primary',
85
78
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_HEADING_6_MENU_ITEM.key]
86
79
  },
87
- component: function component() {
88
- return /*#__PURE__*/_react.default.createElement(_HeadingMenuItem.HeadingMenuItem, {
89
- level: 6
90
- });
91
- }
80
+ component: (0, _HeadingBlockMenuItem.createHeadingBlockMenuItem)({
81
+ level: 6,
82
+ api: api
83
+ })
92
84
  }, {
93
85
  type: 'block-menu-item',
94
86
  key: _blockMenu.FORMAT_PARAGRAPH_MENU_ITEM.key,
@@ -97,9 +89,9 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
97
89
  key: 'nested-menu-format-section-primary',
98
90
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_PARAGRAPH_MENU_ITEM.key]
99
91
  },
100
- component: function component() {
101
- return /*#__PURE__*/_react.default.createElement(_ParagraphMenuItem.ParagraphMenuItem, null);
102
- }
92
+ component: (0, _ParagraphBlockMenuItem.createParagraphBlockMenuItem)({
93
+ api: api
94
+ })
103
95
  }, {
104
96
  type: 'block-menu-item',
105
97
  key: _blockMenu.FORMAT_QUOTE_MENU_ITEM.key,
@@ -108,8 +100,8 @@ var getBlockTypeComponents = exports.getBlockTypeComponents = function getBlockT
108
100
  key: 'nested-menu-format-section-primary',
109
101
  rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_QUOTE_MENU_ITEM.key]
110
102
  },
111
- component: function component() {
112
- return /*#__PURE__*/_react.default.createElement(_QuoteMenuItem.QuoteMenuItem, null);
113
- }
103
+ component: (0, _QuoteBlockMenuItem.createQuoteBlockMenuItem)({
104
+ api: api
105
+ })
114
106
  }];
115
107
  };
@@ -129,7 +129,7 @@ const blockTypePlugin = ({
129
129
  }
130
130
  if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
131
131
  var _api$blockMenu;
132
- api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents(getBlockTypeComponents());
132
+ api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents(getBlockTypeComponents(api));
133
133
  }
134
134
  return {
135
135
  name: 'blockType',
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
6
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
7
+ import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
8
+ import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
9
+ import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
10
+ import TextHeadingSixIcon from '@atlaskit/icon-lab/core/text-heading-six';
11
+ import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
12
+ import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
13
+ import { HEADING_2, HEADING_5, HEADING_1, HEADING_3, HEADING_4, HEADING_6 } from './consts';
14
+ const headingIcons = [TextHeadingOneIcon, TextHeadingTwoIcon, TextHeadingThreeIcon, TextHeadingFourIcon, TextHeadingFiveIcon, TextHeadingSixIcon];
15
+ const headingMessages = [blockTypeMessages.heading1, blockTypeMessages.heading2, blockTypeMessages.heading3, blockTypeMessages.heading4, blockTypeMessages.heading5, blockTypeMessages.heading6];
16
+ const HeadingBlockTypes = [HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6];
17
+ const HeadingBlockMenuItem = ({
18
+ level,
19
+ api
20
+ }) => {
21
+ const {
22
+ formatMessage
23
+ } = useIntl();
24
+ const Icon = headingIcons[level - 1];
25
+ const message = headingMessages[level - 1];
26
+ const currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
27
+ const selection = useSharedPluginStateSelector(api, 'selection.selection');
28
+ const isTextSelection = selection instanceof TextSelection;
29
+ const isHeading = isTextSelection && currentBlockType && HeadingBlockTypes.includes(currentBlockType);
30
+ const currentHeadingLevel = isHeading ? currentBlockType.level : undefined;
31
+ const isSelected = isHeading && currentHeadingLevel === level;
32
+ const handleClick = () => {
33
+ if (!selection) {
34
+ return;
35
+ }
36
+ if (!isSelected) {
37
+ var _api$blockMenu;
38
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(`heading${level}`));
39
+ }
40
+ };
41
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
42
+ onClick: handleClick,
43
+ isSelected: isSelected,
44
+ elemBefore: /*#__PURE__*/React.createElement(Icon, {
45
+ label: ""
46
+ })
47
+ }, formatMessage(message));
48
+ };
49
+ export const createHeadingBlockMenuItem = ({
50
+ level,
51
+ api
52
+ }) => {
53
+ return () => /*#__PURE__*/React.createElement(HeadingBlockMenuItem, {
54
+ level: level,
55
+ api: api
56
+ });
57
+ };
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockMenuMessages } from '@atlaskit/editor-common/messages';
4
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
6
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
7
+ import TextParagraphIcon from '@atlaskit/icon-lab/core/text-paragraph';
8
+ import { NORMAL_TEXT } from './consts';
9
+ const ParagraphBlockMenuItem = ({
10
+ api
11
+ }) => {
12
+ const {
13
+ formatMessage
14
+ } = useIntl();
15
+ const currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
16
+ const bulletListActive = useSharedPluginStateSelector(api, 'list.bulletListActive');
17
+ const orderedListActive = useSharedPluginStateSelector(api, 'list.orderedListActive');
18
+ const selection = useSharedPluginStateSelector(api, 'selection.selection');
19
+ const isTextSelection = selection instanceof TextSelection;
20
+ const isParagraph = isTextSelection && currentBlockType && currentBlockType === NORMAL_TEXT && !bulletListActive && !orderedListActive;
21
+ const handleClick = () => {
22
+ if (!selection) {
23
+ return;
24
+ }
25
+ if (!isParagraph) {
26
+ var _api$blockMenu;
27
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(`paragraph`));
28
+ }
29
+ };
30
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
31
+ onClick: handleClick,
32
+ isSelected: isParagraph,
33
+ elemBefore: /*#__PURE__*/React.createElement(TextParagraphIcon, {
34
+ label: ""
35
+ })
36
+ }, formatMessage(blockMenuMessages.paragraph));
37
+ };
38
+ export const createParagraphBlockMenuItem = ({
39
+ api
40
+ }) => {
41
+ return () => /*#__PURE__*/React.createElement(ParagraphBlockMenuItem, {
42
+ api: api
43
+ });
44
+ };
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
6
+ import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
7
+ import { BLOCK_QUOTE } from './consts';
8
+ const QuoteBlockMenuItem = ({
9
+ api
10
+ }) => {
11
+ const {
12
+ formatMessage
13
+ } = useIntl();
14
+ const currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
15
+ const isBlockQuote = currentBlockType && currentBlockType === BLOCK_QUOTE;
16
+ const handleClick = () => {
17
+ if (!isBlockQuote) {
18
+ var _api$blockMenu;
19
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(`blockquote`));
20
+ }
21
+ };
22
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
23
+ onClick: handleClick,
24
+ isSelected: isBlockQuote,
25
+ elemBefore: /*#__PURE__*/React.createElement(QuotationMarkIcon, {
26
+ label: ""
27
+ })
28
+ }, formatMessage(blockTypeMessages.blockquote));
29
+ };
30
+ export const createQuoteBlockMenuItem = ({
31
+ api
32
+ }) => {
33
+ return () => /*#__PURE__*/React.createElement(QuoteBlockMenuItem, {
34
+ api: api
35
+ });
36
+ };
@@ -1,9 +1,8 @@
1
- import React from 'react';
2
1
  import { FORMAT_HEADING_1_MENU_ITEM, FORMAT_HEADING_2_MENU_ITEM, FORMAT_HEADING_3_MENU_ITEM, FORMAT_HEADING_4_MENU_ITEM, FORMAT_HEADING_5_MENU_ITEM, FORMAT_HEADING_6_MENU_ITEM, FORMAT_NESTED_MENU_RANK, FORMAT_PARAGRAPH_MENU_ITEM, FORMAT_QUOTE_MENU_ITEM } from '@atlaskit/editor-common/block-menu';
3
- import { HeadingMenuItem } from './HeadingMenuItem';
4
- import { ParagraphMenuItem } from './ParagraphMenuItem';
5
- import { QuoteMenuItem } from './QuoteMenuItem';
6
- export const getBlockTypeComponents = () => {
2
+ import { createHeadingBlockMenuItem } from './HeadingBlockMenuItem';
3
+ import { createParagraphBlockMenuItem } from './ParagraphBlockMenuItem';
4
+ import { createQuoteBlockMenuItem } from './QuoteBlockMenuItem';
5
+ export const getBlockTypeComponents = api => {
7
6
  return [{
8
7
  type: 'block-menu-item',
9
8
  key: FORMAT_HEADING_1_MENU_ITEM.key,
@@ -12,8 +11,9 @@ export const getBlockTypeComponents = () => {
12
11
  key: 'nested-menu-format-section-primary',
13
12
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_1_MENU_ITEM.key]
14
13
  },
15
- component: () => /*#__PURE__*/React.createElement(HeadingMenuItem, {
16
- level: 1
14
+ component: createHeadingBlockMenuItem({
15
+ level: 1,
16
+ api
17
17
  })
18
18
  }, {
19
19
  type: 'block-menu-item',
@@ -23,8 +23,9 @@ export const getBlockTypeComponents = () => {
23
23
  key: 'nested-menu-format-section-primary',
24
24
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_2_MENU_ITEM.key]
25
25
  },
26
- component: () => /*#__PURE__*/React.createElement(HeadingMenuItem, {
27
- level: 2
26
+ component: createHeadingBlockMenuItem({
27
+ level: 2,
28
+ api
28
29
  })
29
30
  }, {
30
31
  type: 'block-menu-item',
@@ -34,8 +35,9 @@ export const getBlockTypeComponents = () => {
34
35
  key: 'nested-menu-format-section-primary',
35
36
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_3_MENU_ITEM.key]
36
37
  },
37
- component: () => /*#__PURE__*/React.createElement(HeadingMenuItem, {
38
- level: 3
38
+ component: createHeadingBlockMenuItem({
39
+ level: 3,
40
+ api
39
41
  })
40
42
  }, {
41
43
  type: 'block-menu-item',
@@ -45,8 +47,9 @@ export const getBlockTypeComponents = () => {
45
47
  key: 'nested-menu-format-section-primary',
46
48
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_4_MENU_ITEM.key]
47
49
  },
48
- component: () => /*#__PURE__*/React.createElement(HeadingMenuItem, {
49
- level: 4
50
+ component: createHeadingBlockMenuItem({
51
+ level: 4,
52
+ api
50
53
  })
51
54
  }, {
52
55
  type: 'block-menu-item',
@@ -56,8 +59,9 @@ export const getBlockTypeComponents = () => {
56
59
  key: 'nested-menu-format-section-primary',
57
60
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_5_MENU_ITEM.key]
58
61
  },
59
- component: () => /*#__PURE__*/React.createElement(HeadingMenuItem, {
60
- level: 5
62
+ component: createHeadingBlockMenuItem({
63
+ level: 5,
64
+ api
61
65
  })
62
66
  }, {
63
67
  type: 'block-menu-item',
@@ -67,8 +71,9 @@ export const getBlockTypeComponents = () => {
67
71
  key: 'nested-menu-format-section-primary',
68
72
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_6_MENU_ITEM.key]
69
73
  },
70
- component: () => /*#__PURE__*/React.createElement(HeadingMenuItem, {
71
- level: 6
74
+ component: createHeadingBlockMenuItem({
75
+ level: 6,
76
+ api
72
77
  })
73
78
  }, {
74
79
  type: 'block-menu-item',
@@ -78,7 +83,9 @@ export const getBlockTypeComponents = () => {
78
83
  key: 'nested-menu-format-section-primary',
79
84
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_PARAGRAPH_MENU_ITEM.key]
80
85
  },
81
- component: () => /*#__PURE__*/React.createElement(ParagraphMenuItem, null)
86
+ component: createParagraphBlockMenuItem({
87
+ api
88
+ })
82
89
  }, {
83
90
  type: 'block-menu-item',
84
91
  key: FORMAT_QUOTE_MENU_ITEM.key,
@@ -87,6 +94,8 @@ export const getBlockTypeComponents = () => {
87
94
  key: 'nested-menu-format-section-primary',
88
95
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_QUOTE_MENU_ITEM.key]
89
96
  },
90
- component: () => /*#__PURE__*/React.createElement(QuoteMenuItem, null)
97
+ component: createQuoteBlockMenuItem({
98
+ api
99
+ })
91
100
  }];
92
101
  };
@@ -133,7 +133,7 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
133
133
  }
134
134
  if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
135
135
  var _api$blockMenu;
136
- api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents(getBlockTypeComponents());
136
+ api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents(getBlockTypeComponents(api));
137
137
  }
138
138
  return {
139
139
  name: 'blockType',
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
6
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
7
+ import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
8
+ import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
9
+ import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
10
+ import TextHeadingSixIcon from '@atlaskit/icon-lab/core/text-heading-six';
11
+ import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
12
+ import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
13
+ import { HEADING_2, HEADING_5, HEADING_1, HEADING_3, HEADING_4, HEADING_6 } from './consts';
14
+ var headingIcons = [TextHeadingOneIcon, TextHeadingTwoIcon, TextHeadingThreeIcon, TextHeadingFourIcon, TextHeadingFiveIcon, TextHeadingSixIcon];
15
+ var headingMessages = [blockTypeMessages.heading1, blockTypeMessages.heading2, blockTypeMessages.heading3, blockTypeMessages.heading4, blockTypeMessages.heading5, blockTypeMessages.heading6];
16
+ var HeadingBlockTypes = [HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6];
17
+ var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
18
+ var level = _ref.level,
19
+ api = _ref.api;
20
+ var _useIntl = useIntl(),
21
+ formatMessage = _useIntl.formatMessage;
22
+ var Icon = headingIcons[level - 1];
23
+ var message = headingMessages[level - 1];
24
+ var currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
25
+ var selection = useSharedPluginStateSelector(api, 'selection.selection');
26
+ var isTextSelection = selection instanceof TextSelection;
27
+ var isHeading = isTextSelection && currentBlockType && HeadingBlockTypes.includes(currentBlockType);
28
+ var currentHeadingLevel = isHeading ? currentBlockType.level : undefined;
29
+ var isSelected = isHeading && currentHeadingLevel === level;
30
+ var handleClick = function handleClick() {
31
+ if (!selection) {
32
+ return;
33
+ }
34
+ if (!isSelected) {
35
+ var _api$blockMenu;
36
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode("heading".concat(level)));
37
+ }
38
+ };
39
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
40
+ onClick: handleClick,
41
+ isSelected: isSelected,
42
+ elemBefore: /*#__PURE__*/React.createElement(Icon, {
43
+ label: ""
44
+ })
45
+ }, formatMessage(message));
46
+ };
47
+ export var createHeadingBlockMenuItem = function createHeadingBlockMenuItem(_ref2) {
48
+ var level = _ref2.level,
49
+ api = _ref2.api;
50
+ return function () {
51
+ return /*#__PURE__*/React.createElement(HeadingBlockMenuItem, {
52
+ level: level,
53
+ api: api
54
+ });
55
+ };
56
+ };
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockMenuMessages } from '@atlaskit/editor-common/messages';
4
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
6
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
7
+ import TextParagraphIcon from '@atlaskit/icon-lab/core/text-paragraph';
8
+ import { NORMAL_TEXT } from './consts';
9
+ var ParagraphBlockMenuItem = function ParagraphBlockMenuItem(_ref) {
10
+ var api = _ref.api;
11
+ var _useIntl = useIntl(),
12
+ formatMessage = _useIntl.formatMessage;
13
+ var currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
14
+ var bulletListActive = useSharedPluginStateSelector(api, 'list.bulletListActive');
15
+ var orderedListActive = useSharedPluginStateSelector(api, 'list.orderedListActive');
16
+ var selection = useSharedPluginStateSelector(api, 'selection.selection');
17
+ var isTextSelection = selection instanceof TextSelection;
18
+ var isParagraph = isTextSelection && currentBlockType && currentBlockType === NORMAL_TEXT && !bulletListActive && !orderedListActive;
19
+ var handleClick = function handleClick() {
20
+ if (!selection) {
21
+ return;
22
+ }
23
+ if (!isParagraph) {
24
+ var _api$blockMenu;
25
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode("paragraph"));
26
+ }
27
+ };
28
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
29
+ onClick: handleClick,
30
+ isSelected: isParagraph,
31
+ elemBefore: /*#__PURE__*/React.createElement(TextParagraphIcon, {
32
+ label: ""
33
+ })
34
+ }, formatMessage(blockMenuMessages.paragraph));
35
+ };
36
+ export var createParagraphBlockMenuItem = function createParagraphBlockMenuItem(_ref2) {
37
+ var api = _ref2.api;
38
+ return function () {
39
+ return /*#__PURE__*/React.createElement(ParagraphBlockMenuItem, {
40
+ api: api
41
+ });
42
+ };
43
+ };
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
+ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
+ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
6
+ import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
7
+ import { BLOCK_QUOTE } from './consts';
8
+ var QuoteBlockMenuItem = function QuoteBlockMenuItem(_ref) {
9
+ var api = _ref.api;
10
+ var _useIntl = useIntl(),
11
+ formatMessage = _useIntl.formatMessage;
12
+ var currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
13
+ var isBlockQuote = currentBlockType && currentBlockType === BLOCK_QUOTE;
14
+ var handleClick = function handleClick() {
15
+ if (!isBlockQuote) {
16
+ var _api$blockMenu;
17
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode("blockquote"));
18
+ }
19
+ };
20
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
21
+ onClick: handleClick,
22
+ isSelected: isBlockQuote,
23
+ elemBefore: /*#__PURE__*/React.createElement(QuotationMarkIcon, {
24
+ label: ""
25
+ })
26
+ }, formatMessage(blockTypeMessages.blockquote));
27
+ };
28
+ export var createQuoteBlockMenuItem = function createQuoteBlockMenuItem(_ref2) {
29
+ var api = _ref2.api;
30
+ return function () {
31
+ return /*#__PURE__*/React.createElement(QuoteBlockMenuItem, {
32
+ api: api
33
+ });
34
+ };
35
+ };
@@ -1,9 +1,8 @@
1
- import React from 'react';
2
1
  import { FORMAT_HEADING_1_MENU_ITEM, FORMAT_HEADING_2_MENU_ITEM, FORMAT_HEADING_3_MENU_ITEM, FORMAT_HEADING_4_MENU_ITEM, FORMAT_HEADING_5_MENU_ITEM, FORMAT_HEADING_6_MENU_ITEM, FORMAT_NESTED_MENU_RANK, FORMAT_PARAGRAPH_MENU_ITEM, FORMAT_QUOTE_MENU_ITEM } from '@atlaskit/editor-common/block-menu';
3
- import { HeadingMenuItem } from './HeadingMenuItem';
4
- import { ParagraphMenuItem } from './ParagraphMenuItem';
5
- import { QuoteMenuItem } from './QuoteMenuItem';
6
- export var getBlockTypeComponents = function getBlockTypeComponents() {
2
+ import { createHeadingBlockMenuItem } from './HeadingBlockMenuItem';
3
+ import { createParagraphBlockMenuItem } from './ParagraphBlockMenuItem';
4
+ import { createQuoteBlockMenuItem } from './QuoteBlockMenuItem';
5
+ export var getBlockTypeComponents = function getBlockTypeComponents(api) {
7
6
  return [{
8
7
  type: 'block-menu-item',
9
8
  key: FORMAT_HEADING_1_MENU_ITEM.key,
@@ -12,11 +11,10 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
12
11
  key: 'nested-menu-format-section-primary',
13
12
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_1_MENU_ITEM.key]
14
13
  },
15
- component: function component() {
16
- return /*#__PURE__*/React.createElement(HeadingMenuItem, {
17
- level: 1
18
- });
19
- }
14
+ component: createHeadingBlockMenuItem({
15
+ level: 1,
16
+ api: api
17
+ })
20
18
  }, {
21
19
  type: 'block-menu-item',
22
20
  key: FORMAT_HEADING_2_MENU_ITEM.key,
@@ -25,11 +23,10 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
25
23
  key: 'nested-menu-format-section-primary',
26
24
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_2_MENU_ITEM.key]
27
25
  },
28
- component: function component() {
29
- return /*#__PURE__*/React.createElement(HeadingMenuItem, {
30
- level: 2
31
- });
32
- }
26
+ component: createHeadingBlockMenuItem({
27
+ level: 2,
28
+ api: api
29
+ })
33
30
  }, {
34
31
  type: 'block-menu-item',
35
32
  key: FORMAT_HEADING_3_MENU_ITEM.key,
@@ -38,11 +35,10 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
38
35
  key: 'nested-menu-format-section-primary',
39
36
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_3_MENU_ITEM.key]
40
37
  },
41
- component: function component() {
42
- return /*#__PURE__*/React.createElement(HeadingMenuItem, {
43
- level: 3
44
- });
45
- }
38
+ component: createHeadingBlockMenuItem({
39
+ level: 3,
40
+ api: api
41
+ })
46
42
  }, {
47
43
  type: 'block-menu-item',
48
44
  key: FORMAT_HEADING_4_MENU_ITEM.key,
@@ -51,11 +47,10 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
51
47
  key: 'nested-menu-format-section-primary',
52
48
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_4_MENU_ITEM.key]
53
49
  },
54
- component: function component() {
55
- return /*#__PURE__*/React.createElement(HeadingMenuItem, {
56
- level: 4
57
- });
58
- }
50
+ component: createHeadingBlockMenuItem({
51
+ level: 4,
52
+ api: api
53
+ })
59
54
  }, {
60
55
  type: 'block-menu-item',
61
56
  key: FORMAT_HEADING_5_MENU_ITEM.key,
@@ -64,11 +59,10 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
64
59
  key: 'nested-menu-format-section-primary',
65
60
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_5_MENU_ITEM.key]
66
61
  },
67
- component: function component() {
68
- return /*#__PURE__*/React.createElement(HeadingMenuItem, {
69
- level: 5
70
- });
71
- }
62
+ component: createHeadingBlockMenuItem({
63
+ level: 5,
64
+ api: api
65
+ })
72
66
  }, {
73
67
  type: 'block-menu-item',
74
68
  key: FORMAT_HEADING_6_MENU_ITEM.key,
@@ -77,11 +71,10 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
77
71
  key: 'nested-menu-format-section-primary',
78
72
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_HEADING_6_MENU_ITEM.key]
79
73
  },
80
- component: function component() {
81
- return /*#__PURE__*/React.createElement(HeadingMenuItem, {
82
- level: 6
83
- });
84
- }
74
+ component: createHeadingBlockMenuItem({
75
+ level: 6,
76
+ api: api
77
+ })
85
78
  }, {
86
79
  type: 'block-menu-item',
87
80
  key: FORMAT_PARAGRAPH_MENU_ITEM.key,
@@ -90,9 +83,9 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
90
83
  key: 'nested-menu-format-section-primary',
91
84
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_PARAGRAPH_MENU_ITEM.key]
92
85
  },
93
- component: function component() {
94
- return /*#__PURE__*/React.createElement(ParagraphMenuItem, null);
95
- }
86
+ component: createParagraphBlockMenuItem({
87
+ api: api
88
+ })
96
89
  }, {
97
90
  type: 'block-menu-item',
98
91
  key: FORMAT_QUOTE_MENU_ITEM.key,
@@ -101,8 +94,8 @@ export var getBlockTypeComponents = function getBlockTypeComponents() {
101
94
  key: 'nested-menu-format-section-primary',
102
95
  rank: FORMAT_NESTED_MENU_RANK[FORMAT_QUOTE_MENU_ITEM.key]
103
96
  },
104
- component: function component() {
105
- return /*#__PURE__*/React.createElement(QuoteMenuItem, null);
106
- }
97
+ component: createQuoteBlockMenuItem({
98
+ api: api
99
+ })
107
100
  }];
108
101
  };
@@ -1,7 +1,9 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
4
+ import type { ListPlugin } from '@atlaskit/editor-plugin-list';
4
5
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
6
+ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
5
7
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
6
8
  import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
7
9
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
@@ -24,7 +26,9 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
24
26
  OptionalPlugin<SelectionToolbarPlugin>,
25
27
  OptionalPlugin<UserPreferencesPlugin>,
26
28
  OptionalPlugin<ToolbarPlugin>,
27
- OptionalPlugin<BlockMenuPlugin>
29
+ OptionalPlugin<BlockMenuPlugin>,
30
+ OptionalPlugin<ListPlugin>,
31
+ OptionalPlugin<SelectionPlugin>
28
32
  ];
29
33
  pluginConfiguration: BlockTypePluginOptions | undefined;
30
34
  sharedState: BlockTypeState | undefined;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ type HeadingBlockMenuItemProps = {
5
+ api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
+ level: 1 | 2 | 3 | 4 | 5 | 6;
7
+ };
8
+ export declare const createHeadingBlockMenuItem: ({ level, api }: HeadingBlockMenuItemProps) => () => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ type ParagraphBlockMenuItemProps = {
5
+ api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
+ };
7
+ export declare const createParagraphBlockMenuItem: ({ api }: ParagraphBlockMenuItemProps) => () => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ type QuoteBlockMenuItemProps = {
5
+ api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
+ };
7
+ export declare const createQuoteBlockMenuItem: ({ api }: QuoteBlockMenuItemProps) => () => React.JSX.Element;
8
+ export {};
@@ -1,2 +1,4 @@
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
2
  import type { RegisterBlockMenuComponent } from '@atlaskit/editor-plugin-block-menu';
2
- export declare const getBlockTypeComponents: () => RegisterBlockMenuComponent[];
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ export declare const getBlockTypeComponents: (api: ExtractInjectionAPI<BlockTypePlugin> | undefined) => RegisterBlockMenuComponent[];
@@ -1,7 +1,9 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
4
+ import type { ListPlugin } from '@atlaskit/editor-plugin-list';
4
5
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
6
+ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
5
7
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
6
8
  import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
7
9
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
@@ -24,7 +26,9 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
24
26
  OptionalPlugin<SelectionToolbarPlugin>,
25
27
  OptionalPlugin<UserPreferencesPlugin>,
26
28
  OptionalPlugin<ToolbarPlugin>,
27
- OptionalPlugin<BlockMenuPlugin>
29
+ OptionalPlugin<BlockMenuPlugin>,
30
+ OptionalPlugin<ListPlugin>,
31
+ OptionalPlugin<SelectionPlugin>
28
32
  ];
29
33
  pluginConfiguration: BlockTypePluginOptions | undefined;
30
34
  sharedState: BlockTypeState | undefined;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ type HeadingBlockMenuItemProps = {
5
+ api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
+ level: 1 | 2 | 3 | 4 | 5 | 6;
7
+ };
8
+ export declare const createHeadingBlockMenuItem: ({ level, api }: HeadingBlockMenuItemProps) => () => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ type ParagraphBlockMenuItemProps = {
5
+ api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
+ };
7
+ export declare const createParagraphBlockMenuItem: ({ api }: ParagraphBlockMenuItemProps) => () => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ type QuoteBlockMenuItemProps = {
5
+ api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
+ };
7
+ export declare const createQuoteBlockMenuItem: ({ api }: QuoteBlockMenuItemProps) => () => React.JSX.Element;
8
+ export {};
@@ -1,2 +1,4 @@
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
2
  import type { RegisterBlockMenuComponent } from '@atlaskit/editor-plugin-block-menu';
2
- export declare const getBlockTypeComponents: () => RegisterBlockMenuComponent[];
3
+ import type { BlockTypePlugin } from '../blockTypePluginType';
4
+ export declare const getBlockTypeComponents: (api: ExtractInjectionAPI<BlockTypePlugin> | undefined) => RegisterBlockMenuComponent[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "6.2.18",
3
+ "version": "6.2.19",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,8 +32,10 @@
32
32
  "@atlaskit/adf-schema": "^50.2.3",
33
33
  "@atlaskit/css": "^0.12.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
35
- "@atlaskit/editor-plugin-block-menu": "^0.0.19",
35
+ "@atlaskit/editor-plugin-block-menu": "^0.0.20",
36
+ "@atlaskit/editor-plugin-list": "^5.1.0",
36
37
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
38
+ "@atlaskit/editor-plugin-selection": "^3.2.0",
37
39
  "@atlaskit/editor-plugin-selection-toolbar": "^4.3.0",
38
40
  "@atlaskit/editor-plugin-toolbar": "^0.4.0",
39
41
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.HeadingMenuItem = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _reactIntlNext = require("react-intl-next");
10
- var _messages = require("@atlaskit/editor-common/messages");
11
- var _editorToolbar = require("@atlaskit/editor-toolbar");
12
- var _textHeadingFive = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-five"));
13
- var _textHeadingFour = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-four"));
14
- var _textHeadingOne = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-one"));
15
- var _textHeadingSix = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-six"));
16
- var _textHeadingThree = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-three"));
17
- var _textHeadingTwo = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-two"));
18
- var headingIcons = [_textHeadingOne.default, _textHeadingTwo.default, _textHeadingThree.default, _textHeadingFour.default, _textHeadingFive.default, _textHeadingSix.default];
19
- var headingMessages = [_messages.blockTypeMessages.heading1, _messages.blockTypeMessages.heading2, _messages.blockTypeMessages.heading3, _messages.blockTypeMessages.heading4, _messages.blockTypeMessages.heading5, _messages.blockTypeMessages.heading6];
20
- var HeadingMenuItem = exports.HeadingMenuItem = function HeadingMenuItem(_ref) {
21
- var level = _ref.level;
22
- var _useIntl = (0, _reactIntlNext.useIntl)(),
23
- formatMessage = _useIntl.formatMessage;
24
- var Icon = headingIcons[level - 1];
25
- var message = headingMessages[level - 1];
26
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
27
- elemBefore: /*#__PURE__*/_react.default.createElement(Icon, {
28
- label: formatMessage(message)
29
- })
30
- }, formatMessage(message));
31
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ParagraphMenuItem = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _reactIntlNext = require("react-intl-next");
10
- var _messages = require("@atlaskit/editor-common/messages");
11
- var _editorToolbar = require("@atlaskit/editor-toolbar");
12
- var _textParagraph = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-paragraph"));
13
- var ParagraphMenuItem = exports.ParagraphMenuItem = function ParagraphMenuItem() {
14
- var _useIntl = (0, _reactIntlNext.useIntl)(),
15
- formatMessage = _useIntl.formatMessage;
16
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
17
- elemBefore: /*#__PURE__*/_react.default.createElement(_textParagraph.default, {
18
- label: formatMessage(_messages.blockMenuMessages.paragraph)
19
- })
20
- }, formatMessage(_messages.blockMenuMessages.paragraph));
21
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.QuoteMenuItem = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _reactIntlNext = require("react-intl-next");
10
- var _messages = require("@atlaskit/editor-common/messages");
11
- var _editorToolbar = require("@atlaskit/editor-toolbar");
12
- var _quotationMark = _interopRequireDefault(require("@atlaskit/icon/core/quotation-mark"));
13
- var QuoteMenuItem = exports.QuoteMenuItem = function QuoteMenuItem() {
14
- var _useIntl = (0, _reactIntlNext.useIntl)(),
15
- formatMessage = _useIntl.formatMessage;
16
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
17
- elemBefore: /*#__PURE__*/_react.default.createElement(_quotationMark.default, {
18
- label: formatMessage(_messages.blockTypeMessages.blockquote)
19
- })
20
- }, formatMessage(_messages.blockTypeMessages.blockquote));
21
- };
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import { useIntl } from 'react-intl-next';
3
- import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
- import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
- import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
6
- import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
7
- import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
8
- import TextHeadingSixIcon from '@atlaskit/icon-lab/core/text-heading-six';
9
- import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
10
- import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
11
- const headingIcons = [TextHeadingOneIcon, TextHeadingTwoIcon, TextHeadingThreeIcon, TextHeadingFourIcon, TextHeadingFiveIcon, TextHeadingSixIcon];
12
- const headingMessages = [blockTypeMessages.heading1, blockTypeMessages.heading2, blockTypeMessages.heading3, blockTypeMessages.heading4, blockTypeMessages.heading5, blockTypeMessages.heading6];
13
- export const HeadingMenuItem = ({
14
- level
15
- }) => {
16
- const {
17
- formatMessage
18
- } = useIntl();
19
- const Icon = headingIcons[level - 1];
20
- const message = headingMessages[level - 1];
21
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
22
- elemBefore: /*#__PURE__*/React.createElement(Icon, {
23
- label: formatMessage(message)
24
- })
25
- }, formatMessage(message));
26
- };
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { useIntl } from 'react-intl-next';
3
- import { blockMenuMessages } from '@atlaskit/editor-common/messages';
4
- import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
- import TextParagraphIcon from '@atlaskit/icon-lab/core/text-paragraph';
6
- export const ParagraphMenuItem = () => {
7
- const {
8
- formatMessage
9
- } = useIntl();
10
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
11
- elemBefore: /*#__PURE__*/React.createElement(TextParagraphIcon, {
12
- label: formatMessage(blockMenuMessages.paragraph)
13
- })
14
- }, formatMessage(blockMenuMessages.paragraph));
15
- };
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { useIntl } from 'react-intl-next';
3
- import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
- import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
- import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
6
- export const QuoteMenuItem = () => {
7
- const {
8
- formatMessage
9
- } = useIntl();
10
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
11
- elemBefore: /*#__PURE__*/React.createElement(QuotationMarkIcon, {
12
- label: formatMessage(blockTypeMessages.blockquote)
13
- })
14
- }, formatMessage(blockTypeMessages.blockquote));
15
- };
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import { useIntl } from 'react-intl-next';
3
- import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
- import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
- import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
6
- import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
7
- import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
8
- import TextHeadingSixIcon from '@atlaskit/icon-lab/core/text-heading-six';
9
- import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
10
- import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
11
- var headingIcons = [TextHeadingOneIcon, TextHeadingTwoIcon, TextHeadingThreeIcon, TextHeadingFourIcon, TextHeadingFiveIcon, TextHeadingSixIcon];
12
- var headingMessages = [blockTypeMessages.heading1, blockTypeMessages.heading2, blockTypeMessages.heading3, blockTypeMessages.heading4, blockTypeMessages.heading5, blockTypeMessages.heading6];
13
- export var HeadingMenuItem = function HeadingMenuItem(_ref) {
14
- var level = _ref.level;
15
- var _useIntl = useIntl(),
16
- formatMessage = _useIntl.formatMessage;
17
- var Icon = headingIcons[level - 1];
18
- var message = headingMessages[level - 1];
19
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
20
- elemBefore: /*#__PURE__*/React.createElement(Icon, {
21
- label: formatMessage(message)
22
- })
23
- }, formatMessage(message));
24
- };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { useIntl } from 'react-intl-next';
3
- import { blockMenuMessages } from '@atlaskit/editor-common/messages';
4
- import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
- import TextParagraphIcon from '@atlaskit/icon-lab/core/text-paragraph';
6
- export var ParagraphMenuItem = function ParagraphMenuItem() {
7
- var _useIntl = useIntl(),
8
- formatMessage = _useIntl.formatMessage;
9
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
10
- elemBefore: /*#__PURE__*/React.createElement(TextParagraphIcon, {
11
- label: formatMessage(blockMenuMessages.paragraph)
12
- })
13
- }, formatMessage(blockMenuMessages.paragraph));
14
- };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { useIntl } from 'react-intl-next';
3
- import { blockTypeMessages } from '@atlaskit/editor-common/messages';
4
- import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
5
- import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
6
- export var QuoteMenuItem = function QuoteMenuItem() {
7
- var _useIntl = useIntl(),
8
- formatMessage = _useIntl.formatMessage;
9
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
10
- elemBefore: /*#__PURE__*/React.createElement(QuotationMarkIcon, {
11
- label: formatMessage(blockTypeMessages.blockquote)
12
- })
13
- }, formatMessage(blockTypeMessages.blockquote));
14
- };
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type HeadingMenuItemProps = {
3
- level: 1 | 2 | 3 | 4 | 5 | 6;
4
- };
5
- export declare const HeadingMenuItem: ({ level }: HeadingMenuItemProps) => React.JSX.Element;
6
- export {};
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const ParagraphMenuItem: () => React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const QuoteMenuItem: () => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type HeadingMenuItemProps = {
3
- level: 1 | 2 | 3 | 4 | 5 | 6;
4
- };
5
- export declare const HeadingMenuItem: ({ level }: HeadingMenuItemProps) => React.JSX.Element;
6
- export {};
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const ParagraphMenuItem: () => React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const QuoteMenuItem: () => React.JSX.Element;