@atlaskit/editor-plugin-insert-block 2.2.12 → 2.3.0

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,16 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e961ab7307a56`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e961ab7307a56) -
8
+ Refactored toggle insert block logic
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 2.2.12
4
15
 
5
16
  ### Patch Changes
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.insertBlockPlugin = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
7
+ exports.toolbarSizeToButtons = exports.insertBlockPlugin = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
10
9
  var _analytics = require("@atlaskit/editor-common/analytics");
11
10
  var _hooks = require("@atlaskit/editor-common/hooks");
12
11
  var _insert = require("@atlaskit/editor-common/insert");
@@ -20,13 +19,12 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
19
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
21
20
  var _switch = _interopRequireDefault(require("./assets/switch"));
22
21
  var _elementBrowser = require("./pm-plugins/elementBrowser");
22
+ var _toggleInsertBlock = require("./pm-plugins/toggleInsertBlock");
23
23
  var _ElementRail = require("./ui/ElementRail");
24
24
  var _templateOptions = require("./ui/templateOptions");
25
25
  var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
26
26
  var _transformOptions = require("./ui/transformOptions");
27
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
- var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
27
+ var toolbarSizeToButtons = exports.toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
30
28
  // Different button numbers for full-page to better match full page toolbar breakpoints
31
29
  if (appearance === 'full-page' && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_responsive_fixes')) {
32
30
  switch (toolbarSize) {
@@ -92,18 +90,9 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
92
90
  var _ref$config = _ref.config,
93
91
  options = _ref$config === void 0 ? {} : _ref$config,
94
92
  api = _ref.api;
95
- var toggleDropdownMenuOptionsRef = {
96
- current: null
97
- };
98
93
  var editorViewRef = {
99
94
  current: null
100
95
  };
101
- var registerToggleDropdownMenuOptions = function registerToggleDropdownMenuOptions(cb) {
102
- toggleDropdownMenuOptionsRef.current = cb;
103
- return function () {
104
- toggleDropdownMenuOptionsRef.current = null;
105
- };
106
- };
107
96
  var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
108
97
  var editorView = _ref2.editorView,
109
98
  editorActions = _ref2.editorActions,
@@ -132,7 +121,6 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
132
121
  isLastItem: isLastItem,
133
122
  providers: providers,
134
123
  options: options,
135
- registerToggleDropdownMenuOptions: registerToggleDropdownMenuOptions,
136
124
  appearance: options.appearance
137
125
  });
138
126
  };
@@ -150,54 +138,62 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
150
138
  name: 'insertBlock',
151
139
  actions: {
152
140
  toggleAdditionalMenu: function toggleAdditionalMenu() {
153
- var toggle = toggleDropdownMenuOptionsRef.current;
154
- if (!toggle) {
155
- return;
156
- }
157
- toggle();
141
+ var _api$core;
142
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
143
+ var tr = _ref3.tr;
144
+ return tr.setMeta(_toggleInsertBlock.toggleInsertBlockPmKey, true);
145
+ });
158
146
  }
159
147
  },
160
- /**
161
- * For insert menu in right rail experiment - I don't want to expose state as it might not ship
162
- * - Clean up ticket ED-24801
163
- */
164
- // @ts-expect-error
165
148
  getSharedState: function getSharedState(editorState) {
166
149
  var _options$appearance;
167
- if (!editorState ||
168
- // @ts-ignore
169
- !['full-page', 'full-width'].includes((_options$appearance = options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : '') || !(0, _experiments.editorExperiment)('insert-menu-in-right-rail', true)) {
150
+ if (!editorState || !['full-page', 'full-width'].includes((_options$appearance = options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : '')) {
170
151
  return;
171
152
  }
172
- var pluginState = _elementBrowser.elementBrowserPmKey.getState(editorState);
153
+ var toggleInsertBlockPluginState = _toggleInsertBlock.toggleInsertBlockPmKey.getState(editorState);
154
+ var elementBrowserPluginState = _elementBrowser.elementBrowserPmKey.getState(editorState);
173
155
  return {
174
- menuBrowserOpen: pluginState === null || pluginState === void 0 ? void 0 : pluginState.menuBrowserOpen
156
+ showElementBrowser: (toggleInsertBlockPluginState === null || toggleInsertBlockPluginState === void 0 ? void 0 : toggleInsertBlockPluginState.showElementBrowser) || false,
157
+ /**
158
+ * For insert menu in right rail experiment
159
+ * - Clean up ticket ED-24801
160
+ * Experiment: `insert-menu-in-right-rail`
161
+ */
162
+ menuBrowserOpen: (0, _experiments.editorExperiment)('insert-menu-in-right-rail', true) ? elementBrowserPluginState === null || elementBrowserPluginState === void 0 ? void 0 : elementBrowserPluginState.menuBrowserOpen : false
175
163
  };
176
164
  },
177
165
  pmPlugins: function pmPlugins() {
178
166
  var _options$appearance2;
179
- if (
180
- // @ts-ignore
181
- !['full-page', 'full-width'].includes((_options$appearance2 = options.appearance) !== null && _options$appearance2 !== void 0 ? _options$appearance2 : '') || !(0, _experiments.editorExperiment)('insert-menu-in-right-rail', true)) {
167
+ if (!['full-page', 'full-width'].includes((_options$appearance2 = options.appearance) !== null && _options$appearance2 !== void 0 ? _options$appearance2 : '')) {
182
168
  [];
183
169
  }
184
- return [{
185
- name: 'elementBrowserPmPlugin',
186
- plugin: function plugin() {
187
- return (0, _elementBrowser.elementBrowserPmPlugin)();
188
- }
189
- }, {
190
- name: 'elementBrowserEditorViewRef',
170
+ var plugins = [];
171
+ if ((0, _experiments.editorExperiment)('insert-menu-in-right-rail', true)) {
172
+ plugins.push({
173
+ name: 'elementBrowserPmPlugin',
174
+ plugin: function plugin() {
175
+ return (0, _elementBrowser.elementBrowserPmPlugin)();
176
+ }
177
+ }, {
178
+ name: 'elementBrowserEditorViewRef',
179
+ plugin: function plugin() {
180
+ return new _safePlugin.SafePlugin({
181
+ view: function view(editorView) {
182
+ // Workaround - need reference to editorView for contextPanel component
183
+ editorViewRef.current = editorView;
184
+ return {};
185
+ }
186
+ });
187
+ }
188
+ });
189
+ }
190
+ plugins.push({
191
+ name: 'toggleInsertBlockPmPlugin',
191
192
  plugin: function plugin() {
192
- return new _safePlugin.SafePlugin({
193
- view: function view(editorView) {
194
- // Workaround - need reference to editorView for contextPanel component
195
- editorViewRef.current = editorView;
196
- return {};
197
- }
198
- });
193
+ return (0, _toggleInsertBlock.toggleInsertBlockPmPlugin)();
199
194
  }
200
- }];
195
+ });
196
+ return plugins;
201
197
  },
202
198
  pluginsOptions: {
203
199
  // This is added for basic text transformations experiment.
@@ -275,13 +271,6 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
275
271
  return [];
276
272
  }
277
273
  },
278
- usePluginHook: function usePluginHook() {
279
- (0, _react.useLayoutEffect)(function () {
280
- return function () {
281
- toggleDropdownMenuOptionsRef.current = null;
282
- };
283
- }, []);
284
- },
285
274
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
286
275
  };
287
276
  if (
@@ -303,25 +292,24 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
303
292
  }
304
293
  return plugin;
305
294
  };
306
- function ToolbarInsertBlockWithInjectionApi(_ref3) {
307
- var _ref4, _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
308
- var editorView = _ref3.editorView,
309
- editorActions = _ref3.editorActions,
310
- dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
311
- popupsMountPoint = _ref3.popupsMountPoint,
312
- popupsBoundariesElement = _ref3.popupsBoundariesElement,
313
- popupsScrollableElement = _ref3.popupsScrollableElement,
314
- toolbarSize = _ref3.toolbarSize,
315
- disabled = _ref3.disabled,
316
- isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
317
- isLastItem = _ref3.isLastItem,
318
- providers = _ref3.providers,
319
- pluginInjectionApi = _ref3.pluginInjectionApi,
320
- options = _ref3.options,
321
- registerToggleDropdownMenuOptions = _ref3.registerToggleDropdownMenuOptions,
322
- appearance = _ref3.appearance;
295
+ function ToolbarInsertBlockWithInjectionApi(_ref4) {
296
+ var _ref5, _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
297
+ var editorView = _ref4.editorView,
298
+ editorActions = _ref4.editorActions,
299
+ dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
300
+ popupsMountPoint = _ref4.popupsMountPoint,
301
+ popupsBoundariesElement = _ref4.popupsBoundariesElement,
302
+ popupsScrollableElement = _ref4.popupsScrollableElement,
303
+ toolbarSize = _ref4.toolbarSize,
304
+ disabled = _ref4.disabled,
305
+ isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing,
306
+ isLastItem = _ref4.isLastItem,
307
+ providers = _ref4.providers,
308
+ pluginInjectionApi = _ref4.pluginInjectionApi,
309
+ options = _ref4.options,
310
+ appearance = _ref4.appearance;
323
311
  var buttons = toolbarSizeToButtons(toolbarSize, appearance);
324
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
312
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock']),
325
313
  dateState = _useSharedPluginState.dateState,
326
314
  hyperlinkState = _useSharedPluginState.hyperlinkState,
327
315
  imageUploadState = _useSharedPluginState.imageUploadState,
@@ -330,7 +318,8 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
330
318
  blockTypeState = _useSharedPluginState.blockTypeState,
331
319
  mediaState = _useSharedPluginState.mediaState,
332
320
  typeAheadState = _useSharedPluginState.typeAheadState,
333
- placeholderTextState = _useSharedPluginState.placeholderTextState;
321
+ placeholderTextState = _useSharedPluginState.placeholderTextState,
322
+ insertBlockState = _useSharedPluginState.insertBlockState;
334
323
  var getEmojiProvider = function getEmojiProvider() {
335
324
  if (emojiState !== null && emojiState !== void 0 && emojiState.emojiProvider) {
336
325
  return Promise.resolve(emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider);
@@ -349,6 +338,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
349
338
  }
350
339
  };
351
340
  return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
341
+ showElementBrowser: (insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.showElementBrowser) || false,
352
342
  pluginInjectionApi: pluginInjectionApi,
353
343
  buttons: buttons,
354
344
  isReducedSpacing: isToolbarReducedSpacing,
@@ -365,7 +355,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
365
355
  placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
366
356
  layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
367
357
  expandEnabled: !!options.allowExpand,
368
- mediaUploadsEnabled: (_ref4 = mediaState && mediaState.allowsUploads) !== null && _ref4 !== void 0 ? _ref4 : undefined,
358
+ mediaUploadsEnabled: (_ref5 = mediaState && mediaState.allowsUploads) !== null && _ref5 !== void 0 ? _ref5 : undefined,
369
359
  onShowMediaPicker: onShowMediaPicker,
370
360
  mediaSupported: !!mediaState,
371
361
  imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
@@ -388,7 +378,6 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
388
378
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
389
379
  showElementBrowserLink: options.showElementBrowserLink,
390
380
  showSeparator: !isLastItem && toolbarSize <= _types.ToolbarSize.S,
391
- registerToggleDropdownMenuOptions: registerToggleDropdownMenuOptions,
392
381
  editorAppearance: options.appearance
393
382
  });
394
383
  }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.toggleInsertBlockPmPlugin = exports.toggleInsertBlockPmKey = void 0;
7
+ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
+ var _state = require("@atlaskit/editor-prosemirror/state");
9
+ var toggleInsertBlockPmKey = exports.toggleInsertBlockPmKey = new _state.PluginKey('toggleInsertBlockPmKey');
10
+ var toggleInsertBlockPmPlugin = exports.toggleInsertBlockPmPlugin = function toggleInsertBlockPmPlugin() {
11
+ return new _safePlugin.SafePlugin({
12
+ key: toggleInsertBlockPmKey,
13
+ state: {
14
+ init: function init() {
15
+ return {
16
+ showElementBrowser: false
17
+ };
18
+ },
19
+ apply: function apply(tr, pluginState) {
20
+ var meta = tr.getMeta(toggleInsertBlockPmKey);
21
+ if (!meta) {
22
+ return pluginState;
23
+ }
24
+ return {
25
+ showElementBrowser: !pluginState.showElementBrowser
26
+ };
27
+ }
28
+ }
29
+ });
30
+ };
@@ -71,8 +71,6 @@ var RightRailIcon = exports.RightRailIcon = function RightRailIcon(_ref) {
71
71
  formatMessage = _useIntl.formatMessage;
72
72
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['insertBlock']),
73
73
  insertBlockState = _useSharedPluginState.insertBlockState;
74
-
75
- // @ts-expect-error
76
74
  var isOpen = insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.menuBrowserOpen;
77
75
  return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
78
76
  xcss: [wrapperStyles]
@@ -68,6 +68,7 @@ var tableButtonWrapper = exports.tableButtonWrapper = function tableButtonWrappe
68
68
  (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\tdisplay: flex;\n\t\t", "\n\t\t", "\n\n .table-toolbar-btn {\n\t\t\tborder-top-right-radius: ", ";\n\t\t\tborder-bottom-right-radius: ", ";\n\t\t\tmargin-right: ", ";\n\t\t\tpadding: ", ";\n\t\t\t& > span {\n\t\t\t\tmin-width: 16px;\n\t\t\t\tmargin: ", ";\n\t\t\t}\n\t\t}\n\t\t.table-selector-toolbar-btn {\n\t\t\tpadding: ", ";\n\t\t\t& > span {\n\t\t\t\tmargin: ", ";\n\t\t\t\twidth: 16px !important;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\tborder-top-left-radius: ", " !important;\n\t\t\tborder-bottom-left-radius: ", " !important;\n\t\t}\n\t"])), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-selector-toolbar-btn'), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-toolbar-btn'), "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-space-025, 1px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)")
69
69
  );
70
70
  };
71
+
71
72
  // eslint-disable-next-line @repo/internal/react/no-class-components
72
73
  var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
73
74
  (0, _inherits2.default)(ToolbarInsertBlock, _React$PureComponent);
@@ -81,7 +82,6 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
81
82
  _this = _super.call.apply(_super, [this].concat(_args));
82
83
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableButtonRef", /*#__PURE__*/_react.default.createRef());
83
84
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableSelectorButtonRef", /*#__PURE__*/_react.default.createRef());
84
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unregisterToggleDropdownMenuOptions", null);
85
85
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
86
86
  isPlusMenuOpen: false,
87
87
  emojiPickerOpen: false,
@@ -214,13 +214,6 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
214
214
  _this.toggleTableSelector(_analytics.INPUT_METHOD.TOOLBAR);
215
215
  }
216
216
  });
217
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentDidMount", function () {
218
- _this.unregisterToggleDropdownMenuOptions = _this.props.registerToggleDropdownMenuOptions ? _this.props.registerToggleDropdownMenuOptions(_this.handleClick) : null;
219
- });
220
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentWillUnmount", function () {
221
- var _this$unregisterToggl, _this2;
222
- (_this$unregisterToggl = (_this2 = _this).unregisterToggleDropdownMenuOptions) === null || _this$unregisterToggl === void 0 || _this$unregisterToggl.call(_this2);
223
- });
224
217
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function () {
225
218
  var _this$props$editorApp;
226
219
  /**
@@ -572,11 +565,17 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
572
565
  isTableSelectorOpenedByKeyboard: false
573
566
  });
574
567
  }
568
+ if (this.props.showElementBrowser !== prevProps.showElementBrowser) {
569
+ this.handleClick();
570
+ this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
571
+ isPlusMenuOpen: this.props.showElementBrowser
572
+ }));
573
+ }
575
574
  }
576
575
  }, {
577
576
  key: "renderPopup",
578
577
  value: function renderPopup() {
579
- var _this3 = this;
578
+ var _this2 = this;
580
579
  var emojiPickerOpen = this.state.emojiPickerOpen;
581
580
  var _this$props11 = this.props,
582
581
  popupsMountPoint = _this$props11.popupsMountPoint,
@@ -594,8 +593,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
594
593
  }
595
594
  var onUnmount = function onUnmount() {
596
595
  requestAnimationFrame(function () {
597
- var _this3$props$pluginIn;
598
- return (_this3$props$pluginIn = _this3.props.pluginInjectionApi) === null || _this3$props$pluginIn === void 0 || (_this3$props$pluginIn = _this3$props$pluginIn.core) === null || _this3$props$pluginIn === void 0 || (_this3$props$pluginIn = _this3$props$pluginIn.actions) === null || _this3$props$pluginIn === void 0 ? void 0 : _this3$props$pluginIn.focus();
596
+ var _this2$props$pluginIn;
597
+ return (_this2$props$pluginIn = _this2.props.pluginInjectionApi) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.core) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.actions) === null || _this2$props$pluginIn === void 0 ? void 0 : _this2$props$pluginIn.focus();
599
598
  });
600
599
  };
601
600
  return (0, _react2.jsx)(_ui.Popup, {
@@ -657,7 +656,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
657
656
  }, {
658
657
  key: "render",
659
658
  value: function render() {
660
- var _this4 = this,
659
+ var _this3 = this,
661
660
  _tableButton,
662
661
  _tableButton2,
663
662
  _tableButton3,
@@ -726,7 +725,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
726
725
  return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
727
726
  item: btn,
728
727
  testId: String(btn.content),
729
- ref: _this4.handleToolbarRef(btn.value.name),
728
+ ref: _this3.handleToolbarRef(btn.value.name),
730
729
  key: btn.value.name,
731
730
  spacing: isReducedSpacing ? 'none' : 'default',
732
731
  disabled: isDisabled || btn.isDisabled,
@@ -736,7 +735,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
736
735
  "aria-label": btn['aria-label'],
737
736
  "aria-haspopup": btn['aria-haspopup'],
738
737
  "aria-keyshortcuts": btn['aria-keyshortcuts'],
739
- onItemClick: _this4.insertToolbarMenuItem
738
+ onItemClick: _this3.insertToolbarMenuItem
740
739
  });
741
740
  }), this.props.tableSelectorSupported && (isTableButtonVisible || isTableSizeVisible) && (0, _react2.jsx)("div", {
742
741
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
@@ -1,4 +1,4 @@
1
- import React, { useLayoutEffect } from 'react';
1
+ import React from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
4
4
  import { contentAllowedInCodeBlock, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
@@ -12,11 +12,12 @@ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
13
  import SwitchIcon from './assets/switch';
14
14
  import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
15
+ import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
15
16
  import { InsertMenuRail } from './ui/ElementRail';
16
17
  import { templateOptions } from './ui/templateOptions';
17
18
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
18
19
  import { transformationOptions } from './ui/transformOptions';
19
- const toolbarSizeToButtons = (toolbarSize, appearance) => {
20
+ export const toolbarSizeToButtons = (toolbarSize, appearance) => {
20
21
  // Different button numbers for full-page to better match full page toolbar breakpoints
21
22
  if (appearance === 'full-page' && fg('platform_editor_toolbar_responsive_fixes')) {
22
23
  switch (toolbarSize) {
@@ -80,18 +81,9 @@ export const insertBlockPlugin = ({
80
81
  api
81
82
  }) => {
82
83
  var _api$primaryToolbar, _options$appearance4;
83
- const toggleDropdownMenuOptionsRef = {
84
- current: null
85
- };
86
84
  const editorViewRef = {
87
85
  current: null
88
86
  };
89
- const registerToggleDropdownMenuOptions = cb => {
90
- toggleDropdownMenuOptionsRef.current = cb;
91
- return () => {
92
- toggleDropdownMenuOptionsRef.current = null;
93
- };
94
- };
95
87
  const primaryToolbarComponent = ({
96
88
  editorView,
97
89
  editorActions,
@@ -121,7 +113,6 @@ export const insertBlockPlugin = ({
121
113
  isLastItem: isLastItem,
122
114
  providers: providers,
123
115
  options: options,
124
- registerToggleDropdownMenuOptions: registerToggleDropdownMenuOptions,
125
116
  appearance: options.appearance
126
117
  });
127
118
  };
@@ -139,52 +130,59 @@ export const insertBlockPlugin = ({
139
130
  name: 'insertBlock',
140
131
  actions: {
141
132
  toggleAdditionalMenu: () => {
142
- const toggle = toggleDropdownMenuOptionsRef.current;
143
- if (!toggle) {
144
- return;
145
- }
146
- toggle();
133
+ var _api$core;
134
+ api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(({
135
+ tr
136
+ }) => {
137
+ return tr.setMeta(toggleInsertBlockPmKey, true);
138
+ });
147
139
  }
148
140
  },
149
- /**
150
- * For insert menu in right rail experiment - I don't want to expose state as it might not ship
151
- * - Clean up ticket ED-24801
152
- */
153
- // @ts-expect-error
154
141
  getSharedState: editorState => {
155
142
  var _options$appearance;
156
- if (!editorState ||
157
- // @ts-ignore
158
- !['full-page', 'full-width'].includes((_options$appearance = options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : '') || !editorExperiment('insert-menu-in-right-rail', true)) {
143
+ if (!editorState || !['full-page', 'full-width'].includes((_options$appearance = options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : '')) {
159
144
  return;
160
145
  }
161
- const pluginState = elementBrowserPmKey.getState(editorState);
146
+ const toggleInsertBlockPluginState = toggleInsertBlockPmKey.getState(editorState);
147
+ const elementBrowserPluginState = elementBrowserPmKey.getState(editorState);
162
148
  return {
163
- menuBrowserOpen: pluginState === null || pluginState === void 0 ? void 0 : pluginState.menuBrowserOpen
149
+ showElementBrowser: (toggleInsertBlockPluginState === null || toggleInsertBlockPluginState === void 0 ? void 0 : toggleInsertBlockPluginState.showElementBrowser) || false,
150
+ /**
151
+ * For insert menu in right rail experiment
152
+ * - Clean up ticket ED-24801
153
+ * Experiment: `insert-menu-in-right-rail`
154
+ */
155
+ menuBrowserOpen: editorExperiment('insert-menu-in-right-rail', true) ? elementBrowserPluginState === null || elementBrowserPluginState === void 0 ? void 0 : elementBrowserPluginState.menuBrowserOpen : false
164
156
  };
165
157
  },
166
158
  pmPlugins: () => {
167
159
  var _options$appearance2;
168
- if (
169
- // @ts-ignore
170
- !['full-page', 'full-width'].includes((_options$appearance2 = options.appearance) !== null && _options$appearance2 !== void 0 ? _options$appearance2 : '') || !editorExperiment('insert-menu-in-right-rail', true)) {
160
+ if (!['full-page', 'full-width'].includes((_options$appearance2 = options.appearance) !== null && _options$appearance2 !== void 0 ? _options$appearance2 : '')) {
171
161
  [];
172
162
  }
173
- return [{
174
- name: 'elementBrowserPmPlugin',
175
- plugin: () => elementBrowserPmPlugin()
176
- }, {
177
- name: 'elementBrowserEditorViewRef',
178
- plugin: () => {
179
- return new SafePlugin({
180
- view: editorView => {
181
- // Workaround - need reference to editorView for contextPanel component
182
- editorViewRef.current = editorView;
183
- return {};
184
- }
185
- });
186
- }
187
- }];
163
+ const plugins = [];
164
+ if (editorExperiment('insert-menu-in-right-rail', true)) {
165
+ plugins.push({
166
+ name: 'elementBrowserPmPlugin',
167
+ plugin: () => elementBrowserPmPlugin()
168
+ }, {
169
+ name: 'elementBrowserEditorViewRef',
170
+ plugin: () => {
171
+ return new SafePlugin({
172
+ view: editorView => {
173
+ // Workaround - need reference to editorView for contextPanel component
174
+ editorViewRef.current = editorView;
175
+ return {};
176
+ }
177
+ });
178
+ }
179
+ });
180
+ }
181
+ plugins.push({
182
+ name: 'toggleInsertBlockPmPlugin',
183
+ plugin: () => toggleInsertBlockPmPlugin()
184
+ });
185
+ return plugins;
188
186
  },
189
187
  pluginsOptions: {
190
188
  // This is added for basic text transformations experiment.
@@ -268,13 +266,6 @@ export const insertBlockPlugin = ({
268
266
  return [];
269
267
  }
270
268
  },
271
- usePluginHook: () => {
272
- useLayoutEffect(() => {
273
- return () => {
274
- toggleDropdownMenuOptionsRef.current = null;
275
- };
276
- }, []);
277
- },
278
269
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
279
270
  };
280
271
  if (
@@ -310,7 +301,6 @@ function ToolbarInsertBlockWithInjectionApi({
310
301
  providers,
311
302
  pluginInjectionApi,
312
303
  options,
313
- registerToggleDropdownMenuOptions,
314
304
  appearance
315
305
  }) {
316
306
  var _ref, _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
@@ -324,8 +314,9 @@ function ToolbarInsertBlockWithInjectionApi({
324
314
  blockTypeState,
325
315
  mediaState,
326
316
  typeAheadState,
327
- placeholderTextState
328
- } = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']);
317
+ placeholderTextState,
318
+ insertBlockState
319
+ } = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock']);
329
320
  const getEmojiProvider = () => {
330
321
  if (emojiState !== null && emojiState !== void 0 && emojiState.emojiProvider) {
331
322
  return Promise.resolve(emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider);
@@ -344,6 +335,7 @@ function ToolbarInsertBlockWithInjectionApi({
344
335
  }
345
336
  };
346
337
  return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
338
+ showElementBrowser: (insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.showElementBrowser) || false,
347
339
  pluginInjectionApi: pluginInjectionApi,
348
340
  buttons: buttons,
349
341
  isReducedSpacing: isToolbarReducedSpacing,
@@ -383,7 +375,6 @@ function ToolbarInsertBlockWithInjectionApi({
383
375
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
384
376
  showElementBrowserLink: options.showElementBrowserLink,
385
377
  showSeparator: !isLastItem && toolbarSize <= ToolbarSize.S,
386
- registerToggleDropdownMenuOptions: registerToggleDropdownMenuOptions,
387
378
  editorAppearance: options.appearance
388
379
  });
389
380
  }
@@ -0,0 +1,22 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
+ export const toggleInsertBlockPmKey = new PluginKey('toggleInsertBlockPmKey');
4
+ export const toggleInsertBlockPmPlugin = () => new SafePlugin({
5
+ key: toggleInsertBlockPmKey,
6
+ state: {
7
+ init() {
8
+ return {
9
+ showElementBrowser: false
10
+ };
11
+ },
12
+ apply(tr, pluginState) {
13
+ const meta = tr.getMeta(toggleInsertBlockPmKey);
14
+ if (!meta) {
15
+ return pluginState;
16
+ }
17
+ return {
18
+ showElementBrowser: !pluginState.showElementBrowser
19
+ };
20
+ }
21
+ }
22
+ });
@@ -67,8 +67,6 @@ export const RightRailIcon = ({
67
67
  const {
68
68
  insertBlockState
69
69
  } = useSharedPluginState(api, ['insertBlock']);
70
-
71
- // @ts-expect-error
72
70
  const isOpen = insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.menuBrowserOpen;
73
71
  return /*#__PURE__*/React.createElement(Box, {
74
72
  xcss: [wrapperStyles]
@@ -71,13 +71,13 @@ css`
71
71
  border-bottom-left-radius: ${"var(--ds-border-radius-200, 0px)"} !important;
