@atlaskit/editor-plugin-insert-block 7.0.6 → 7.0.8
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 +18 -0
- package/dist/cjs/insertBlockPlugin.js +1 -8
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/cjs/ui/toolbar-components/EmojiButton.js +5 -1
- package/dist/cjs/ui/toolbar-components/InsertButton.js +7 -2
- package/dist/cjs/ui/toolbar-components/MentionButton.js +6 -1
- package/dist/cjs/ui/toolbar-components/TableButton.js +6 -2
- package/dist/cjs/ui/toolbar-components/TaskListButton.js +6 -1
- package/dist/cjs/ui/toolbar-components.js +7 -271
- package/dist/es2019/insertBlockPlugin.js +2 -9
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/es2019/ui/toolbar-components/EmojiButton.js +5 -1
- package/dist/es2019/ui/toolbar-components/InsertButton.js +7 -2
- package/dist/es2019/ui/toolbar-components/MentionButton.js +6 -1
- package/dist/es2019/ui/toolbar-components/TableButton.js +7 -3
- package/dist/es2019/ui/toolbar-components/TaskListButton.js +6 -1
- package/dist/es2019/ui/toolbar-components.js +1 -241
- package/dist/esm/insertBlockPlugin.js +2 -9
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/esm/ui/toolbar-components/EmojiButton.js +5 -1
- package/dist/esm/ui/toolbar-components/InsertButton.js +7 -2
- package/dist/esm/ui/toolbar-components/MentionButton.js +6 -1
- package/dist/esm/ui/toolbar-components/TableButton.js +7 -3
- package/dist/esm/ui/toolbar-components/TaskListButton.js +6 -1
- package/dist/esm/ui/toolbar-components.js +6 -270
- package/dist/types/ui/toolbar-components.d.ts +1 -19
- package/dist/types-ts4.5/ui/toolbar-components.d.ts +1 -19
- package/package.json +4 -7
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { ToolTipContent, insertTaskList } from '@atlaskit/editor-common/keymaps';
|
|
4
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
6
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
6
7
|
import { ToolbarButton, ToolbarTooltip, TaskIcon } from '@atlaskit/editor-toolbar';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
9
|
export const TaskListButton = ({
|
|
8
10
|
api
|
|
9
11
|
}) => {
|
|
@@ -27,7 +29,10 @@ export const TaskListButton = ({
|
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
31
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
30
|
-
content:
|
|
32
|
+
content: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
33
|
+
description: formatMessage(messages.action),
|
|
34
|
+
keymap: insertTaskList
|
|
35
|
+
}) : formatMessage(messages.action)
|
|
31
36
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
32
37
|
iconBefore: /*#__PURE__*/React.createElement(TaskIcon, {
|
|
33
38
|
label: formatMessage(messages.action),
|
|
@@ -13,236 +13,11 @@ import { MentionButton } from './toolbar-components/MentionButton';
|
|
|
13
13
|
import { TableButton } from './toolbar-components/TableButton';
|
|
14
14
|
import { TableSizePicker } from './toolbar-components/TableSizePicker';
|
|
15
15
|
import { TaskListButton } from './toolbar-components/TaskListButton';
|
|
16
|
-
export const getToolbarComponents = ({
|
|
17
|
-
api,
|
|
18
|
-
tableSelectorSupported,
|
|
19
|
-
toolbarShowPlusInsertOnly,
|
|
20
|
-
showElementBrowserLink,
|
|
21
|
-
onInsertBlockType,
|
|
22
|
-
nativeStatusSupported,
|
|
23
|
-
horizontalRuleEnabled,
|
|
24
|
-
expandEnabled,
|
|
25
|
-
insertMenuItems
|
|
26
|
-
}) => {
|
|
27
|
-
return [...(toolbarShowPlusInsertOnly ? [{
|
|
28
|
-
type: INSERT_GROUP.type,
|
|
29
|
-
key: INSERT_GROUP.key,
|
|
30
|
-
parents: [{
|
|
31
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
32
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
33
|
-
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
34
|
-
}]
|
|
35
|
-
}, {
|
|
36
|
-
type: INSERT_BUTTON.type,
|
|
37
|
-
key: INSERT_BUTTON.key,
|
|
38
|
-
parents: [{
|
|
39
|
-
type: INSERT_GROUP.type,
|
|
40
|
-
key: INSERT_GROUP.key,
|
|
41
|
-
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
42
|
-
}],
|
|
43
|
-
component: () => /*#__PURE__*/React.createElement(InsertButton, {
|
|
44
|
-
api: api,
|
|
45
|
-
showElementBrowserLink: showElementBrowserLink,
|
|
46
|
-
tableSelectorSupported: tableSelectorSupported,
|
|
47
|
-
onInsertBlockType: onInsertBlockType,
|
|
48
|
-
nativeStatusSupported: nativeStatusSupported,
|
|
49
|
-
horizontalRuleEnabled: horizontalRuleEnabled,
|
|
50
|
-
expandEnabled: expandEnabled,
|
|
51
|
-
insertMenuItems: insertMenuItems
|
|
52
|
-
})
|
|
53
|
-
}] : [{
|
|
54
|
-
type: TASK_LIST_GROUP.type,
|
|
55
|
-
key: TASK_LIST_GROUP.key,
|
|
56
|
-
parents: [{
|
|
57
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
58
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
59
|
-
rank: INSERT_BLOCK_SECTION_RANK[TASK_LIST_GROUP.key]
|
|
60
|
-
}],
|
|
61
|
-
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
62
|
-
children
|
|
63
|
-
}) => /*#__PURE__*/React.createElement(Show, {
|
|
64
|
-
above: "lg"
|
|
65
|
-
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
|
|
66
|
-
}, {
|
|
67
|
-
type: TASK_LIST_BUTTON.type,
|
|
68
|
-
key: TASK_LIST_BUTTON.key,
|
|
69
|
-
parents: [{
|
|
70
|
-
type: TASK_LIST_GROUP.type,
|
|
71
|
-
key: TASK_LIST_GROUP.key,
|
|
72
|
-
rank: TASK_LIST_GROUP_RANK[TASK_LIST_BUTTON.key]
|
|
73
|
-
}],
|
|
74
|
-
component: () => /*#__PURE__*/React.createElement(TaskListButton, {
|
|
75
|
-
api: api
|
|
76
|
-
})
|
|
77
|
-
}, {
|
|
78
|
-
type: MEDIA_GROUP.type,
|
|
79
|
-
key: MEDIA_GROUP.key,
|
|
80
|
-
parents: [{
|
|
81
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
82
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
83
|
-
rank: INSERT_BLOCK_SECTION_RANK[MEDIA_GROUP.key]
|
|
84
|
-
}],
|
|
85
|
-
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
86
|
-
children
|
|
87
|
-
}) => /*#__PURE__*/React.createElement(Show, {
|
|
88
|
-
above: "lg"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
|
|
90
|
-
}, {
|
|
91
|
-
type: MEDIA_BUTTON.type,
|
|
92
|
-
key: MEDIA_BUTTON.key,
|
|
93
|
-
parents: [{
|
|
94
|
-
type: MEDIA_GROUP.type,
|
|
95
|
-
key: MEDIA_GROUP.key,
|
|
96
|
-
rank: MEDIA_GROUP_RANK[MEDIA_BUTTON.key]
|
|
97
|
-
}],
|
|
98
|
-
component: () => !!(api !== null && api !== void 0 && api.imageUpload) ? /*#__PURE__*/React.createElement(ImageButton, {
|
|
99
|
-
api: api
|
|
100
|
-
}) : /*#__PURE__*/React.createElement(MediaButton, {
|
|
101
|
-
api: api
|
|
102
|
-
})
|
|
103
|
-
}, {
|
|
104
|
-
type: MENTION_GROUP.type,
|
|
105
|
-
key: MENTION_GROUP.key,
|
|
106
|
-
parents: [{
|
|
107
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
108
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
109
|
-
rank: INSERT_BLOCK_SECTION_RANK[MENTION_GROUP.key]
|
|
110
|
-
}],
|
|
111
|
-
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
112
|
-
children
|
|
113
|
-
}) => /*#__PURE__*/React.createElement(Show, {
|
|
114
|
-
above: "lg"
|
|
115
|
-
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
|
|
116
|
-
}, {
|
|
117
|
-
type: MENTION_BUTTON.type,
|
|
118
|
-
key: MENTION_BUTTON.key,
|
|
119
|
-
parents: [{
|
|
120
|
-
type: MENTION_GROUP.type,
|
|
121
|
-
key: MENTION_GROUP.key,
|
|
122
|
-
rank: MENTION_GROUP_RANK[MENTION_BUTTON.key]
|
|
123
|
-
}],
|
|
124
|
-
component: () => /*#__PURE__*/React.createElement(MentionButton, {
|
|
125
|
-
api: api
|
|
126
|
-
})
|
|
127
|
-
}, {
|
|
128
|
-
type: EMOJI_GROUP.type,
|
|
129
|
-
key: EMOJI_GROUP.key,
|
|
130
|
-
parents: [{
|
|
131
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
132
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
133
|
-
rank: INSERT_BLOCK_SECTION_RANK[EMOJI_GROUP.key]
|
|
134
|
-
}],
|
|
135
|
-
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
136
|
-
children
|
|
137
|
-
}) => /*#__PURE__*/React.createElement(Show, {
|
|
138
|
-
above: "lg"
|
|
139
|
-
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
|
|
140
|
-
}, {
|
|
141
|
-
type: EMOJI_BUTTON.type,
|
|
142
|
-
key: EMOJI_BUTTON.key,
|
|
143
|
-
parents: [{
|
|
144
|
-
type: EMOJI_GROUP.type,
|
|
145
|
-
key: EMOJI_GROUP.key,
|
|
146
|
-
rank: EMOJI_GROUP_RANK[EMOJI_BUTTON.key]
|
|
147
|
-
}],
|
|
148
|
-
component: () => /*#__PURE__*/React.createElement(EmojiButton, {
|
|
149
|
-
api: api
|
|
150
|
-
})
|
|
151
|
-
}, {
|
|
152
|
-
type: LAYOUT_GROUP.type,
|
|
153
|
-
key: LAYOUT_GROUP.key,
|
|
154
|
-
parents: [{
|
|
155
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
156
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
157
|
-
rank: INSERT_BLOCK_SECTION_RANK[LAYOUT_GROUP.key]
|
|
158
|
-
}],
|
|
159
|
-
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
160
|
-
children
|
|
161
|
-
}) => /*#__PURE__*/React.createElement(Show, {
|
|
162
|
-
above: "lg"
|
|
163
|
-
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
|
|
164
|
-
}, {
|
|
165
|
-
type: LAYOUT_BUTTON.type,
|
|
166
|
-
key: LAYOUT_BUTTON.key,
|
|
167
|
-
parents: [{
|
|
168
|
-
type: LAYOUT_GROUP.type,
|
|
169
|
-
key: LAYOUT_GROUP.key,
|
|
170
|
-
rank: LAYOUT_GROUP_RANK[LAYOUT_BUTTON.key]
|
|
171
|
-
}],
|
|
172
|
-
component: () => /*#__PURE__*/React.createElement(LayoutButton, {
|
|
173
|
-
api: api
|
|
174
|
-
})
|
|
175
|
-
}, {
|
|
176
|
-
type: TABLE_GROUP.type,
|
|
177
|
-
key: TABLE_GROUP.key,
|
|
178
|
-
parents: [{
|
|
179
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
180
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
181
|
-
rank: INSERT_BLOCK_SECTION_RANK[TABLE_GROUP.key]
|
|
182
|
-
}],
|
|
183
|
-
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
184
|
-
children
|
|
185
|
-
}) => /*#__PURE__*/React.createElement(Show, {
|
|
186
|
-
above: "md"
|
|
187
|
-
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
|
|
188
|
-
}, {
|
|
189
|
-
type: TABLE_BUTTON.type,
|
|
190
|
-
key: TABLE_BUTTON.key,
|
|
191
|
-
parents: [{
|
|
192
|
-
type: TABLE_GROUP.type,
|
|
193
|
-
key: TABLE_GROUP.key,
|
|
194
|
-
rank: TABLE_GROUP_RANK[TABLE_BUTTON.key]
|
|
195
|
-
}],
|
|
196
|
-
component: () => /*#__PURE__*/React.createElement(TableButton, {
|
|
197
|
-
api: api
|
|
198
|
-
})
|
|
199
|
-
}, {
|
|
200
|
-
type: TABLE_SIZE_PICKER.type,
|
|
201
|
-
key: TABLE_SIZE_PICKER.key,
|
|
202
|
-
parents: [{
|
|
203
|
-
type: TABLE_GROUP.type,
|
|
204
|
-
key: TABLE_GROUP.key,
|
|
205
|
-
rank: TABLE_GROUP_RANK[TABLE_SIZE_PICKER.key]
|
|
206
|
-
}],
|
|
207
|
-
component: () => /*#__PURE__*/React.createElement(TableSizePicker, {
|
|
208
|
-
api: api,
|
|
209
|
-
tableSelectorSupported: tableSelectorSupported
|
|
210
|
-
})
|
|
211
|
-
}, {
|
|
212
|
-
type: INSERT_GROUP.type,
|
|
213
|
-
key: INSERT_GROUP.key,
|
|
214
|
-
parents: [{
|
|
215
|
-
type: INSERT_BLOCK_SECTION.type,
|
|
216
|
-
key: INSERT_BLOCK_SECTION.key,
|
|
217
|
-
rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
|
|
218
|
-
}]
|
|
219
|
-
}, {
|
|
220
|
-
type: INSERT_BUTTON.type,
|
|
221
|
-
key: INSERT_BUTTON.key,
|
|
222
|
-
parents: [{
|
|
223
|
-
type: INSERT_GROUP.type,
|
|
224
|
-
key: INSERT_GROUP.key,
|
|
225
|
-
rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
|
|
226
|
-
}],
|
|
227
|
-
component: () => /*#__PURE__*/React.createElement(InsertButton, {
|
|
228
|
-
api: api,
|
|
229
|
-
showElementBrowserLink: showElementBrowserLink,
|
|
230
|
-
tableSelectorSupported: tableSelectorSupported,
|
|
231
|
-
onInsertBlockType: onInsertBlockType,
|
|
232
|
-
nativeStatusSupported: nativeStatusSupported,
|
|
233
|
-
horizontalRuleEnabled: horizontalRuleEnabled,
|
|
234
|
-
expandEnabled: expandEnabled,
|
|
235
|
-
insertMenuItems: insertMenuItems,
|
|
236
|
-
numberOfButtons: 7 // TODO: ED-28759 - Default to 7 buttons - Remove this once we have a proper way to do toolbar responsiveness
|
|
237
|
-
})
|
|
238
|
-
}])];
|
|
239
|
-
};
|
|
240
|
-
|
|
241
16
|
/**
|
|
242
17
|
* Updated toolbar components function that uses the new configuration resolver.
|
|
243
18
|
* This function replaces the hardcoded approach with a config-driven one.
|
|
244
19
|
*/
|
|
245
|
-
export const
|
|
20
|
+
export const getToolbarComponents = ({
|
|
246
21
|
api,
|
|
247
22
|
options,
|
|
248
23
|
onInsertBlockType
|
|
@@ -492,19 +267,4 @@ export const getToolbarComponentsUpdated = ({
|
|
|
492
267
|
});
|
|
493
268
|
}
|
|
494
269
|
return components;
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* Main export that switches between old and new implementations based on experiment.
|
|
499
|
-
* This allows for gradual rollout of the new config-driven approach.
|
|
500
|
-
*/
|
|
501
|
-
export const getToolbarComponentsWithConfig = props => {
|
|
502
|
-
if (expValEquals('platform_editor_toolbar_aifc_responsiveness_update', 'isEnabled', true) && 'options' in props) {
|
|
503
|
-
// Use new config-driven approach
|
|
504
|
-
return getToolbarComponentsUpdated(props);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// Use legacy approach
|
|
508
|
-
const legacyProps = props;
|
|
509
|
-
return getToolbarComponents(legacyProps);
|
|
510
270
|
};
|
|
@@ -9,7 +9,7 @@ import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-ty
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
11
|
import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
|
|
12
|
-
import {
|
|
12
|
+
import { getToolbarComponents } from './ui/toolbar-components';
|
|
13
13
|
// Ignored via go/ees005
|
|
14
14
|
// eslint-disable-next-line import/no-named-as-default
|
|
15
15
|
import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
|
|
@@ -161,16 +161,9 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
161
161
|
exposure: true
|
|
162
162
|
})) {
|
|
163
163
|
var _api$toolbar, _api$codeBlock, _api$panel, _api$blockType;
|
|
164
|
-
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(
|
|
164
|
+
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents({
|
|
165
165
|
api: api,
|
|
166
|
-
tableSelectorSupported: options.tableSelectorSupported,
|
|
167
|
-
toolbarShowPlusInsertOnly: options.toolbarShowPlusInsertOnly,
|
|
168
|
-
showElementBrowserLink: options.showElementBrowserLink,
|
|
169
166
|
onInsertBlockType: handleInsertBlockType(api === null || api === void 0 || (_api$codeBlock = api.codeBlock) === null || _api$codeBlock === void 0 ? void 0 : _api$codeBlock.actions.insertCodeBlock, api === null || api === void 0 || (_api$panel = api.panel) === null || _api$panel === void 0 ? void 0 : _api$panel.actions.insertPanel, api === null || api === void 0 || (_api$blockType = api.blockType) === null || _api$blockType === void 0 ? void 0 : _api$blockType.actions.insertBlockQuote),
|
|
170
|
-
nativeStatusSupported: options.nativeStatusSupported,
|
|
171
|
-
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
172
|
-
expandEnabled: options.allowExpand,
|
|
173
|
-
insertMenuItems: options.insertMenuItems,
|
|
174
167
|
options: options
|
|
175
168
|
}));
|
|
176
169
|
} else {
|
|
@@ -209,7 +209,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
209
209
|
,
|
|
210
210
|
key: quickInsertDropdownItems.length,
|
|
211
211
|
viewMoreItem: viewMoreItem,
|
|
212
|
-
onViewMore: showElementBrowserLink
|
|
212
|
+
onViewMore: showElementBrowserLink ? onViewMore : undefined,
|
|
213
213
|
cache: cache
|
|
214
214
|
})))
|
|
215
215
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { ToolTipContent, insertEmoji } from '@atlaskit/editor-common/keymaps';
|
|
4
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
6
|
import { ToolbarButton, ToolbarTooltip, EmojiIcon } from '@atlaskit/editor-toolbar';
|
|
6
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -50,7 +51,10 @@ export var EmojiButton = function EmojiButton(_ref) {
|
|
|
50
51
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
51
52
|
popupsScrollableElement: popupsScrollableElement
|
|
52
53
|
}), /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
53
|
-
content:
|
|
54
|
+
content: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
55
|
+
description: formatMessage(messages.emoji),
|
|
56
|
+
keymap: insertEmoji
|
|
57
|
+
}) : formatMessage(messages.emoji)
|
|
54
58
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
55
59
|
iconBefore: /*#__PURE__*/React.createElement(EmojiIcon, {
|
|
56
60
|
label: formatMessage(messages.emoji),
|
|
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { getAriaKeyshortcuts, insertElements, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
5
6
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
7
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -9,6 +10,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
9
10
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
11
|
import { ToolbarButton, ToolbarTooltip, AddIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
11
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
14
|
import InsertMenu, { DEFAULT_HEIGHT } from '../ElementBrowser/InsertMenu';
|
|
13
15
|
import { useEmojiPickerPopup } from './hooks/useEmojiPickerPopup';
|
|
14
16
|
import { useInsertButtonState } from './hooks/useInsertButtonState';
|
|
@@ -227,13 +229,16 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
227
229
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
228
230
|
popupsScrollableElement: popupsScrollableElement
|
|
229
231
|
}), /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
230
|
-
content:
|
|
232
|
+
content: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
233
|
+
description: formatMessage(messages.insertMenu),
|
|
234
|
+
keymap: insertElements
|
|
235
|
+
}) : formatMessage(messages.insertMenu)
|
|
231
236
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
232
237
|
iconBefore: /*#__PURE__*/React.createElement(AddIcon, {
|
|
233
238
|
size: "small",
|
|
234
239
|
label: formatMessage(messages.insertMenu)
|
|
235
240
|
}),
|
|
236
|
-
ariaKeyshortcuts:
|
|
241
|
+
ariaKeyshortcuts: getAriaKeyshortcuts(insertElements),
|
|
237
242
|
ref: insertButtonRef,
|
|
238
243
|
onClick: onClick,
|
|
239
244
|
isSelected: insertMenuOpen,
|
|
@@ -2,8 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
|
+
import { ToolTipContent, insertMention } from '@atlaskit/editor-common/keymaps';
|
|
5
6
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
7
|
import { ToolbarButton, ToolbarTooltip, MentionIcon } from '@atlaskit/editor-toolbar';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
9
|
export var MentionButton = function MentionButton(_ref) {
|
|
8
10
|
var api = _ref.api;
|
|
9
11
|
var _useIntl = useIntl(),
|
|
@@ -27,7 +29,10 @@ export var MentionButton = function MentionButton(_ref) {
|
|
|
27
29
|
api === null || api === void 0 || (_api$mention = api.mention) === null || _api$mention === void 0 || (_api$mention = _api$mention.actions) === null || _api$mention === void 0 || _api$mention.openTypeAhead(INPUT_METHOD.TOOLBAR);
|
|
28
30
|
};
|
|
29
31
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
30
|
-
content:
|
|
32
|
+
content: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
33
|
+
description: formatMessage(messages.mention),
|
|
34
|
+
keymap: insertMention
|
|
35
|
+
}) : formatMessage(messages.mention)
|
|
31
36
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
32
37
|
iconBefore: /*#__PURE__*/React.createElement(MentionIcon, {
|
|
33
38
|
label: formatMessage(messages.mention),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import {
|
|
4
|
+
import { ToolTipContent, getAriaKeyshortcuts, toggleTable } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ToolbarButton, ToolbarTooltip, TableIcon } from '@atlaskit/editor-toolbar';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
export var TableButton = function TableButton(_ref) {
|
|
9
10
|
var api = _ref.api;
|
|
10
11
|
var _useIntl = useIntl(),
|
|
@@ -34,13 +35,16 @@ export var TableButton = function TableButton(_ref) {
|
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
37
|
-
content:
|
|
38
|
+
content: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
39
|
+
description: formatMessage(messages.table),
|
|
40
|
+
keymap: toggleTable
|
|
41
|
+
}) : formatMessage(messages.table)
|
|
38
42
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
39
43
|
iconBefore: /*#__PURE__*/React.createElement(TableIcon, {
|
|
40
44
|
label: formatMessage(messages.table),
|
|
41
45
|
size: "small"
|
|
42
46
|
}),
|
|
43
47
|
onClick: onClick,
|
|
44
|
-
ariaKeyshortcuts:
|
|
48
|
+
ariaKeyshortcuts: getAriaKeyshortcuts(toggleTable)
|
|
45
49
|
}));
|
|
46
50
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { ToolTipContent, insertTaskList } from '@atlaskit/editor-common/keymaps';
|
|
4
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
6
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
6
7
|
import { ToolbarButton, ToolbarTooltip, TaskIcon } from '@atlaskit/editor-toolbar';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
9
|
export var TaskListButton = function TaskListButton(_ref) {
|
|
8
10
|
var api = _ref.api;
|
|
9
11
|
var _useIntl = useIntl(),
|
|
@@ -22,7 +24,10 @@ export var TaskListButton = function TaskListButton(_ref) {
|
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
25
|
-
content:
|
|
27
|
+
content: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolTipContent, {
|
|
28
|
+
description: formatMessage(messages.action),
|
|
29
|
+
keymap: insertTaskList
|
|
30
|
+
}) : formatMessage(messages.action)
|
|
26
31
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
27
32
|
iconBefore: /*#__PURE__*/React.createElement(TaskIcon, {
|
|
28
33
|
label: formatMessage(messages.action),
|