@atlaskit/editor-core 189.4.0 → 189.4.2
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/plugins/index.js +0 -14
- package/dist/cjs/presets/universal.js +4 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +7 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/presets/universal.js +3 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +7 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/presets/universal.js +3 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +7 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/package.json +11 -5
- package/dist/cjs/plugins/insert-block/index.js +0 -165
- package/dist/cjs/plugins/insert-block/types.js +0 -5
- package/dist/cjs/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -152
- package/dist/cjs/plugins/insert-block/ui/ElementBrowser/types.js +0 -5
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -42
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -42
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -66
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -217
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -49
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -565
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -250
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -12
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -20
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -30
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -11
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -5
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +0 -91
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +0 -56
- package/dist/cjs/plugins/toolbar-lists-indentation/types.js +0 -5
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +0 -135
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +0 -168
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +0 -63
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +0 -53
- package/dist/es2019/plugins/insert-block/index.js +0 -159
- package/dist/es2019/plugins/insert-block/types.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -150
- package/dist/es2019/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -198
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -37
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -558
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -201
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -8
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -22
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -16
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +0 -86
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +0 -53
- package/dist/es2019/plugins/toolbar-lists-indentation/types.js +0 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +0 -123
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +0 -158
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +0 -58
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +0 -46
- package/dist/esm/plugins/insert-block/index.js +0 -158
- package/dist/esm/plugins/insert-block/types.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -146
- package/dist/esm/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -210
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -41
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -560
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -243
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -13
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -24
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -4
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +0 -83
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +0 -50
- package/dist/esm/plugins/toolbar-lists-indentation/types.js +0 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +0 -124
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +0 -161
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +0 -56
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +0 -47
- package/dist/types/plugins/insert-block/index.d.ts +0 -16
- package/dist/types/plugins/insert-block/types.d.ts +0 -45
- package/dist/types/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
- package/dist/types/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -39
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +0 -33
- package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +0 -19
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +0 -20
- package/dist/types/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +0 -4
- package/dist/types/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +0 -9
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +0 -26
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +0 -9
- package/dist/types-ts4.5/plugins/insert-block/index.d.ts +0 -16
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +0 -45
- package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
- package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -42
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +0 -33
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +0 -19
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/types.d.ts +0 -20
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +0 -4
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +0 -9
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +0 -26
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +0 -9
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import memoize from 'lodash/memoize';
|
|
7
|
-
import memoizeOne from 'memoize-one';
|
|
8
|
-
import { messages } from './messages';
|
|
9
|
-
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
10
|
-
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
11
|
-
import { sortItems } from './sort-items';
|
|
12
|
-
import { action, link, media, mention, emoji, table, layout, codeblock, panel, blockquote, decision, horizontalrule, expand, date, placeholder, status, more, imageUpload } from './item';
|
|
13
|
-
import { shallowEquals } from './shallow-equals';
|
|
14
|
-
var buttonToItem = memoize(function (button) {
|
|
15
|
-
return _objectSpread(_objectSpread({}, button), {}, {
|
|
16
|
-
title: /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
17
|
-
description: button.content,
|
|
18
|
-
shortcutOverride: button.shortcut
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
var buttonToDropdownItem = memoizeOne(function (title) {
|
|
23
|
-
return memoize(function (button) {
|
|
24
|
-
return _objectSpread(_objectSpread({}, button), {}, {
|
|
25
|
-
title: /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
26
|
-
description: title,
|
|
27
|
-
shortcutOverride: "/"
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
var createInsertBlockItems = function createInsertBlockItems(config) {
|
|
33
|
-
var isTypeAheadAllowed = config.isTypeAheadAllowed,
|
|
34
|
-
tableSupported = config.tableSupported,
|
|
35
|
-
mediaUploadsEnabled = config.mediaUploadsEnabled,
|
|
36
|
-
mediaSupported = config.mediaSupported,
|
|
37
|
-
imageUploadSupported = config.imageUploadSupported,
|
|
38
|
-
imageUploadEnabled = config.imageUploadEnabled,
|
|
39
|
-
mentionsSupported = config.mentionsSupported,
|
|
40
|
-
mentionsDisabled = config.mentionsDisabled,
|
|
41
|
-
availableWrapperBlockTypes = config.availableWrapperBlockTypes,
|
|
42
|
-
actionSupported = config.actionSupported,
|
|
43
|
-
decisionSupported = config.decisionSupported,
|
|
44
|
-
showElementBrowserLink = config.showElementBrowserLink,
|
|
45
|
-
linkSupported = config.linkSupported,
|
|
46
|
-
linkDisabled = config.linkDisabled,
|
|
47
|
-
emojiDisabled = config.emojiDisabled,
|
|
48
|
-
emojiProvider = config.emojiProvider,
|
|
49
|
-
nativeStatusSupported = config.nativeStatusSupported,
|
|
50
|
-
insertMenuItems = config.insertMenuItems,
|
|
51
|
-
dateEnabled = config.dateEnabled,
|
|
52
|
-
placeholderTextEnabled = config.placeholderTextEnabled,
|
|
53
|
-
horizontalRuleEnabled = config.horizontalRuleEnabled,
|
|
54
|
-
layoutSectionEnabled = config.layoutSectionEnabled,
|
|
55
|
-
expandEnabled = config.expandEnabled,
|
|
56
|
-
numberOfButtons = config.numberOfButtons,
|
|
57
|
-
schema = config.schema,
|
|
58
|
-
formatMessage = config.formatMessage,
|
|
59
|
-
isNewMenuEnabled = config.isNewMenuEnabled;
|
|
60
|
-
var items = [];
|
|
61
|
-
if (actionSupported) {
|
|
62
|
-
items.push(action({
|
|
63
|
-
content: formatMessage(messages.action),
|
|
64
|
-
tooltipDescription: formatMessage(messages.actionDescription),
|
|
65
|
-
disabled: false
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
if (linkSupported) {
|
|
69
|
-
items.push(link({
|
|
70
|
-
content: formatMessage(messages.link),
|
|
71
|
-
tooltipDescription: formatMessage(messages.linkDescription),
|
|
72
|
-
disabled: !!linkDisabled,
|
|
73
|
-
'aria-haspopup': 'dialog'
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
if (mediaSupported && mediaUploadsEnabled) {
|
|
77
|
-
items.push(media({
|
|
78
|
-
content: formatMessage(messages.addMediaFiles),
|
|
79
|
-
tooltipDescription: formatMessage(messages.mediaFilesDescription),
|
|
80
|
-
disabled: false
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
if (imageUploadSupported) {
|
|
84
|
-
items.push(imageUpload({
|
|
85
|
-
content: formatMessage(messages.image),
|
|
86
|
-
disabled: !imageUploadEnabled
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
if (mentionsSupported) {
|
|
90
|
-
items.push(mention({
|
|
91
|
-
content: formatMessage(messages.mention),
|
|
92
|
-
tooltipDescription: formatMessage(messages.mentionDescription),
|
|
93
|
-
disabled: !isTypeAheadAllowed || !!mentionsDisabled,
|
|
94
|
-
'aria-haspopup': 'listbox'
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
if (emojiProvider) {
|
|
98
|
-
items.push(emoji({
|
|
99
|
-
content: formatMessage(messages.emoji),
|
|
100
|
-
tooltipDescription: formatMessage(messages.emojiDescription),
|
|
101
|
-
disabled: emojiDisabled || !isTypeAheadAllowed,
|
|
102
|
-
'aria-haspopup': 'dialog'
|
|
103
|
-
}));
|
|
104
|
-
}
|
|
105
|
-
if (tableSupported) {
|
|
106
|
-
items.push(table({
|
|
107
|
-
content: formatMessage(messages.table),
|
|
108
|
-
tooltipDescription: formatMessage(messages.tableDescription),
|
|
109
|
-
disabled: false
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
if (layoutSectionEnabled) {
|
|
113
|
-
var labelColumns = formatMessage(messages.columns);
|
|
114
|
-
items.push(layout({
|
|
115
|
-
content: labelColumns,
|
|
116
|
-
tooltipDescription: formatMessage(messages.columnsDescription),
|
|
117
|
-
disabled: false
|
|
118
|
-
}));
|
|
119
|
-
}
|
|
120
|
-
var blockTypes = availableWrapperBlockTypes || [];
|
|
121
|
-
var codeblockData = blockTypes.find(function (type) {
|
|
122
|
-
return type.name === 'codeblock';
|
|
123
|
-
});
|
|
124
|
-
var panelData = blockTypes.find(function (type) {
|
|
125
|
-
return type.name === 'panel';
|
|
126
|
-
});
|
|
127
|
-
var blockquoteData = blockTypes.find(function (type) {
|
|
128
|
-
return type.name === 'blockquote';
|
|
129
|
-
});
|
|
130
|
-
if (codeblockData) {
|
|
131
|
-
items.push(codeblock({
|
|
132
|
-
content: formatMessage(codeblockData.title),
|
|
133
|
-
tooltipDescription: formatMessage(blockTypeMessages.codeblockDescription),
|
|
134
|
-
disabled: false,
|
|
135
|
-
shortcut: '```'
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
if (panelData) {
|
|
139
|
-
items.push(panel({
|
|
140
|
-
content: formatMessage(panelData.title),
|
|
141
|
-
tooltipDescription: formatMessage(blockTypeMessages.infoPanelDescription),
|
|
142
|
-
disabled: false
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
if (blockquoteData) {
|
|
146
|
-
items.push(blockquote({
|
|
147
|
-
content: formatMessage(blockquoteData.title),
|
|
148
|
-
tooltipDescription: formatMessage(blockTypeMessages.blockquoteDescription),
|
|
149
|
-
disabled: false,
|
|
150
|
-
shortcut: '>'
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
if (decisionSupported) {
|
|
154
|
-
items.push(decision({
|
|
155
|
-
content: formatMessage(messages.decision),
|
|
156
|
-
tooltipDescription: formatMessage(messages.decisionDescription),
|
|
157
|
-
disabled: false
|
|
158
|
-
}));
|
|
159
|
-
}
|
|
160
|
-
if (horizontalRuleEnabled && schema.nodes.rule) {
|
|
161
|
-
items.push(horizontalrule({
|
|
162
|
-
content: formatMessage(messages.horizontalRule),
|
|
163
|
-
tooltipDescription: formatMessage(messages.horizontalRuleDescription),
|
|
164
|
-
disabled: false
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
if (expandEnabled && schema.nodes.expand) {
|
|
168
|
-
items.push(expand({
|
|
169
|
-
content: formatMessage(messages.expand),
|
|
170
|
-
tooltipDescription: formatMessage(messages.expandDescription),
|
|
171
|
-
disabled: false
|
|
172
|
-
}));
|
|
173
|
-
}
|
|
174
|
-
if (dateEnabled) {
|
|
175
|
-
var labelDate = formatMessage(messages.date);
|
|
176
|
-
items.push(date({
|
|
177
|
-
content: labelDate,
|
|
178
|
-
tooltipDescription: formatMessage(messages.dateDescription),
|
|
179
|
-
disabled: false
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
if (placeholderTextEnabled) {
|
|
183
|
-
items.push(placeholder({
|
|
184
|
-
content: formatMessage(messages.placeholderText),
|
|
185
|
-
disabled: false
|
|
186
|
-
}));
|
|
187
|
-
}
|
|
188
|
-
if (nativeStatusSupported) {
|
|
189
|
-
var labelStatus = formatMessage(messages.status);
|
|
190
|
-
items.push(status({
|
|
191
|
-
content: labelStatus,
|
|
192
|
-
tooltipDescription: formatMessage(messages.statusDescription),
|
|
193
|
-
disabled: false
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
if (insertMenuItems) {
|
|
197
|
-
items.push.apply(items, _toConsumableArray(insertMenuItems));
|
|
198
|
-
}
|
|
199
|
-
if (showElementBrowserLink) {
|
|
200
|
-
items.push(more({
|
|
201
|
-
content: formatMessage(messages.viewMore),
|
|
202
|
-
disabled: false
|
|
203
|
-
}));
|
|
204
|
-
}
|
|
205
|
-
var buttonItems = items.slice(0, numberOfButtons).map(buttonToItem);
|
|
206
|
-
var remainingItems = items.slice(numberOfButtons);
|
|
207
|
-
var dropdownItems = (!isNewMenuEnabled ? sortItems(remainingItems) : remainingItems).map(buttonToDropdownItem(formatMessage(messages.insertMenu)));
|
|
208
|
-
return [buttonItems, dropdownItems];
|
|
209
|
-
};
|
|
210
|
-
export var createItems = memoizeOne(createInsertBlockItems, shallowEquals);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import AddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
5
|
-
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
6
|
-
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
8
|
-
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
9
|
-
import { triggerWrapper } from './styles';
|
|
10
|
-
var DropDownButtonIcon = /*#__PURE__*/React.memo(function (props) {
|
|
11
|
-
return jsx("span", {
|
|
12
|
-
css: triggerWrapper
|
|
13
|
-
}, jsx(AddIcon, {
|
|
14
|
-
label: props.label
|
|
15
|
-
}), jsx("span", {
|
|
16
|
-
css: expandIconWrapperStyle
|
|
17
|
-
}, jsx(ExpandIcon, {
|
|
18
|
-
label: ""
|
|
19
|
-
})));
|
|
20
|
-
});
|
|
21
|
-
export var DropDownButton = /*#__PURE__*/React.memo(function (props) {
|
|
22
|
-
return jsx(ToolbarButton, {
|
|
23
|
-
ref: props.handleRef,
|
|
24
|
-
selected: props.selected,
|
|
25
|
-
disabled: props.disabled,
|
|
26
|
-
onClick: props.onClick,
|
|
27
|
-
onKeyDown: props.onKeyDown,
|
|
28
|
-
spacing: props.spacing,
|
|
29
|
-
"aria-expanded": props['aria-expanded'],
|
|
30
|
-
"aria-haspopup": props['aria-haspopup'],
|
|
31
|
-
"aria-keyshortcuts": props['aria-keyshortcuts'],
|
|
32
|
-
"aria-label": "".concat(props.label, " /"),
|
|
33
|
-
iconBefore: jsx(DropDownButtonIcon, {
|
|
34
|
-
label: ""
|
|
35
|
-
}),
|
|
36
|
-
title: jsx(ToolTipContent, {
|
|
37
|
-
description: props.label,
|
|
38
|
-
shortcutOverride: "/"
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
});
|