72
72
  }
73
73
  `;
74
+
74
75
  // eslint-disable-next-line @repo/internal/react/no-class-components
75
76
  export class ToolbarInsertBlock extends React.PureComponent {
76
77
  constructor(..._args) {
77
78
  super(..._args);
78
79
  _defineProperty(this, "tableButtonRef", /*#__PURE__*/React.createRef());
79
80
  _defineProperty(this, "tableSelectorButtonRef", /*#__PURE__*/React.createRef());
80
- _defineProperty(this, "unregisterToggleDropdownMenuOptions", null);
81
81
  _defineProperty(this, "state", {
82
82
  isPlusMenuOpen: false,
83
83
  emojiPickerOpen: false,
@@ -210,13 +210,6 @@ export class ToolbarInsertBlock extends React.PureComponent {
210
210
  this.toggleTableSelector(INPUT_METHOD.TOOLBAR);
211
211
  }
212
212
  });
213
- _defineProperty(this, "componentDidMount", () => {
214
- this.unregisterToggleDropdownMenuOptions = this.props.registerToggleDropdownMenuOptions ? this.props.registerToggleDropdownMenuOptions(this.handleClick) : null;
215
- });
216
- _defineProperty(this, "componentWillUnmount", () => {
217
- var _this$unregisterToggl;
218
- (_this$unregisterToggl = this.unregisterToggleDropdownMenuOptions) === null || _this$unregisterToggl === void 0 ? void 0 : _this$unregisterToggl.call(this);
219
- });
220
213
  _defineProperty(this, "handleClick", () => {
221
214
  var _this$props$editorApp;
222
215
  /**
@@ -630,6 +623,13 @@ export class ToolbarInsertBlock extends React.PureComponent {
630
623
  isTableSelectorOpenedByKeyboard: false
631
624
  });
632
625
  }
626
+ if (this.props.showElementBrowser !== prevProps.showElementBrowser) {
627
+ this.handleClick();
628
+ this.setState({
629
+ ...this.state,
630
+ isPlusMenuOpen: this.props.showElementBrowser
631
+ });
632
+ }
633
633
  }
634
634
  renderPopup() {
635
635
  const {
@@ -1,4 +1,4 @@
1
- import React, { useLayoutEffect } from 'react';
1
+ import React from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
4
4
  import { contentAllowedInCodeBlock, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
@@ -12,11 +12,12 @@ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
13
  import SwitchIcon from './assets/switch';
14
14
  import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
15
+ import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
15
16
  import { InsertMenuRail } from './ui/ElementRail';
16
17
  import { templateOptions } from './ui/templateOptions';
17
18
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
18
19
  import { transformationOptions } from './ui/transformOptions';
19
- var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
20
+ export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
20
21
  // Different button numbers for full-page to better match full page toolbar breakpoints
21
22
  if (appearance === 'full-page' && fg('platform_editor_toolbar_responsive_fixes')) {
22
23
  switch (toolbarSize) {
@@ -82,18 +83,9 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
82
83
  var _ref$config = _ref.config,
83
84
  options = _ref$config === void 0 ? {} : _ref$config,
84
85
  api = _ref.api;
85
- var toggleDropdownMenuOptionsRef = {
86
- current: null
87
- };
88
86
  var editorViewRef = {
89
87
  current: null
90
88
  };
91
- var registerToggleDropdownMenuOptions = function registerToggleDropdownMenuOptions(cb) {
92
- toggleDropdownMenuOptionsRef.current = cb;
93
- return function () {
94
- toggleDropdownMenuOptionsRef.current = null;
95
- };
96
- };
97
89
  var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
98
90
  var editorView = _ref2.editorView,
99
91
  editorActions = _ref2.editorActions,
@@ -122,7 +114,6 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
122
114
  isLastItem: isLastItem,
123
115
  providers: providers,
124
116
  options: options,
125
- registerToggleDropdownMenuOptions: registerToggleDropdownMenuOptions,
126
117
  appearance: options.appearance
127
118
  });
128
119
  };
@@ -140,54 +131,62 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
140
131
  name: 'insertBlock',
141
132
  actions: {
142
133
  toggleAdditionalMenu: function toggleAdditionalMenu() {
143
- var toggle = toggleDropdownMenuOptionsRef.current;
144
- if (!toggle) {
145
- return;
146
- }
147
- toggle();
134
+ var _api$core;
135
+ api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
136
+ var tr = _ref3.tr;
137
+ return tr.setMeta(toggleInsertBlockPmKey, true);
138
+ });
148
139
  }
149
140
  },
150
- /**
151
- * For insert menu in right rail experiment - I don't want to expose state as it might not ship
152
- * - Clean up ticket ED-24801
153
- */
154
- // @ts-expect-error
155
141
  getSharedState: function getSharedState(editorState) {
156
142
  var _options$appearance;
157
- if (!editorState ||
158
- // @ts-ignore
159
- !['full-page', 'full-width'].includes((_options$appearance = options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : '') || !editorExperiment('insert-menu-in-right-rail', true)) {
143
+ if (!editorState || !['full-page', 'full-width'].includes((_options$appearance = options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : '')) {
160
144
  return;
161
145
  }
162
- var pluginState = elementBrowserPmKey.getState(editorState);
146
+ var toggleInsertBlockPluginState = toggleInsertBlockPmKey.getState(editorState);
147
+ var elementBrowserPluginState = elementBrowserPmKey.getState(editorState);
163
148
  return {
164
- menuBrowserOpen: pluginState === null || pluginState === void 0 ? void 0 : pluginState.menuBrowserOpen
149
+ showElementBrowser: (toggleInsertBlockPluginState === null || toggleInsertBlockPluginState === void 0 ? void 0 : toggleInsertBlockPluginState.showElementBrowser) || false,
150
+ /**
151
+ * For insert menu in right rail experiment
152
+ * - Clean up ticket ED-24801
153
+ * Experiment: `insert-menu-in-right-rail`
154
+ */
155
+ menuBrowserOpen: editorExperiment('insert-menu-in-right-rail', true) ? elementBrowserPluginState === null || elementBrowserPluginState === void 0 ? void 0 : elementBrowserPluginState.menuBrowserOpen : false
165
156
  };
166
157
  },
167
158
  pmPlugins: function pmPlugins() {
168
159
  var _options$appearance2;
169
- if (
170
- // @ts-ignore
171
- !['full-page', 'full-width'].includes((_options$appearance2 = options.appearance) !== null && _options$appearance2 !== void 0 ? _options$appearance2 : '') || !editorExperiment('insert-menu-in-right-rail', true)) {
160
+ if (!['full-page', 'full-width'].includes((_options$appearance2 = options.appearance) !== null && _options$appearance2 !== void 0 ? _options$appearance2 : '')) {
172
161
  [];
173
162
  }
174
- return [{
175
- name: 'elementBrowserPmPlugin',
176
- plugin: function plugin() {
177
- return elementBrowserPmPlugin();
178
- }
179
- }, {
180
- name: 'elementBrowserEditorViewRef',
163
+ var plugins = [];
164
+ if (editorExperiment('insert-menu-in-right-rail', true)) {
165
+ plugins.push({
166
+ name: 'elementBrowserPmPlugin',
167
+ plugin: function plugin() {
168
+ return elementBrowserPmPlugin();
169
+ }
170
+ }, {
171
+ name: 'elementBrowserEditorViewRef',
172
+ plugin: function plugin() {
173
+ return new SafePlugin({
174
+ view: function view(editorView) {
175
+ // Workaround - need reference to editorView for contextPanel component
176
+ editorViewRef.current = editorView;
177
+ return {};
178
+ }
179
+ });
180
+ }
181
+ });
182
+ }
183
+ plugins.push({
184
+ name: 'toggleInsertBlockPmPlugin',
181
185
  plugin: function plugin() {
182
- return new SafePlugin({
183
- view: function view(editorView) {
184
- // Workaround - need reference to editorView for contextPanel component
185
- editorViewRef.current = editorView;
186
- return {};
187
- }
188
- });
186
+ return toggleInsertBlockPmPlugin();
189
187
  }
190
- }];
188
+ });
189
+ return plugins;
191
190
  },
192
191
  pluginsOptions: {
193
192
  // This is added for basic text transformations experiment.
@@ -265,13 +264,6 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
265
264
  return [];
266
265
  }
267
266
  },
268
- usePluginHook: function usePluginHook() {
269
- useLayoutEffect(function () {
270
- return function () {
271
- toggleDropdownMenuOptionsRef.current = null;
272
- };
273
- }, []);
274
- },
275
267
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
276
268
  };
277
269
  if (
@@ -293,25 +285,24 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
293
285
  }
294
286
  return plugin;
295
287
  };
296
- function ToolbarInsertBlockWithInjectionApi(_ref3) {
297
- var _ref4, _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
298
- var editorView = _ref3.editorView,
299
- editorActions = _ref3.editorActions,
300
- dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
301
- popupsMountPoint = _ref3.popupsMountPoint,
302
- popupsBoundariesElement = _ref3.popupsBoundariesElement,
303
- popupsScrollableElement = _ref3.popupsScrollableElement,
304
- toolbarSize = _ref3.toolbarSize,
305
- disabled = _ref3.disabled,
306
- isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
307
- isLastItem = _ref3.isLastItem,
308
- providers = _ref3.providers,
309
- pluginInjectionApi = _ref3.pluginInjectionApi,
310
- options = _ref3.options,
311
- registerToggleDropdownMenuOptions = _ref3.registerToggleDropdownMenuOptions,
312
- appearance = _ref3.appearance;
288
+ function ToolbarInsertBlockWithInjectionApi(_ref4) {
289
+ var _ref5, _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
290
+ var editorView = _ref4.editorView,
291
+ editorActions = _ref4.editorActions,
292
+ dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
293
+ popupsMountPoint = _ref4.popupsMountPoint,
294
+ popupsBoundariesElement = _ref4.popupsBoundariesElement,
295
+ popupsScrollableElement = _ref4.popupsScrollableElement,
296
+ toolbarSize = _ref4.toolbarSize,
297
+ disabled = _ref4.disabled,
298
+ isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing,
299
+ isLastItem = _ref4.isLastItem,
300
+ providers = _ref4.providers,
301
+ pluginInjectionApi = _ref4.pluginInjectionApi,
302
+ options = _ref4.options,
303
+ appearance = _ref4.appearance;
313
304
  var buttons = toolbarSizeToButtons(toolbarSize, appearance);
314
- var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
305
+ var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock']),
315
306
  dateState = _useSharedPluginState.dateState,
316
307
  hyperlinkState = _useSharedPluginState.hyperlinkState,
317
308
  imageUploadState = _useSharedPluginState.imageUploadState,
@@ -320,7 +311,8 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
320
311
  blockTypeState = _useSharedPluginState.blockTypeState,
321
312
  mediaState = _useSharedPluginState.mediaState,
322
313
  typeAheadState = _useSharedPluginState.typeAheadState,
323
- placeholderTextState = _useSharedPluginState.placeholderTextState;
314
+ placeholderTextState = _useSharedPluginState.placeholderTextState,
315
+ insertBlockState = _useSharedPluginState.insertBlockState;
324
316
  var getEmojiProvider = function getEmojiProvider() {
325
317
  if (emojiState !== null && emojiState !== void 0 && emojiState.emojiProvider) {
326
318
  return Promise.resolve(emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider);
@@ -339,6 +331,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
339
331
  }
340
332
  };
341
333
  return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
334
+ showElementBrowser: (insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.showElementBrowser) || false,
342
335
  pluginInjectionApi: pluginInjectionApi,
343
336
  buttons: buttons,
344
337
  isReducedSpacing: isToolbarReducedSpacing,
@@ -355,7 +348,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
355
348
  placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
356
349
  layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
357
350
  expandEnabled: !!options.allowExpand,
358
- mediaUploadsEnabled: (_ref4 = mediaState && mediaState.allowsUploads) !== null && _ref4 !== void 0 ? _ref4 : undefined,
351
+ mediaUploadsEnabled: (_ref5 = mediaState && mediaState.allowsUploads) !== null && _ref5 !== void 0 ? _ref5 : undefined,
359
352
  onShowMediaPicker: onShowMediaPicker,
360
353
  mediaSupported: !!mediaState,
361
354
  imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
@@ -378,7 +371,6 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
378
371
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
379
372
  showElementBrowserLink: options.showElementBrowserLink,
380
373
  showSeparator: !isLastItem && toolbarSize <= ToolbarSize.S,
381
- registerToggleDropdownMenuOptions: registerToggleDropdownMenuOptions,
382
374
  editorAppearance: options.appearance
383
375
  });
384
376
  }
@@ -0,0 +1,24 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
+ export var toggleInsertBlockPmKey = new PluginKey('toggleInsertBlockPmKey');
4
+ export var toggleInsertBlockPmPlugin = function toggleInsertBlockPmPlugin() {
5
+ return new SafePlugin({
6
+ key: toggleInsertBlockPmKey,
7
+ state: {
8
+ init: function init() {
9
+ return {
10
+ showElementBrowser: false
11
+ };
12
+ },
13
+ apply: function apply(tr, pluginState) {
14
+ var meta = tr.getMeta(toggleInsertBlockPmKey);
15
+ if (!meta) {
16
+ return pluginState;
17
+ }
18
+ return {
19
+ showElementBrowser: !pluginState.showElementBrowser
20
+ };
21
+ }
22
+ }
23
+ });
24
+ };
@@ -64,8 +64,6 @@ export var RightRailIcon = function RightRailIcon(_ref) {
64
64
  formatMessage = _useIntl.formatMessage;
65
65
  var _useSharedPluginState = useSharedPluginState(api, ['insertBlock']),
66
66
  insertBlockState = _useSharedPluginState.insertBlockState;
67
-
68
- // @ts-expect-error
69
67
  var isOpen = insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.menuBrowserOpen;
70
68
  return /*#__PURE__*/React.createElement(Box, {
71
69
  xcss: [wrapperStyles]
@@ -59,6 +59,7 @@ export var tableButtonWrapper = function tableButtonWrapper(_ref) {
59
59
  css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\tdisplay: flex;\n\t\t", "\n\t\t", "\n\n .table-toolbar-btn {\n\t\t\tborder-top-right-radius: ", ";\n\t\t\tborder-bottom-right-radius: ", ";\n\t\t\tmargin-right: ", ";\n\t\t\tpadding: ", ";\n\t\t\t& > span {\n\t\t\t\tmin-width: 16px;\n\t\t\t\tmargin: ", ";\n\t\t\t}\n\t\t}\n\t\t.table-selector-toolbar-btn {\n\t\t\tpadding: ", ";\n\t\t\t& > span {\n\t\t\t\tmargin: ", ";\n\t\t\t\twidth: 16px !important;\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\tborder-top-left-radius: ", " !important;\n\t\t\tborder-bottom-left-radius: ", " !important;\n\t\t}\n\t"])), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-selector-toolbar-btn'), !isTableSelectorOpen && !isButtonDisabled && getHoverStyles('.table-toolbar-btn'), "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-space-025, 1px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius-200, 0px)", "var(--ds-border-radius-200, 0px)")
60
60
  );
61
61
  };
62
+
62
63
  // eslint-disable-next-line @repo/internal/react/no-class-components
63
64
  export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
64
65
  _inherits(ToolbarInsertBlock, _React$PureComponent);
@@ -72,7 +73,6 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
72
73
  _this = _super.call.apply(_super, [this].concat(_args));
73
74
  _defineProperty(_assertThisInitialized(_this), "tableButtonRef", /*#__PURE__*/React.createRef());
74
75
  _defineProperty(_assertThisInitialized(_this), "tableSelectorButtonRef", /*#__PURE__*/React.createRef());
75
- _defineProperty(_assertThisInitialized(_this), "unregisterToggleDropdownMenuOptions", null);
76
76
  _defineProperty(_assertThisInitialized(_this), "state", {
77
77
  isPlusMenuOpen: false,
78
78
  emojiPickerOpen: false,
@@ -205,13 +205,6 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
205
205
  _this.toggleTableSelector(INPUT_METHOD.TOOLBAR);
206
206
  }
207
207
  });
208
- _defineProperty(_assertThisInitialized(_this), "componentDidMount", function () {
209
- _this.unregisterToggleDropdownMenuOptions = _this.props.registerToggleDropdownMenuOptions ? _this.props.registerToggleDropdownMenuOptions(_this.handleClick) : null;
210
- });
211
- _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
212
- var _this$unregisterToggl, _this2;
213
- (_this$unregisterToggl = (_this2 = _this).unregisterToggleDropdownMenuOptions) === null || _this$unregisterToggl === void 0 || _this$unregisterToggl.call(_this2);
214
- });
215
208
  _defineProperty(_assertThisInitialized(_this), "handleClick", function () {
216
209
  var _this$props$editorApp;
217
210
  /**
@@ -563,11 +556,17 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
563
556
  isTableSelectorOpenedByKeyboard: false
564
557
  });
565
558
  }
559
+ if (this.props.showElementBrowser !== prevProps.showElementBrowser) {
560
+ this.handleClick();
561
+ this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
562
+ isPlusMenuOpen: this.props.showElementBrowser
563
+ }));
564
+ }
566
565
  }
567
566
  }, {
568
567
  key: "renderPopup",
569
568
  value: function renderPopup() {
570
- var _this3 = this;
569
+ var _this2 = this;
571
570
  var emojiPickerOpen = this.state.emojiPickerOpen;
572
571
  var _this$props11 = this.props,
573
572
  popupsMountPoint = _this$props11.popupsMountPoint,
@@ -585,8 +584,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
585
584
  }
586
585
  var onUnmount = function onUnmount() {
587
586
  requestAnimationFrame(function () {
588
- var _this3$props$pluginIn;
589
- return (_this3$props$pluginIn = _this3.props.pluginInjectionApi) === null || _this3$props$pluginIn === void 0 || (_this3$props$pluginIn = _this3$props$pluginIn.core) === null || _this3$props$pluginIn === void 0 || (_this3$props$pluginIn = _this3$props$pluginIn.actions) === null || _this3$props$pluginIn === void 0 ? void 0 : _this3$props$pluginIn.focus();
587
+ var _this2$props$pluginIn;
588
+ return (_this2$props$pluginIn = _this2.props.pluginInjectionApi) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.core) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.actions) === null || _this2$props$pluginIn === void 0 ? void 0 : _this2$props$pluginIn.focus();
590
589
  });
591
590
  };
592
591
  return jsx(Popup, {
@@ -648,7 +647,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
648
647
  }, {
649
648
  key: "render",
650
649
  value: function render() {
651
- var _this4 = this,
650
+ var _this3 = this,
652
651
  _tableButton,
653
652
  _tableButton2,
654
653
  _tableButton3,
@@ -717,7 +716,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
717
716
  return jsx(ToolbarButton, {
718
717
  item: btn,
719
718
  testId: String(btn.content),
720
- ref: _this4.handleToolbarRef(btn.value.name),
719
+ ref: _this3.handleToolbarRef(btn.value.name),
721
720
  key: btn.value.name,
722
721
  spacing: isReducedSpacing ? 'none' : 'default',
723
722
  disabled: isDisabled || btn.isDisabled,
@@ -727,7 +726,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
727
726
  "aria-label": btn['aria-label'],
728
727
  "aria-haspopup": btn['aria-haspopup'],
729
728
  "aria-keyshortcuts": btn['aria-keyshortcuts'],
730
- onItemClick: _this4.insertToolbarMenuItem
729
+ onItemClick: _this3.insertToolbarMenuItem
731
730
  });
732
731
  }), this.props.tableSelectorSupported && (isTableButtonVisible || isTableSizeVisible) && jsx("div", {
733
732
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
@@ -1,3 +1,3 @@
1
1
  export { insertBlockPlugin } from './plugin';
2
- export type { InsertBlockPlugin, InsertBlockOptions } from './plugin';
2
+ export type { InsertBlockPlugin, InsertBlockOptions, InsertBlockPluginState } from './plugin';
3
3
  export type { InsertBlockPluginDependencies } from './types';
@@ -1,5 +1,7 @@
1
+ import { ToolbarSize } from '@atlaskit/editor-common/types';
1
2
  import type { EditorAppearance, NextEditorPlugin } from '@atlaskit/editor-common/types';
2
3
  import type { InsertBlockPluginDependencies } from './types';
4
+ export declare const toolbarSizeToButtons: (toolbarSize: ToolbarSize, appearance?: EditorAppearance) => 2 | 0 | 3 | 5 | 7;
3
5
  export interface InsertBlockOptions {
4
6
  allowTables?: boolean;
5
7
  allowExpand?: boolean;
@@ -10,11 +12,16 @@ export interface InsertBlockOptions {
10
12
  tableSelectorSupported?: boolean;
11
13
  appearance?: EditorAppearance;
12
14
  }
15
+ export interface InsertBlockPluginState {
16
+ showElementBrowser: boolean;
17
+ menuBrowserOpen?: boolean;
18
+ }
13
19
  export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
14
20
  pluginConfiguration: InsertBlockOptions | undefined;
15
21
  dependencies: InsertBlockPluginDependencies;
16
22
  actions: {
17
23
  toggleAdditionalMenu: () => void;
18
24
  };
25
+ sharedState: InsertBlockPluginState | undefined;
19
26
  }>;
20
27
  export declare const insertBlockPlugin: InsertBlockPlugin;
@@ -0,0 +1,8 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
+ type ToggleInsertBlockPmPluginState = {
4
+ showElementBrowser: boolean;
5
+ };
6
+ export declare const toggleInsertBlockPmKey: PluginKey<ToggleInsertBlockPmPluginState>;
7
+ export declare const toggleInsertBlockPmPlugin: () => SafePlugin<ToggleInsertBlockPmPluginState>;
8
+ export {};
@@ -15,5 +15,6 @@ export declare const InsertMenuRail: ({ editorView, options, api, }: {
15
15
  actions: {
16
16
  toggleAdditionalMenu: () => void;
17
17
  };
18
+ sharedState: import("../../plugin").InsertBlockPluginState | undefined;
18
19
  }> | undefined;
19
20
  }) => JSX.Element;
@@ -10,17 +10,13 @@ export declare const tableButtonWrapper: ({ isTableSelectorOpen, isButtonDisable
10
10
  isTableSelectorOpen: boolean;
11
11
  isButtonDisabled: boolean | undefined;
12
12
  }) => import("@emotion/react").SerializedStyles;
13
- type InternalActions = {
14
- registerToggleDropdownMenuOptions?: (cb: () => void) => () => void;
15
- };
16
- export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps & InternalActions, State> {
13
+ export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps, State> {
17
14
  private dropdownButtonRef?;
18
15
  private emojiButtonRef?;
19
16
  private mediaButtonRef?;
20
17
  private plusButtonRef?;
21
18
  private tableButtonRef;
22
19
  private tableSelectorButtonRef;
23
- private unregisterToggleDropdownMenuOptions;
24
20
  state: State;
25
21
  static getDerivedStateFromProps(props: Props & WrappedComponentProps, state: State): State | null;
26
22
  componentDidUpdate(prevProps: Props): void;
@@ -38,8 +34,6 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
38
34
  private handleSelectedTableSize;
39
35
  private handleTableSelectorPressEscape;
40
36
  private handleTableSelectorClickOutside;
41
- componentDidMount: () => void;
42
- componentWillUnmount: () => void;
43
37
  render(): jsx.JSX.Element | null;
44
38
  private handleClick;
45
39
  private handleOpenByKeyboard;
@@ -63,7 +57,7 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
63
57
  private insertToolbarMenuItem;
64
58
  private insertInsertMenuItem;
65
59
  }
66
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps & InternalActions>> & {
67
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps & InternalActions>;
60
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
61
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
68
62
  };
69
63
  export default _default;
@@ -10,6 +10,7 @@ import type { InsertBlockPlugin } from '../../index';
10
10
  import type { BlockMenuItem } from './create-items';
11
11
  export interface Props {
12
12
  buttons: number;
13
+ showElementBrowser: boolean;
13
14
  isReducedSpacing: boolean;
14
15
  isDisabled?: boolean;
15
16
  isTypeAheadAllowed?: boolean;
@@ -1,3 +1,3 @@
1
1
  export { insertBlockPlugin } from './plugin';
2
- export type { InsertBlockPlugin, InsertBlockOptions } from './plugin';
2
+ export type { InsertBlockPlugin, InsertBlockOptions, InsertBlockPluginState } from './plugin';
3
3
  export type { InsertBlockPluginDependencies } from './types';
@@ -1,5 +1,7 @@
1
+ import { ToolbarSize } from '@atlaskit/editor-common/types';
1
2
  import type { EditorAppearance, NextEditorPlugin } from '@atlaskit/editor-common/types';
2
3
  import type { InsertBlockPluginDependencies } from './types';
4
+ export declare const toolbarSizeToButtons: (toolbarSize: ToolbarSize, appearance?: EditorAppearance) => 2 | 0 | 3 | 5 | 7;
3
5
  export interface InsertBlockOptions {
4
6
  allowTables?: boolean;
5
7
  allowExpand?: boolean;
@@ -10,11 +12,16 @@ export interface InsertBlockOptions {
10
12
  tableSelectorSupported?: boolean;
11
13
  appearance?: EditorAppearance;
12
14
  }
15
+ export interface InsertBlockPluginState {
16
+ showElementBrowser: boolean;
17
+ menuBrowserOpen?: boolean;
18
+ }
13
19
  export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
14
20
  pluginConfiguration: InsertBlockOptions | undefined;
15
21
  dependencies: InsertBlockPluginDependencies;
16
22
  actions: {
17
23
  toggleAdditionalMenu: () => void;
18
24
  };
25
+ sharedState: InsertBlockPluginState | undefined;
19
26
  }>;
20
27
  export declare const insertBlockPlugin: InsertBlockPlugin;
@@ -0,0 +1,8 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
+ type ToggleInsertBlockPmPluginState = {
4
+ showElementBrowser: boolean;
5
+ };
6
+ export declare const toggleInsertBlockPmKey: PluginKey<ToggleInsertBlockPmPluginState>;
7
+ export declare const toggleInsertBlockPmPlugin: () => SafePlugin<ToggleInsertBlockPmPluginState>;
8
+ export {};
@@ -15,5 +15,6 @@ export declare const InsertMenuRail: ({ editorView, options, api, }: {
15
15
  actions: {
16
16
  toggleAdditionalMenu: () => void;
17
17
  };
18
+ sharedState: import("../../plugin").InsertBlockPluginState | undefined;
18
19
  }> | undefined;
19
20
  }) => JSX.Element;
@@ -10,17 +10,13 @@ export declare const tableButtonWrapper: ({ isTableSelectorOpen, isButtonDisable
10
10
  isTableSelectorOpen: boolean;
11
11
  isButtonDisabled: boolean | undefined;
12
12
  }) => import("@emotion/react").SerializedStyles;
13
- type InternalActions = {
14
- registerToggleDropdownMenuOptions?: (cb: () => void) => () => void;
15
- };
16
- export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps & InternalActions, State> {
13
+ export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps, State> {
17
14
  private dropdownButtonRef?;
18
15
  private emojiButtonRef?;
19
16
  private mediaButtonRef?;
20
17
  private plusButtonRef?;
21
18
  private tableButtonRef;
22
19
  private tableSelectorButtonRef;
23
- private unregisterToggleDropdownMenuOptions;
24
20
  state: State;
25
21
  static getDerivedStateFromProps(props: Props & WrappedComponentProps, state: State): State | null;
26
22
  componentDidUpdate(prevProps: Props): void;
@@ -38,8 +34,6 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
38
34
  private handleSelectedTableSize;
39
35
  private handleTableSelectorPressEscape;
40
36
  private handleTableSelectorClickOutside;
41
- componentDidMount: () => void;
42
- componentWillUnmount: () => void;
43
37
  render(): jsx.JSX.Element | null;
44
38
  private handleClick;
45
39
  private handleOpenByKeyboard;
@@ -63,7 +57,7 @@ export declare class ToolbarInsertBlock extends React.PureComponent<Props & Wrap
63
57
  private insertToolbarMenuItem;
64
58
  private insertInsertMenuItem;
65
59
  }
66
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps & InternalActions>> & {
67
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps & InternalActions>;
60
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
61
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
68
62
  };
69
63
  export default _default;
@@ -10,6 +10,7 @@ import type { InsertBlockPlugin } from '../../index';
10
10
  import type { BlockMenuItem } from './create-items';
11
11
  export interface Props {
12
12
  buttons: number;
13
+ showElementBrowser: boolean;
13
14
  isReducedSpacing: boolean;
14
15
  isDisabled?: boolean;
15
16
  isTypeAheadAllowed?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.2.12",
3
+ "version": "2.3.0",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/editor-shared-styles": "^3.0.0",
61
61
  "@atlaskit/emoji": "^67.8.0",
62
62
  "@atlaskit/heading": "2.4.6",
63
- "@atlaskit/icon": "^22.21.0",
63
+ "@atlaskit/icon": "^22.22.0",
64
64
  "@atlaskit/icon-lab": "^1.0.0",
65
65
  "@atlaskit/platform-feature-flags": "^0.3.0",
66
66
  "@atlaskit/primitives": "^12.2.0",