@atlaskit/editor-plugin-block-type 20.0.3 → 20.0.4
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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 20.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9f8027e06f6f6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9f8027e06f6f6) -
|
|
8
|
+
Use updated slash-command menu icons when platform_editor_slash_command is enabled.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 20.0.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
@@ -10,8 +11,14 @@ var _reactIntl = require("react-intl");
|
|
|
10
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
12
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
|
-
var _assets = require("@atlaskit/editor-common/assets");
|
|
14
14
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
15
|
+
var _quotationMark = _interopRequireDefault(require("@atlaskit/icon/core/quotation-mark"));
|
|
16
|
+
var _textHeadingFive = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-five"));
|
|
17
|
+
var _textHeadingFour = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-four"));
|
|
18
|
+
var _textHeadingOne = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-one"));
|
|
19
|
+
var _textHeadingSix = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-six"));
|
|
20
|
+
var _textHeadingThree = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-three"));
|
|
21
|
+
var _textHeadingTwo = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-two"));
|
|
15
22
|
var _tooltip, _tooltip2, _tooltip3, _tooltip4, _tooltip5, _tooltip6;
|
|
16
23
|
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); }
|
|
17
24
|
var headingQuickInsertMessages = {
|
|
@@ -54,6 +61,38 @@ var getHeadingQuickInsertMessages = exports.getHeadingQuickInsertMessages = func
|
|
|
54
61
|
var getHeadingQuickInsertShortcut = exports.getHeadingQuickInsertShortcut = function getHeadingQuickInsertShortcut(level) {
|
|
55
62
|
return headingQuickInsertShortcuts[level];
|
|
56
63
|
};
|
|
64
|
+
var getBlockTypeQuickInsertIcon = function getBlockTypeQuickInsertIcon(item) {
|
|
65
|
+
switch (item) {
|
|
66
|
+
case 'blockquote':
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_quotationMark.default, {
|
|
68
|
+
label: ""
|
|
69
|
+
});
|
|
70
|
+
case 1:
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_textHeadingOne.default, {
|
|
72
|
+
label: ""
|
|
73
|
+
});
|
|
74
|
+
case 2:
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_textHeadingTwo.default, {
|
|
76
|
+
label: ""
|
|
77
|
+
});
|
|
78
|
+
case 3:
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_textHeadingThree.default, {
|
|
80
|
+
label: ""
|
|
81
|
+
});
|
|
82
|
+
case 4:
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_textHeadingFour.default, {
|
|
84
|
+
label: ""
|
|
85
|
+
});
|
|
86
|
+
case 5:
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_textHeadingFive.default, {
|
|
88
|
+
label: ""
|
|
89
|
+
});
|
|
90
|
+
case 6:
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_textHeadingSix.default, {
|
|
92
|
+
label: ""
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
57
96
|
var BlockTypeQuickInsertMenuItem = exports.BlockTypeQuickInsertMenuItem = function BlockTypeQuickInsertMenuItem(_ref) {
|
|
58
97
|
var api = _ref.api,
|
|
59
98
|
item = _ref.item;
|
|
@@ -98,9 +137,7 @@ var BlockTypeQuickInsertMenuItem = exports.BlockTypeQuickInsertMenuItem = functi
|
|
|
98
137
|
return tr;
|
|
99
138
|
}, [api, isBlockquote, item]);
|
|
100
139
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
101
|
-
iconBefore:
|
|
102
|
-
level: item
|
|
103
|
-
}),
|
|
140
|
+
iconBefore: getBlockTypeQuickInsertIcon(item),
|
|
104
141
|
onSelect: onSelect,
|
|
105
142
|
shortcut: shortcut,
|
|
106
143
|
title: title
|
|
@@ -4,8 +4,14 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { IconHeading, IconQuote } from '@atlaskit/editor-common/assets';
|
|
8
7
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
8
|
+
import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
|
|
9
|
+
import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
|
|
10
|
+
import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
|
|
11
|
+
import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
|
|
12
|
+
import TextHeadingSixIcon from '@atlaskit/icon-lab/core/text-heading-six';
|
|
13
|
+
import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
|
|
14
|
+
import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
|
|
9
15
|
const headingQuickInsertMessages = {
|
|
10
16
|
1: {
|
|
11
17
|
description: messages.heading1Description,
|
|
@@ -42,6 +48,38 @@ const headingQuickInsertShortcuts = {
|
|
|
42
48
|
};
|
|
43
49
|
export const getHeadingQuickInsertMessages = level => headingQuickInsertMessages[level];
|
|
44
50
|
export const getHeadingQuickInsertShortcut = level => headingQuickInsertShortcuts[level];
|
|
51
|
+
const getBlockTypeQuickInsertIcon = item => {
|
|
52
|
+
switch (item) {
|
|
53
|
+
case 'blockquote':
|
|
54
|
+
return /*#__PURE__*/React.createElement(QuotationMarkIcon, {
|
|
55
|
+
label: ""
|
|
56
|
+
});
|
|
57
|
+
case 1:
|
|
58
|
+
return /*#__PURE__*/React.createElement(TextHeadingOneIcon, {
|
|
59
|
+
label: ""
|
|
60
|
+
});
|
|
61
|
+
case 2:
|
|
62
|
+
return /*#__PURE__*/React.createElement(TextHeadingTwoIcon, {
|
|
63
|
+
label: ""
|
|
64
|
+
});
|
|
65
|
+
case 3:
|
|
66
|
+
return /*#__PURE__*/React.createElement(TextHeadingThreeIcon, {
|
|
67
|
+
label: ""
|
|
68
|
+
});
|
|
69
|
+
case 4:
|
|
70
|
+
return /*#__PURE__*/React.createElement(TextHeadingFourIcon, {
|
|
71
|
+
label: ""
|
|
72
|
+
});
|
|
73
|
+
case 5:
|
|
74
|
+
return /*#__PURE__*/React.createElement(TextHeadingFiveIcon, {
|
|
75
|
+
label: ""
|
|
76
|
+
});
|
|
77
|
+
case 6:
|
|
78
|
+
return /*#__PURE__*/React.createElement(TextHeadingSixIcon, {
|
|
79
|
+
label: ""
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
45
83
|
export const BlockTypeQuickInsertMenuItem = ({
|
|
46
84
|
api,
|
|
47
85
|
item
|
|
@@ -89,9 +127,7 @@ export const BlockTypeQuickInsertMenuItem = ({
|
|
|
89
127
|
return tr;
|
|
90
128
|
}, [api, isBlockquote, item]);
|
|
91
129
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
92
|
-
iconBefore:
|
|
93
|
-
level: item
|
|
94
|
-
}),
|
|
130
|
+
iconBefore: getBlockTypeQuickInsertIcon(item),
|
|
95
131
|
onSelect: onSelect,
|
|
96
132
|
shortcut: shortcut,
|
|
97
133
|
title: title
|
|
@@ -4,8 +4,14 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { IconHeading, IconQuote } from '@atlaskit/editor-common/assets';
|
|
8
7
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
8
|
+
import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
|
|
9
|
+
import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
|
|
10
|
+
import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
|
|
11
|
+
import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
|
|
12
|
+
import TextHeadingSixIcon from '@atlaskit/icon-lab/core/text-heading-six';
|
|
13
|
+
import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
|
|
14
|
+
import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
|
|
9
15
|
var headingQuickInsertMessages = {
|
|
10
16
|
1: {
|
|
11
17
|
description: messages.heading1Description,
|
|
@@ -46,6 +52,38 @@ export var getHeadingQuickInsertMessages = function getHeadingQuickInsertMessage
|
|
|
46
52
|
export var getHeadingQuickInsertShortcut = function getHeadingQuickInsertShortcut(level) {
|
|
47
53
|
return headingQuickInsertShortcuts[level];
|
|
48
54
|
};
|
|
55
|
+
var getBlockTypeQuickInsertIcon = function getBlockTypeQuickInsertIcon(item) {
|
|
56
|
+
switch (item) {
|
|
57
|
+
case 'blockquote':
|
|
58
|
+
return /*#__PURE__*/React.createElement(QuotationMarkIcon, {
|
|
59
|
+
label: ""
|
|
60
|
+
});
|
|
61
|
+
case 1:
|
|
62
|
+
return /*#__PURE__*/React.createElement(TextHeadingOneIcon, {
|
|
63
|
+
label: ""
|
|
64
|
+
});
|
|
65
|
+
case 2:
|
|
66
|
+
return /*#__PURE__*/React.createElement(TextHeadingTwoIcon, {
|
|
67
|
+
label: ""
|
|
68
|
+
});
|
|
69
|
+
case 3:
|
|
70
|
+
return /*#__PURE__*/React.createElement(TextHeadingThreeIcon, {
|
|
71
|
+
label: ""
|
|
72
|
+
});
|
|
73
|
+
case 4:
|
|
74
|
+
return /*#__PURE__*/React.createElement(TextHeadingFourIcon, {
|
|
75
|
+
label: ""
|
|
76
|
+
});
|
|
77
|
+
case 5:
|
|
78
|
+
return /*#__PURE__*/React.createElement(TextHeadingFiveIcon, {
|
|
79
|
+
label: ""
|
|
80
|
+
});
|
|
81
|
+
case 6:
|
|
82
|
+
return /*#__PURE__*/React.createElement(TextHeadingSixIcon, {
|
|
83
|
+
label: ""
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
49
87
|
export var BlockTypeQuickInsertMenuItem = function BlockTypeQuickInsertMenuItem(_ref) {
|
|
50
88
|
var api = _ref.api,
|
|
51
89
|
item = _ref.item;
|
|
@@ -90,9 +128,7 @@ export var BlockTypeQuickInsertMenuItem = function BlockTypeQuickInsertMenuItem(
|
|
|
90
128
|
return tr;
|
|
91
129
|
}, [api, isBlockquote, item]);
|
|
92
130
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
93
|
-
iconBefore:
|
|
94
|
-
level: item
|
|
95
|
-
}),
|
|
131
|
+
iconBefore: getBlockTypeQuickInsertIcon(item),
|
|
96
132
|
onSelect: onSelect,
|
|
97
133
|
shortcut: shortcut,
|
|
98
134
|
title: title
|