@atlaskit/editor-plugin-insert-block 7.0.7 → 7.0.9

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,21 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 7.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.0.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`e38eb931c4472`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e38eb931c4472) -
14
+ [FD-101539] clean up platform_editor_refactor_view_more_fix
15
+ - [`482bcdc75598e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/482bcdc75598e) -
16
+ ED-29462 Clean up platform_editor_toolbar_aifc_responsiveness_update
17
+ - Updated dependencies
18
+
3
19
  ## 7.0.7
4
20
 
5
21
  ### Patch Changes
@@ -171,16 +171,9 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
171
171
  exposure: true
172
172
  })) {
173
173
  var _api$toolbar, _api$codeBlock, _api$panel, _api$blockType;
174
- api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponentsWithConfig)({
174
+ api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)({
175
175
  api: api,
176
- tableSelectorSupported: options.tableSelectorSupported,
177
- toolbarShowPlusInsertOnly: options.toolbarShowPlusInsertOnly,
178
- showElementBrowserLink: options.showElementBrowserLink,
179
176
  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),
180
- nativeStatusSupported: options.nativeStatusSupported,
181
- horizontalRuleEnabled: options.horizontalRuleEnabled,
182
- expandEnabled: options.allowExpand,
183
- insertMenuItems: options.insertMenuItems,
184
177
  options: options
185
178
  }));
186
179
  } else {
@@ -212,7 +212,7 @@ var InsertMenu = function InsertMenu(_ref) {
212
212
  ,
213
213
  key: quickInsertDropdownItems.length,
214
214
  viewMoreItem: viewMoreItem,
215
- onViewMore: showElementBrowserLink || !(0, _platformFeatureFlags.fg)('platform_editor_refactor_view_more_fix') ? onViewMore : undefined,
215
+ onViewMore: showElementBrowserLink ? onViewMore : undefined,
216
216
  cache: cache
217
217
  })))
218
218
  );
@@ -4,8 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.getToolbarComponentsWithConfig = exports.getToolbarComponentsUpdated = exports.getToolbarComponents = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
7
+ exports.getToolbarComponents = void 0;
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _toolbar = require("@atlaskit/editor-common/toolbar");
11
10
  var _editorToolbar = require("@atlaskit/editor-toolbar");
@@ -21,270 +20,22 @@ var _MentionButton = require("./toolbar-components/MentionButton");
21
20
  var _TableButton = require("./toolbar-components/TableButton");
22
21
  var _TableSizePicker = require("./toolbar-components/TableSizePicker");
23
22
  var _TaskListButton = require("./toolbar-components/TaskListButton");
24
- var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(_ref) {
25
- var api = _ref.api,
26
- tableSelectorSupported = _ref.tableSelectorSupported,
27
- toolbarShowPlusInsertOnly = _ref.toolbarShowPlusInsertOnly,
28
- showElementBrowserLink = _ref.showElementBrowserLink,
29
- onInsertBlockType = _ref.onInsertBlockType,
30
- nativeStatusSupported = _ref.nativeStatusSupported,
31
- horizontalRuleEnabled = _ref.horizontalRuleEnabled,
32
- expandEnabled = _ref.expandEnabled,
33
- insertMenuItems = _ref.insertMenuItems;
34
- return (0, _toConsumableArray2.default)(toolbarShowPlusInsertOnly ? [{
35
- type: _toolbar.INSERT_GROUP.type,
36
- key: _toolbar.INSERT_GROUP.key,
37
- parents: [{
38
- type: _toolbar.INSERT_BLOCK_SECTION.type,
39
- key: _toolbar.INSERT_BLOCK_SECTION.key,
40
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.INSERT_GROUP.key]
41
- }]
42
- }, {
43
- type: _toolbar.INSERT_BUTTON.type,
44
- key: _toolbar.INSERT_BUTTON.key,
45
- parents: [{
46
- type: _toolbar.INSERT_GROUP.type,
47
- key: _toolbar.INSERT_GROUP.key,
48
- rank: _toolbar.INSERT_GROUP_RANK[_toolbar.INSERT_BUTTON.key]
49
- }],
50
- component: function component() {
51
- return /*#__PURE__*/_react.default.createElement(_InsertButton.InsertButton, {
52
- api: api,
53
- showElementBrowserLink: showElementBrowserLink,
54
- tableSelectorSupported: tableSelectorSupported,
55
- onInsertBlockType: onInsertBlockType,
56
- nativeStatusSupported: nativeStatusSupported,
57
- horizontalRuleEnabled: horizontalRuleEnabled,
58
- expandEnabled: expandEnabled,
59
- insertMenuItems: insertMenuItems
60
- });
61
- }
62
- }] : [{
63
- type: _toolbar.TASK_LIST_GROUP.type,
64
- key: _toolbar.TASK_LIST_GROUP.key,
65
- parents: [{
66
- type: _toolbar.INSERT_BLOCK_SECTION.type,
67
- key: _toolbar.INSERT_BLOCK_SECTION.key,
68
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.TASK_LIST_GROUP.key]
69
- }],
70
- component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
71
- var children = _ref2.children;
72
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
73
- above: "lg"
74
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
75
- } : undefined
76
- }, {
77
- type: _toolbar.TASK_LIST_BUTTON.type,
78
- key: _toolbar.TASK_LIST_BUTTON.key,
79
- parents: [{
80
- type: _toolbar.TASK_LIST_GROUP.type,
81
- key: _toolbar.TASK_LIST_GROUP.key,
82
- rank: _toolbar.TASK_LIST_GROUP_RANK[_toolbar.TASK_LIST_BUTTON.key]
83
- }],
84
- component: function component() {
85
- return /*#__PURE__*/_react.default.createElement(_TaskListButton.TaskListButton, {
86
- api: api
87
- });
88
- }
89
- }, {
90
- type: _toolbar.MEDIA_GROUP.type,
91
- key: _toolbar.MEDIA_GROUP.key,
92
- parents: [{
93
- type: _toolbar.INSERT_BLOCK_SECTION.type,
94
- key: _toolbar.INSERT_BLOCK_SECTION.key,
95
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.MEDIA_GROUP.key]
96
- }],
97
- component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref3) {
98
- var children = _ref3.children;
99
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
100
- above: "lg"
101
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
102
- } : undefined
103
- }, {
104
- type: _toolbar.MEDIA_BUTTON.type,
105
- key: _toolbar.MEDIA_BUTTON.key,
106
- parents: [{
107
- type: _toolbar.MEDIA_GROUP.type,
108
- key: _toolbar.MEDIA_GROUP.key,
109
- rank: _toolbar.MEDIA_GROUP_RANK[_toolbar.MEDIA_BUTTON.key]
110
- }],
111
- component: function component() {
112
- return !!(api !== null && api !== void 0 && api.imageUpload) ? /*#__PURE__*/_react.default.createElement(_ImageButton.ImageButton, {
113
- api: api
114
- }) : /*#__PURE__*/_react.default.createElement(_MediaButton.MediaButton, {
115
- api: api
116
- });
117
- }
118
- }, {
119
- type: _toolbar.MENTION_GROUP.type,
120
- key: _toolbar.MENTION_GROUP.key,
121
- parents: [{
122
- type: _toolbar.INSERT_BLOCK_SECTION.type,
123
- key: _toolbar.INSERT_BLOCK_SECTION.key,
124
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.MENTION_GROUP.key]
125
- }],
126
- component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref4) {
127
- var children = _ref4.children;
128
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
129
- above: "lg"
130
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
131
- } : undefined
132
- }, {
133
- type: _toolbar.MENTION_BUTTON.type,
134
- key: _toolbar.MENTION_BUTTON.key,
135
- parents: [{
136
- type: _toolbar.MENTION_GROUP.type,
137
- key: _toolbar.MENTION_GROUP.key,
138
- rank: _toolbar.MENTION_GROUP_RANK[_toolbar.MENTION_BUTTON.key]
139
- }],
140
- component: function component() {
141
- return /*#__PURE__*/_react.default.createElement(_MentionButton.MentionButton, {
142
- api: api
143
- });
144
- }
145
- }, {
146
- type: _toolbar.EMOJI_GROUP.type,
147
- key: _toolbar.EMOJI_GROUP.key,
148
- parents: [{
149
- type: _toolbar.INSERT_BLOCK_SECTION.type,
150
- key: _toolbar.INSERT_BLOCK_SECTION.key,
151
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.EMOJI_GROUP.key]
152
- }],
153
- component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref5) {
154
- var children = _ref5.children;
155
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
156
- above: "lg"
157
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
158
- } : undefined
159
- }, {
160
- type: _toolbar.EMOJI_BUTTON.type,
161
- key: _toolbar.EMOJI_BUTTON.key,
162
- parents: [{
163
- type: _toolbar.EMOJI_GROUP.type,
164
- key: _toolbar.EMOJI_GROUP.key,
165
- rank: _toolbar.EMOJI_GROUP_RANK[_toolbar.EMOJI_BUTTON.key]
166
- }],
167
- component: function component() {
168
- return /*#__PURE__*/_react.default.createElement(_EmojiButton.EmojiButton, {
169
- api: api
170
- });
171
- }
172
- }, {
173
- type: _toolbar.LAYOUT_GROUP.type,
174
- key: _toolbar.LAYOUT_GROUP.key,
175
- parents: [{
176
- type: _toolbar.INSERT_BLOCK_SECTION.type,
177
- key: _toolbar.INSERT_BLOCK_SECTION.key,
178
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.LAYOUT_GROUP.key]
179
- }],
180
- component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref6) {
181
- var children = _ref6.children;
182
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
183
- above: "lg"
184
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
185
- } : undefined
186
- }, {
187
- type: _toolbar.LAYOUT_BUTTON.type,
188
- key: _toolbar.LAYOUT_BUTTON.key,
189
- parents: [{
190
- type: _toolbar.LAYOUT_GROUP.type,
191
- key: _toolbar.LAYOUT_GROUP.key,
192
- rank: _toolbar.LAYOUT_GROUP_RANK[_toolbar.LAYOUT_BUTTON.key]
193
- }],
194
- component: function component() {
195
- return /*#__PURE__*/_react.default.createElement(_LayoutButton.LayoutButton, {
196
- api: api
197
- });
198
- }
199
- }, {
200
- type: _toolbar.TABLE_GROUP.type,
201
- key: _toolbar.TABLE_GROUP.key,
202
- parents: [{
203
- type: _toolbar.INSERT_BLOCK_SECTION.type,
204
- key: _toolbar.INSERT_BLOCK_SECTION.key,
205
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.TABLE_GROUP.key]
206
- }],
207
- component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref7) {
208
- var children = _ref7.children;
209
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
210
- above: "md"
211
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
212
- } : undefined
213
- }, {
214
- type: _toolbar.TABLE_BUTTON.type,
215
- key: _toolbar.TABLE_BUTTON.key,
216
- parents: [{
217
- type: _toolbar.TABLE_GROUP.type,
218
- key: _toolbar.TABLE_GROUP.key,
219
- rank: _toolbar.TABLE_GROUP_RANK[_toolbar.TABLE_BUTTON.key]
220
- }],
221
- component: function component() {
222
- return /*#__PURE__*/_react.default.createElement(_TableButton.TableButton, {
223
- api: api
224
- });
225
- }
226
- }, {
227
- type: _toolbar.TABLE_SIZE_PICKER.type,
228
- key: _toolbar.TABLE_SIZE_PICKER.key,
229
- parents: [{
230
- type: _toolbar.TABLE_GROUP.type,
231
- key: _toolbar.TABLE_GROUP.key,
232
- rank: _toolbar.TABLE_GROUP_RANK[_toolbar.TABLE_SIZE_PICKER.key]
233
- }],
234
- component: function component() {
235
- return /*#__PURE__*/_react.default.createElement(_TableSizePicker.TableSizePicker, {
236
- api: api,
237
- tableSelectorSupported: tableSelectorSupported
238
- });
239
- }
240
- }, {
241
- type: _toolbar.INSERT_GROUP.type,
242
- key: _toolbar.INSERT_GROUP.key,
243
- parents: [{
244
- type: _toolbar.INSERT_BLOCK_SECTION.type,
245
- key: _toolbar.INSERT_BLOCK_SECTION.key,
246
- rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.INSERT_GROUP.key]
247
- }]
248
- }, {
249
- type: _toolbar.INSERT_BUTTON.type,
250
- key: _toolbar.INSERT_BUTTON.key,
251
- parents: [{
252
- type: _toolbar.INSERT_GROUP.type,
253
- key: _toolbar.INSERT_GROUP.key,
254
- rank: _toolbar.INSERT_GROUP_RANK[_toolbar.INSERT_BUTTON.key]
255
- }],
256
- component: function component() {
257
- return /*#__PURE__*/_react.default.createElement(_InsertButton.InsertButton, {
258
- api: api,
259
- showElementBrowserLink: showElementBrowserLink,
260
- tableSelectorSupported: tableSelectorSupported,
261
- onInsertBlockType: onInsertBlockType,
262
- nativeStatusSupported: nativeStatusSupported,
263
- horizontalRuleEnabled: horizontalRuleEnabled,
264
- expandEnabled: expandEnabled,
265
- insertMenuItems: insertMenuItems,
266
- numberOfButtons: 7 // TODO: ED-28759 - Default to 7 buttons - Remove this once we have a proper way to do toolbar responsiveness
267
- });
268
- }
269
- }]);
270
- };
271
-
272
23
  /**
273
24
  * Updated toolbar components function that uses the new configuration resolver.
274
25
  * This function replaces the hardcoded approach with a config-driven one.
275
26
  */
276
- var getToolbarComponentsUpdated = exports.getToolbarComponentsUpdated = function getToolbarComponentsUpdated(_ref8) {
27
+ var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(_ref) {
277
28
  var _config$taskList, _config$media, _config$codeBlock, _config$mention, _config$emoji, _config$layout, _config$table, _config$insert;
278
- var api = _ref8.api,
279
- options = _ref8.options,
280
- onInsertBlockType = _ref8.onInsertBlockType;
29
+ var api = _ref.api,
30
+ options = _ref.options,
31
+ onInsertBlockType = _ref.onInsertBlockType;
281
32
  var config = (0, _configResolver.resolveToolbarConfig)(options);
282
33
  var components = [];
283
34
 
284
35
  // Helper function to create responsive wrapper component
285
36
  var createResponsiveComponent = function createResponsiveComponent() {
286
- return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref9) {
287
- var children = _ref9.children;
37
+ return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
38
+ var children = _ref2.children;
288
39
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
289
40
  above: "lg"
290
41
  }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
@@ -541,19 +292,4 @@ var getToolbarComponentsUpdated = exports.getToolbarComponentsUpdated = function
541
292
  });
542
293
  }
543
294
  return components;
544
- };
545
-
546
- /**
547
- * Main export that switches between old and new implementations based on experiment.
548
- * This allows for gradual rollout of the new config-driven approach.
549
- */
550
- var getToolbarComponentsWithConfig = exports.getToolbarComponentsWithConfig = function getToolbarComponentsWithConfig(props) {
551
- if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsiveness_update', 'isEnabled', true) && 'options' in props) {
552
- // Use new config-driven approach
553
- return getToolbarComponentsUpdated(props);
554
- }
555
-
556
- // Use legacy approach
557
- var legacyProps = props;
558
- return getToolbarComponents(legacyProps);
559
295
  };
@@ -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 { getToolbarComponentsWithConfig } from './ui/toolbar-components';
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';
@@ -156,16 +156,9 @@ export const insertBlockPlugin = ({
156
156
  exposure: true
157
157
  })) {
158
158
  var _api$toolbar, _api$codeBlock, _api$panel, _api$blockType;
159
- api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponentsWithConfig({
159
+ api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents({
160
160
  api,
161
- tableSelectorSupported: options.tableSelectorSupported,
162
- toolbarShowPlusInsertOnly: options.toolbarShowPlusInsertOnly,
163
- showElementBrowserLink: options.showElementBrowserLink,
164
161
  onInsertBlockType: handleInsertBlockType(api === null || api === void 0 ? void 0 : (_api$codeBlock = api.codeBlock) === null || _api$codeBlock === void 0 ? void 0 : _api$codeBlock.actions.insertCodeBlock, api === null || api === void 0 ? void 0 : (_api$panel = api.panel) === null || _api$panel === void 0 ? void 0 : _api$panel.actions.insertPanel, api === null || api === void 0 ? void 0 : (_api$blockType = api.blockType) === null || _api$blockType === void 0 ? void 0 : _api$blockType.actions.insertBlockQuote),
165
- nativeStatusSupported: options.nativeStatusSupported,
166
- horizontalRuleEnabled: options.horizontalRuleEnabled,
167
- expandEnabled: options.allowExpand,
168
- insertMenuItems: options.insertMenuItems,
169
162
  options
170
163
  }));
171
164
  } else {
@@ -182,7 +182,7 @@ const InsertMenu = ({
182
182
  ,
183
183
  key: quickInsertDropdownItems.length,
184
184
  viewMoreItem: viewMoreItem,
185
- onViewMore: showElementBrowserLink || !fg('platform_editor_refactor_view_more_fix') ? onViewMore : undefined,
185
+ onViewMore: showElementBrowserLink ? onViewMore : undefined,
186
186
  cache: cache
187
187
  })))
188
188
  );
@@ -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 getToolbarComponentsUpdated = ({
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 { getToolbarComponentsWithConfig } from './ui/toolbar-components';
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(getToolbarComponentsWithConfig({
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 || !fg('platform_editor_refactor_view_more_fix') ? onViewMore : undefined,
212
+ onViewMore: showElementBrowserLink ? onViewMore : undefined,
213
213
  cache: cache
214
214
  })))
215
215
  );
@@ -1,4 +1,3 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
1
  import React from 'react';
3
2
  import { INSERT_BLOCK_SECTION, TASK_LIST_GROUP, MEDIA_GROUP, INSERT_BLOCK_SECTION_RANK, TASK_LIST_BUTTON, TASK_LIST_GROUP_RANK, MEDIA_BUTTON, MENTION_GROUP, MEDIA_GROUP_RANK, MENTION_BUTTON, MENTION_GROUP_RANK, EMOJI_GROUP, EMOJI_BUTTON, EMOJI_GROUP_RANK, LAYOUT_GROUP, LAYOUT_BUTTON, LAYOUT_GROUP_RANK, TABLE_GROUP_RANK, TABLE_BUTTON, TABLE_GROUP, TABLE_SIZE_PICKER, INSERT_GROUP, INSERT_BUTTON, INSERT_GROUP_RANK, CODE_BLOCK_GROUP, CODE_BLOCK_BUTTON, CODE_BLOCK_GROUP_RANK } from '@atlaskit/editor-common/toolbar';
4
3
  import { Show, ToolbarButtonGroup } from '@atlaskit/editor-toolbar';
@@ -14,270 +13,22 @@ import { MentionButton } from './toolbar-components/MentionButton';
14
13
  import { TableButton } from './toolbar-components/TableButton';
15
14
  import { TableSizePicker } from './toolbar-components/TableSizePicker';
16
15
  import { TaskListButton } from './toolbar-components/TaskListButton';
17
- export var getToolbarComponents = function getToolbarComponents(_ref) {
18
- var api = _ref.api,
19
- tableSelectorSupported = _ref.tableSelectorSupported,
20
- toolbarShowPlusInsertOnly = _ref.toolbarShowPlusInsertOnly,
21
- showElementBrowserLink = _ref.showElementBrowserLink,
22
- onInsertBlockType = _ref.onInsertBlockType,
23
- nativeStatusSupported = _ref.nativeStatusSupported,
24
- horizontalRuleEnabled = _ref.horizontalRuleEnabled,
25
- expandEnabled = _ref.expandEnabled,
26
- insertMenuItems = _ref.insertMenuItems;
27
- return _toConsumableArray(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: function component() {
44
- return /*#__PURE__*/React.createElement(InsertButton, {
45
- api: api,
46
- showElementBrowserLink: showElementBrowserLink,
47
- tableSelectorSupported: tableSelectorSupported,
48
- onInsertBlockType: onInsertBlockType,
49
- nativeStatusSupported: nativeStatusSupported,
50
- horizontalRuleEnabled: horizontalRuleEnabled,
51
- expandEnabled: expandEnabled,
52
- insertMenuItems: insertMenuItems
53
- });
54
- }
55
- }] : [{
56
- type: TASK_LIST_GROUP.type,
57
- key: TASK_LIST_GROUP.key,
58
- parents: [{
59
- type: INSERT_BLOCK_SECTION.type,
60
- key: INSERT_BLOCK_SECTION.key,
61
- rank: INSERT_BLOCK_SECTION_RANK[TASK_LIST_GROUP.key]
62
- }],
63
- component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
64
- var children = _ref2.children;
65
- return /*#__PURE__*/React.createElement(Show, {
66
- above: "lg"
67
- }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
68
- } : undefined
69
- }, {
70
- type: TASK_LIST_BUTTON.type,
71
- key: TASK_LIST_BUTTON.key,
72
- parents: [{
73
- type: TASK_LIST_GROUP.type,
74
- key: TASK_LIST_GROUP.key,
75
- rank: TASK_LIST_GROUP_RANK[TASK_LIST_BUTTON.key]
76
- }],
77
- component: function component() {
78
- return /*#__PURE__*/React.createElement(TaskListButton, {
79
- api: api
80
- });
81
- }
82
- }, {
83
- type: MEDIA_GROUP.type,
84
- key: MEDIA_GROUP.key,
85
- parents: [{
86
- type: INSERT_BLOCK_SECTION.type,
87
- key: INSERT_BLOCK_SECTION.key,
88
- rank: INSERT_BLOCK_SECTION_RANK[MEDIA_GROUP.key]
89
- }],
90
- component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref3) {
91
- var children = _ref3.children;
92
- return /*#__PURE__*/React.createElement(Show, {
93
- above: "lg"
94
- }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
95
- } : undefined
96
- }, {
97
- type: MEDIA_BUTTON.type,
98
- key: MEDIA_BUTTON.key,
99
- parents: [{
100
- type: MEDIA_GROUP.type,
101
- key: MEDIA_GROUP.key,
102
- rank: MEDIA_GROUP_RANK[MEDIA_BUTTON.key]
103
- }],
104
- component: function component() {
105
- return !!(api !== null && api !== void 0 && api.imageUpload) ? /*#__PURE__*/React.createElement(ImageButton, {
106
- api: api
107
- }) : /*#__PURE__*/React.createElement(MediaButton, {
108
- api: api
109
- });
110
- }
111
- }, {
112
- type: MENTION_GROUP.type,
113
- key: MENTION_GROUP.key,
114
- parents: [{
115
- type: INSERT_BLOCK_SECTION.type,
116
- key: INSERT_BLOCK_SECTION.key,
117
- rank: INSERT_BLOCK_SECTION_RANK[MENTION_GROUP.key]
118
- }],
119
- component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref4) {
120
- var children = _ref4.children;
121
- return /*#__PURE__*/React.createElement(Show, {
122
- above: "lg"
123
- }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
124
- } : undefined
125
- }, {
126
- type: MENTION_BUTTON.type,
127
- key: MENTION_BUTTON.key,
128
- parents: [{
129
- type: MENTION_GROUP.type,
130
- key: MENTION_GROUP.key,
131
- rank: MENTION_GROUP_RANK[MENTION_BUTTON.key]
132
- }],
133
- component: function component() {
134
- return /*#__PURE__*/React.createElement(MentionButton, {
135
- api: api
136
- });
137
- }
138
- }, {
139
- type: EMOJI_GROUP.type,
140
- key: EMOJI_GROUP.key,
141
- parents: [{
142
- type: INSERT_BLOCK_SECTION.type,
143
- key: INSERT_BLOCK_SECTION.key,
144
- rank: INSERT_BLOCK_SECTION_RANK[EMOJI_GROUP.key]
145
- }],
146
- component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref5) {
147
- var children = _ref5.children;
148
- return /*#__PURE__*/React.createElement(Show, {
149
- above: "lg"
150
- }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
151
- } : undefined
152
- }, {
153
- type: EMOJI_BUTTON.type,
154
- key: EMOJI_BUTTON.key,
155
- parents: [{
156
- type: EMOJI_GROUP.type,
157
- key: EMOJI_GROUP.key,
158
- rank: EMOJI_GROUP_RANK[EMOJI_BUTTON.key]
159
- }],
160
- component: function component() {
161
- return /*#__PURE__*/React.createElement(EmojiButton, {
162
- api: api
163
- });
164
- }
165
- }, {
166
- type: LAYOUT_GROUP.type,
167
- key: LAYOUT_GROUP.key,
168
- parents: [{
169
- type: INSERT_BLOCK_SECTION.type,
170
- key: INSERT_BLOCK_SECTION.key,
171
- rank: INSERT_BLOCK_SECTION_RANK[LAYOUT_GROUP.key]
172
- }],
173
- component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref6) {
174
- var children = _ref6.children;
175
- return /*#__PURE__*/React.createElement(Show, {
176
- above: "lg"
177
- }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
178
- } : undefined
179
- }, {
180
- type: LAYOUT_BUTTON.type,
181
- key: LAYOUT_BUTTON.key,
182
- parents: [{
183
- type: LAYOUT_GROUP.type,
184
- key: LAYOUT_GROUP.key,
185
- rank: LAYOUT_GROUP_RANK[LAYOUT_BUTTON.key]
186
- }],
187
- component: function component() {
188
- return /*#__PURE__*/React.createElement(LayoutButton, {
189
- api: api
190
- });
191
- }
192
- }, {
193
- type: TABLE_GROUP.type,
194
- key: TABLE_GROUP.key,
195
- parents: [{
196
- type: INSERT_BLOCK_SECTION.type,
197
- key: INSERT_BLOCK_SECTION.key,
198
- rank: INSERT_BLOCK_SECTION_RANK[TABLE_GROUP.key]
199
- }],
200
- component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref7) {
201
- var children = _ref7.children;
202
- return /*#__PURE__*/React.createElement(Show, {
203
- above: "md"
204
- }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
205
- } : undefined
206
- }, {
207
- type: TABLE_BUTTON.type,
208
- key: TABLE_BUTTON.key,
209
- parents: [{
210
- type: TABLE_GROUP.type,
211
- key: TABLE_GROUP.key,
212
- rank: TABLE_GROUP_RANK[TABLE_BUTTON.key]
213
- }],
214
- component: function component() {
215
- return /*#__PURE__*/React.createElement(TableButton, {
216
- api: api
217
- });
218
- }
219
- }, {
220
- type: TABLE_SIZE_PICKER.type,
221
- key: TABLE_SIZE_PICKER.key,
222
- parents: [{
223
- type: TABLE_GROUP.type,
224
- key: TABLE_GROUP.key,
225
- rank: TABLE_GROUP_RANK[TABLE_SIZE_PICKER.key]
226
- }],
227
- component: function component() {
228
- return /*#__PURE__*/React.createElement(TableSizePicker, {
229
- api: api,
230
- tableSelectorSupported: tableSelectorSupported
231
- });
232
- }
233
- }, {
234
- type: INSERT_GROUP.type,
235
- key: INSERT_GROUP.key,
236
- parents: [{
237
- type: INSERT_BLOCK_SECTION.type,
238
- key: INSERT_BLOCK_SECTION.key,
239
- rank: INSERT_BLOCK_SECTION_RANK[INSERT_GROUP.key]
240
- }]
241
- }, {
242
- type: INSERT_BUTTON.type,
243
- key: INSERT_BUTTON.key,
244
- parents: [{
245
- type: INSERT_GROUP.type,
246
- key: INSERT_GROUP.key,
247
- rank: INSERT_GROUP_RANK[INSERT_BUTTON.key]
248
- }],
249
- component: function component() {
250
- return /*#__PURE__*/React.createElement(InsertButton, {
251
- api: api,
252
- showElementBrowserLink: showElementBrowserLink,
253
- tableSelectorSupported: tableSelectorSupported,
254
- onInsertBlockType: onInsertBlockType,
255
- nativeStatusSupported: nativeStatusSupported,
256
- horizontalRuleEnabled: horizontalRuleEnabled,
257
- expandEnabled: expandEnabled,
258
- insertMenuItems: insertMenuItems,
259
- numberOfButtons: 7 // TODO: ED-28759 - Default to 7 buttons - Remove this once we have a proper way to do toolbar responsiveness
260
- });
261
- }
262
- }]);
263
- };
264
-
265
16
  /**
266
17
  * Updated toolbar components function that uses the new configuration resolver.
267
18
  * This function replaces the hardcoded approach with a config-driven one.
268
19
  */
269
- export var getToolbarComponentsUpdated = function getToolbarComponentsUpdated(_ref8) {
20
+ export var getToolbarComponents = function getToolbarComponents(_ref) {
270
21
  var _config$taskList, _config$media, _config$codeBlock, _config$mention, _config$emoji, _config$layout, _config$table, _config$insert;
271
- var api = _ref8.api,
272
- options = _ref8.options,
273
- onInsertBlockType = _ref8.onInsertBlockType;
22
+ var api = _ref.api,
23
+ options = _ref.options,
24
+ onInsertBlockType = _ref.onInsertBlockType;
274
25
  var config = resolveToolbarConfig(options);
275
26
  var components = [];
276
27
 
277
28
  // Helper function to create responsive wrapper component
278
29
  var createResponsiveComponent = function createResponsiveComponent() {
279
- return expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref9) {
280
- var children = _ref9.children;
30
+ return expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
31
+ var children = _ref2.children;
281
32
  return /*#__PURE__*/React.createElement(Show, {
282
33
  above: "lg"
283
34
  }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
@@ -534,19 +285,4 @@ export var getToolbarComponentsUpdated = function getToolbarComponentsUpdated(_r
534
285
  });
535
286
  }
536
287
  return components;
537
- };
538
-
539
- /**
540
- * Main export that switches between old and new implementations based on experiment.
541
- * This allows for gradual rollout of the new config-driven approach.
542
- */
543
- export var getToolbarComponentsWithConfig = function getToolbarComponentsWithConfig(props) {
544
- if (expValEquals('platform_editor_toolbar_aifc_responsiveness_update', 'isEnabled', true) && 'options' in props) {
545
- // Use new config-driven approach
546
- return getToolbarComponentsUpdated(props);
547
- }
548
-
549
- // Use legacy approach
550
- var legacyProps = props;
551
- return getToolbarComponents(legacyProps);
552
288
  };
@@ -1,33 +1,15 @@
1
1
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
3
2
  import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
4
3
  import type { InsertBlockPlugin } from '../insertBlockPluginType';
5
4
  import type { InsertBlockPluginOptions } from '../types';
6
5
  type GetToolbarComponentsProps = {
7
- api?: ExtractInjectionAPI<InsertBlockPlugin>;
8
- expandEnabled?: boolean;
9
- horizontalRuleEnabled?: boolean;
10
- insertMenuItems?: MenuItem[];
11
- nativeStatusSupported?: boolean;
12
- onInsertBlockType?: (name: string) => Command;
13
- showElementBrowserLink?: boolean;
14
- tableSelectorSupported?: boolean;
15
- toolbarShowPlusInsertOnly?: boolean;
16
- };
17
- type GetToolbarComponentsUpdatedProps = {
18
6
  api?: ExtractInjectionAPI<InsertBlockPlugin>;
19
7
  onInsertBlockType?: (name: string) => Command;
20
8
  options: InsertBlockPluginOptions;
21
9
  };
22
- export declare const getToolbarComponents: ({ api, tableSelectorSupported, toolbarShowPlusInsertOnly, showElementBrowserLink, onInsertBlockType, nativeStatusSupported, horizontalRuleEnabled, expandEnabled, insertMenuItems, }: GetToolbarComponentsProps) => RegisterComponent[];
23
10
  /**
24
11
  * Updated toolbar components function that uses the new configuration resolver.
25
12
  * This function replaces the hardcoded approach with a config-driven one.
26
13
  */
27
- export declare const getToolbarComponentsUpdated: ({ api, options, onInsertBlockType, }: GetToolbarComponentsUpdatedProps) => RegisterComponent[];
28
- /**
29
- * Main export that switches between old and new implementations based on experiment.
30
- * This allows for gradual rollout of the new config-driven approach.
31
- */
32
- export declare const getToolbarComponentsWithConfig: (props: GetToolbarComponentsProps | GetToolbarComponentsUpdatedProps) => RegisterComponent[];
14
+ export declare const getToolbarComponents: ({ api, options, onInsertBlockType, }: GetToolbarComponentsProps) => RegisterComponent[];
33
15
  export {};
@@ -1,33 +1,15 @@
1
1
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
3
2
  import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
4
3
  import type { InsertBlockPlugin } from '../insertBlockPluginType';
5
4
  import type { InsertBlockPluginOptions } from '../types';
6
5
  type GetToolbarComponentsProps = {
7
- api?: ExtractInjectionAPI<InsertBlockPlugin>;
8
- expandEnabled?: boolean;
9
- horizontalRuleEnabled?: boolean;
10
- insertMenuItems?: MenuItem[];
11
- nativeStatusSupported?: boolean;
12
- onInsertBlockType?: (name: string) => Command;
13
- showElementBrowserLink?: boolean;
14
- tableSelectorSupported?: boolean;
15
- toolbarShowPlusInsertOnly?: boolean;
16
- };
17
- type GetToolbarComponentsUpdatedProps = {
18
6
  api?: ExtractInjectionAPI<InsertBlockPlugin>;
19
7
  onInsertBlockType?: (name: string) => Command;
20
8
  options: InsertBlockPluginOptions;
21
9
  };
22
- export declare const getToolbarComponents: ({ api, tableSelectorSupported, toolbarShowPlusInsertOnly, showElementBrowserLink, onInsertBlockType, nativeStatusSupported, horizontalRuleEnabled, expandEnabled, insertMenuItems, }: GetToolbarComponentsProps) => RegisterComponent[];
23
10
  /**
24
11
  * Updated toolbar components function that uses the new configuration resolver.
25
12
  * This function replaces the hardcoded approach with a config-driven one.
26
13
  */
27
- export declare const getToolbarComponentsUpdated: ({ api, options, onInsertBlockType, }: GetToolbarComponentsUpdatedProps) => RegisterComponent[];
28
- /**
29
- * Main export that switches between old and new implementations based on experiment.
30
- * This allows for gradual rollout of the new config-driven approach.
31
- */
32
- export declare const getToolbarComponentsWithConfig: (props: GetToolbarComponentsProps | GetToolbarComponentsUpdatedProps) => RegisterComponent[];
14
+ export declare const getToolbarComponents: ({ api, options, onInsertBlockType, }: GetToolbarComponentsProps) => RegisterComponent[];
33
15
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "7.0.7",
3
+ "version": "7.0.9",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@atlaskit/button": "^23.5.0",
33
33
  "@atlaskit/editor-plugin-analytics": "^6.1.0",
34
- "@atlaskit/editor-plugin-block-type": "^9.0.0",
34
+ "@atlaskit/editor-plugin-block-type": "^10.0.0",
35
35
  "@atlaskit/editor-plugin-code-block": "^8.0.0",
36
36
  "@atlaskit/editor-plugin-connectivity": "^6.0.0",
37
37
  "@atlaskit/editor-plugin-date": "^8.0.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/editor-plugin-mentions": "^8.0.0",
48
48
  "@atlaskit/editor-plugin-metrics": "^7.0.0",
49
49
  "@atlaskit/editor-plugin-panel": "^8.0.0",
50
- "@atlaskit/editor-plugin-placeholder-text": "^6.0.0",
50
+ "@atlaskit/editor-plugin-placeholder-text": "^7.0.0",
51
51
  "@atlaskit/editor-plugin-primary-toolbar": "^7.0.0",
52
52
  "@atlaskit/editor-plugin-quick-insert": "^6.0.0",
53
53
  "@atlaskit/editor-plugin-rule": "^6.0.0",
@@ -55,19 +55,19 @@
55
55
  "@atlaskit/editor-plugin-table": "^15.0.0",
56
56
  "@atlaskit/editor-plugin-tasks-and-decisions": "^9.0.0",
57
57
  "@atlaskit/editor-plugin-toolbar": "^3.1.0",
58
- "@atlaskit/editor-plugin-type-ahead": "^6.2.0",
58
+ "@atlaskit/editor-plugin-type-ahead": "^6.3.0",
59
59
  "@atlaskit/editor-prosemirror": "7.0.0",
60
60
  "@atlaskit/editor-shared-styles": "^3.6.0",
61
61
  "@atlaskit/editor-toolbar": "^0.14.0",
62
62
  "@atlaskit/editor-toolbar-model": "^0.2.0",
63
63
  "@atlaskit/emoji": "^69.5.0",
64
64
  "@atlaskit/heading": "^5.2.0",
65
- "@atlaskit/icon": "^28.4.0",
66
- "@atlaskit/icon-lab": "^5.9.0",
65
+ "@atlaskit/icon": "^28.5.0",
66
+ "@atlaskit/icon-lab": "^5.10.0",
67
67
  "@atlaskit/platform-feature-flags": "^1.1.0",
68
68
  "@atlaskit/primitives": "^14.15.0",
69
69
  "@atlaskit/theme": "^21.0.0",
70
- "@atlaskit/tmp-editor-statsig": "^13.2.0",
70
+ "@atlaskit/tmp-editor-statsig": "^13.6.0",
71
71
  "@atlaskit/tokens": "^6.4.0",
72
72
  "@atlaskit/tooltip": "^20.5.0",
73
73
  "@babel/runtime": "^7.0.0",
@@ -75,10 +75,10 @@
75
75
  "bind-event-listener": "^3.0.0",
76
76
  "lodash": "^4.17.21",
77
77
  "memoize-one": "^6.0.0",
78
- "react-virtualized": "^9.8.0"
78
+ "react-virtualized": "^9.22.6"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^110.4.0",
81
+ "@atlaskit/editor-common": "^110.9.0",
82
82
  "react": "^18.2.0",
83
83
  "react-dom": "^18.2.0",
84
84
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -133,9 +133,6 @@
133
133
  "platform_editor_ease_of_use_metrics": {
134
134
  "type": "boolean"
135
135
  },
136
- "platform_editor_refactor_view_more_fix": {
137
- "type": "boolean"
138
- },
139
136
  "platform_editor_add_media_from_url_rollout": {
140
137
  "type": "boolean"
141
138
  },