@atlaskit/editor-plugin-insert-block 4.3.7 → 4.3.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
+ ## 4.3.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`51f3f2db61f6e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/51f3f2db61f6e) -
8
+ Update toolbar config across plugins
9
+ - Updated dependencies
10
+
11
+ ## 4.3.8
12
+
13
+ ### Patch Changes
14
+
15
+ - [`d8f08e44cd911`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d8f08e44cd911) -
16
+ ED-29108: tidy up sharedPluginStateHookMigratorFactory in insert-block
17
+ - Updated dependencies
18
+
3
19
  ## 4.3.7
4
20
 
5
21
  ### Patch Changes
@@ -251,38 +251,6 @@ var selector = function selector(states) {
251
251
  activeLinkMark: (_states$hyperlinkStat2 = states.hyperlinkState) === null || _states$hyperlinkStat2 === void 0 ? void 0 : _states$hyperlinkStat2.activeLinkMark
252
252
  };
253
253
  };
254
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
255
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity'], selector);
256
- }, function (api) {
257
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity']),
258
- dateState = _useSharedPluginState.dateState,
259
- hyperlinkState = _useSharedPluginState.hyperlinkState,
260
- imageUploadState = _useSharedPluginState.imageUploadState,
261
- mentionState = _useSharedPluginState.mentionState,
262
- emojiState = _useSharedPluginState.emojiState,
263
- blockTypeState = _useSharedPluginState.blockTypeState,
264
- mediaState = _useSharedPluginState.mediaState,
265
- typeAheadState = _useSharedPluginState.typeAheadState,
266
- placeholderTextState = _useSharedPluginState.placeholderTextState,
267
- insertBlockState = _useSharedPluginState.insertBlockState,
268
- connectivityState = _useSharedPluginState.connectivityState;
269
- return {
270
- emojiProviderSelector: emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider,
271
- showMediaPicker: mediaState === null || mediaState === void 0 ? void 0 : mediaState.showMediaPicker,
272
- mediaAllowsUploads: mediaState === null || mediaState === void 0 ? void 0 : mediaState.allowsUploads,
273
- showElementBrowser: insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.showElementBrowser,
274
- isTypeAheadAllowed: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed,
275
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider,
276
- canInsertMention: mentionState === null || mentionState === void 0 ? void 0 : mentionState.canInsertMention,
277
- dateEnabled: dateState === null || dateState === void 0 ? void 0 : dateState.isInitialised,
278
- placeholderTextAllowInserting: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.allowInserting,
279
- connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode,
280
- imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
281
- availableWrapperBlockTypes: blockTypeState === null || blockTypeState === void 0 ? void 0 : blockTypeState.availableWrapperBlockTypes,
282
- canInsertLink: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.canInsertLink,
283
- activeLinkMark: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.activeLinkMark
284
- };
285
- });
286
254
  function ToolbarInsertBlockWithInjectionApi(_ref4) {
287
255
  var _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
288
256
  var editorView = _ref4.editorView,
@@ -300,21 +268,21 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
300
268
  options = _ref4.options,
301
269
  appearance = _ref4.appearance;
302
270
  var buttons = toolbarSizeToButtons(toolbarSize, appearance);
303
- var _useSharedState = useSharedState(pluginInjectionApi),
304
- emojiProviderSelector = _useSharedState.emojiProviderSelector,
305
- showMediaPicker = _useSharedState.showMediaPicker,
306
- mediaAllowsUploads = _useSharedState.mediaAllowsUploads,
307
- showElementBrowser = _useSharedState.showElementBrowser,
308
- isTypeAheadAllowed = _useSharedState.isTypeAheadAllowed,
309
- mentionProvider = _useSharedState.mentionProvider,
310
- canInsertMention = _useSharedState.canInsertMention,
311
- dateEnabled = _useSharedState.dateEnabled,
312
- placeholderTextAllowInserting = _useSharedState.placeholderTextAllowInserting,
313
- connectivityMode = _useSharedState.connectivityMode,
314
- imageUploadEnabled = _useSharedState.imageUploadEnabled,
315
- availableWrapperBlockTypes = _useSharedState.availableWrapperBlockTypes,
316
- canInsertLink = _useSharedState.canInsertLink,
317
- activeLinkMark = _useSharedState.activeLinkMark;
271
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity'], selector),
272
+ emojiProviderSelector = _useSharedPluginState.emojiProviderSelector,
273
+ showMediaPicker = _useSharedPluginState.showMediaPicker,
274
+ mediaAllowsUploads = _useSharedPluginState.mediaAllowsUploads,
275
+ showElementBrowser = _useSharedPluginState.showElementBrowser,
276
+ isTypeAheadAllowed = _useSharedPluginState.isTypeAheadAllowed,
277
+ mentionProvider = _useSharedPluginState.mentionProvider,
278
+ canInsertMention = _useSharedPluginState.canInsertMention,
279
+ dateEnabled = _useSharedPluginState.dateEnabled,
280
+ placeholderTextAllowInserting = _useSharedPluginState.placeholderTextAllowInserting,
281
+ connectivityMode = _useSharedPluginState.connectivityMode,
282
+ imageUploadEnabled = _useSharedPluginState.imageUploadEnabled,
283
+ availableWrapperBlockTypes = _useSharedPluginState.availableWrapperBlockTypes,
284
+ canInsertLink = _useSharedPluginState.canInsertLink,
285
+ activeLinkMark = _useSharedPluginState.activeLinkMark;
318
286
  var emojiProviderPromise = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'emoji.emojiProviderPromise', {
319
287
  disabled: !(0, _experiments.editorExperiment)('platform_editor_prevent_toolbar_layout_shifts', true)
320
288
  });
@@ -35,15 +35,6 @@ var selector = function selector(states) {
35
35
  connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
36
36
  };
37
37
  };
38
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
39
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], selector);
40
- }, function (api) {
41
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['connectivity']),
42
- connectivityState = _useSharedPluginState.connectivityState;
43
- return {
44
- connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
45
- };
46
- });
47
38
  var InsertMenu = function InsertMenu(_ref) {
48
39
  var _pluginInjectionApi$q6, _pluginInjectionApi$q7;
49
40
  var editorView = _ref.editorView,
@@ -120,8 +111,8 @@ var InsertMenu = function InsertMenu(_ref) {
120
111
  }
121
112
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 || _pluginInjectionApi$q.actions.insertItem(item, _analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
122
113
  }, [editorView, toggleVisiblity, pluginInjectionApi]);
123
- var _useSharedState = useSharedState(pluginInjectionApi),
124
- connectivityMode = _useSharedState.connectivityMode;
114
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['connectivity'], selector),
115
+ connectivityMode = _useSharedPluginState.connectivityMode;
125
116
  var getItems = (0, _react.useCallback)(function (query, category) {
126
117
  var filterForPinWhiteboardsExperiment = function filterForPinWhiteboardsExperiment(featuredItems) {
127
118
  // Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
@@ -26,48 +26,21 @@ var selector = function selector(states) {
26
26
  mediaAllowsUploads: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.allowsUploads
27
27
  };
28
28
  };
29
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
30
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText'], selector);
31
- }, function (api) {
32
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
33
- dateState = _useSharedPluginState.dateState,
34
- hyperlinkState = _useSharedPluginState.hyperlinkState,
35
- imageUploadState = _useSharedPluginState.imageUploadState,
36
- mentionState = _useSharedPluginState.mentionState,
37
- emojiState = _useSharedPluginState.emojiState,
38
- blockTypeState = _useSharedPluginState.blockTypeState,
39
- mediaState = _useSharedPluginState.mediaState,
40
- typeAheadState = _useSharedPluginState.typeAheadState,
41
- placeholderTextState = _useSharedPluginState.placeholderTextState;
42
- return {
43
- dateEnabled: dateState === null || dateState === void 0 ? void 0 : dateState.isInitialised,
44
- canInsertLink: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.canInsertLink,
45
- activeLinkMark: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.activeLinkMark,
46
- isTypeAheadAllowed: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed,
47
- availableWrapperBlockTypes: blockTypeState === null || blockTypeState === void 0 ? void 0 : blockTypeState.availableWrapperBlockTypes,
48
- imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
49
- placeholderTextAllowInserting: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.allowInserting,
50
- emojiProvider: emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider,
51
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider,
52
- canInsertMention: mentionState === null || mentionState === void 0 ? void 0 : mentionState.canInsertMention,
53
- mediaAllowsUploads: mediaState === null || mediaState === void 0 ? void 0 : mediaState.allowsUploads
54
- };
55
- });
56
29
  var useInsertMenuRailItems = exports.useInsertMenuRailItems = function useInsertMenuRailItems(editorView, options, api) {
57
30
  var _useIntl = (0, _reactIntlNext.useIntl)(),
58
31
  formatMessage = _useIntl.formatMessage;
59
- var _useSharedState = useSharedState(api),
60
- dateEnabled = _useSharedState.dateEnabled,
61
- canInsertLink = _useSharedState.canInsertLink,
62
- activeLinkMark = _useSharedState.activeLinkMark,
63
- isTypeAheadAllowed = _useSharedState.isTypeAheadAllowed,
64
- availableWrapperBlockTypes = _useSharedState.availableWrapperBlockTypes,
65
- imageUploadEnabled = _useSharedState.imageUploadEnabled,
66
- placeholderTextAllowInserting = _useSharedState.placeholderTextAllowInserting,
67
- emojiProvider = _useSharedState.emojiProvider,
68
- mentionProvider = _useSharedState.mentionProvider,
69
- canInsertMention = _useSharedState.canInsertMention,
70
- mediaAllowsUploads = _useSharedState.mediaAllowsUploads;
32
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText'], selector),
33
+ dateEnabled = _useSharedPluginState.dateEnabled,
34
+ canInsertLink = _useSharedPluginState.canInsertLink,
35
+ activeLinkMark = _useSharedPluginState.activeLinkMark,
36
+ isTypeAheadAllowed = _useSharedPluginState.isTypeAheadAllowed,
37
+ availableWrapperBlockTypes = _useSharedPluginState.availableWrapperBlockTypes,
38
+ imageUploadEnabled = _useSharedPluginState.imageUploadEnabled,
39
+ placeholderTextAllowInserting = _useSharedPluginState.placeholderTextAllowInserting,
40
+ emojiProvider = _useSharedPluginState.emojiProvider,
41
+ mentionProvider = _useSharedPluginState.mentionProvider,
42
+ canInsertMention = _useSharedPluginState.canInsertMention,
43
+ mediaAllowsUploads = _useSharedPluginState.mediaAllowsUploads;
71
44
  var _useMemo = (0, _react.useMemo)(function () {
72
45
  return (0, _createItems.createItems)({
73
46
  isTypeAheadAllowed: Boolean(isTypeAheadAllowed),
@@ -8,6 +8,8 @@ exports.getToolbarComponents = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _toolbar = require("@atlaskit/editor-common/toolbar");
11
+ var _editorToolbar = require("@atlaskit/editor-toolbar");
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
13
  var _EmojiButton = require("./toolbar-components/EmojiButton");
12
14
  var _ImageButton = require("./toolbar-components/ImageButton");
13
15
  var _InsertButton = require("./toolbar-components/InsertButton");
@@ -62,7 +64,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
62
64
  type: _toolbar.INSERT_BLOCK_SECTION.type,
63
65
  key: _toolbar.INSERT_BLOCK_SECTION.key,
64
66
  rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.TASK_LIST_GROUP.key]
65
- }]
67
+ }],
68
+ component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
69
+ var children = _ref2.children;
70
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
71
+ above: "lg"
72
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
73
+ } : undefined
66
74
  }, {
67
75
  type: _toolbar.TASK_LIST_BUTTON.type,
68
76
  key: _toolbar.TASK_LIST_BUTTON.key,
@@ -83,7 +91,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
83
91
  type: _toolbar.INSERT_BLOCK_SECTION.type,
84
92
  key: _toolbar.INSERT_BLOCK_SECTION.key,
85
93
  rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.MEDIA_GROUP.key]
86
- }]
94
+ }],
95
+ component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref3) {
96
+ var children = _ref3.children;
97
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
98
+ above: "lg"
99
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
100
+ } : undefined
87
101
  }, {
88
102
  type: _toolbar.MEDIA_BUTTON.type,
89
103
  key: _toolbar.MEDIA_BUTTON.key,
@@ -106,7 +120,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
106
120
  type: _toolbar.INSERT_BLOCK_SECTION.type,
107
121
  key: _toolbar.INSERT_BLOCK_SECTION.key,
108
122
  rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.MENTION_GROUP.key]
109
- }]
123
+ }],
124
+ component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref4) {
125
+ var children = _ref4.children;
126
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
127
+ above: "lg"
128
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
129
+ } : undefined
110
130
  }, {
111
131
  type: _toolbar.MENTION_BUTTON.type,
112
132
  key: _toolbar.MENTION_BUTTON.key,
@@ -127,7 +147,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
127
147
  type: _toolbar.INSERT_BLOCK_SECTION.type,
128
148
  key: _toolbar.INSERT_BLOCK_SECTION.key,
129
149
  rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.EMOJI_GROUP.key]
130
- }]
150
+ }],
151
+ component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref5) {
152
+ var children = _ref5.children;
153
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
154
+ above: "lg"
155
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
156
+ } : undefined
131
157
  }, {
132
158
  type: _toolbar.EMOJI_BUTTON.type,
133
159
  key: _toolbar.EMOJI_BUTTON.key,
@@ -148,7 +174,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
148
174
  type: _toolbar.INSERT_BLOCK_SECTION.type,
149
175
  key: _toolbar.INSERT_BLOCK_SECTION.key,
150
176
  rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.LAYOUT_GROUP.key]
151
- }]
177
+ }],
178
+ component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref6) {
179
+ var children = _ref6.children;
180
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
181
+ above: "lg"
182
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
183
+ } : undefined
152
184
  }, {
153
185
  type: _toolbar.LAYOUT_BUTTON.type,
154
186
  key: _toolbar.LAYOUT_BUTTON.key,
@@ -169,7 +201,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
169
201
  type: _toolbar.INSERT_BLOCK_SECTION.type,
170
202
  key: _toolbar.INSERT_BLOCK_SECTION.key,
171
203
  rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.TABLE_GROUP.key]
172
- }]
204
+ }],
205
+ component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref7) {
206
+ var children = _ref7.children;
207
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
208
+ above: "md"
209
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
210
+ } : undefined
173
211
  }, {
174
212
  type: _toolbar.TABLE_BUTTON.type,
175
213
  key: _toolbar.TABLE_BUTTON.key,
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
4
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
6
6
  import { ToolbarSize } from '@atlaskit/editor-common/types';
7
7
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
@@ -235,39 +235,6 @@ const selector = states => {
235
235
  activeLinkMark: (_states$hyperlinkStat2 = states.hyperlinkState) === null || _states$hyperlinkStat2 === void 0 ? void 0 : _states$hyperlinkStat2.activeLinkMark
236
236
  };
237
237
  };
238
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
239
- return useSharedPluginStateWithSelector(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity'], selector);
240
- }, api => {
241
- const {
242
- dateState,
243
- hyperlinkState,
244
- imageUploadState,
245
- mentionState,
246
- emojiState,
247
- blockTypeState,
248
- mediaState,
249
- typeAheadState,
250
- placeholderTextState,
251
- insertBlockState,
252
- connectivityState
253
- } = useSharedPluginState(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity']);
254
- return {
255
- emojiProviderSelector: emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider,
256
- showMediaPicker: mediaState === null || mediaState === void 0 ? void 0 : mediaState.showMediaPicker,
257
- mediaAllowsUploads: mediaState === null || mediaState === void 0 ? void 0 : mediaState.allowsUploads,
258
- showElementBrowser: insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.showElementBrowser,
259
- isTypeAheadAllowed: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed,
260
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider,
261
- canInsertMention: mentionState === null || mentionState === void 0 ? void 0 : mentionState.canInsertMention,
262
- dateEnabled: dateState === null || dateState === void 0 ? void 0 : dateState.isInitialised,
263
- placeholderTextAllowInserting: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.allowInserting,
264
- connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode,
265
- imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
266
- availableWrapperBlockTypes: blockTypeState === null || blockTypeState === void 0 ? void 0 : blockTypeState.availableWrapperBlockTypes,
267
- canInsertLink: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.canInsertLink,
268
- activeLinkMark: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.activeLinkMark
269
- };
270
- });
271
238
  function ToolbarInsertBlockWithInjectionApi({
272
239
  editorView,
273
240
  editorActions,
@@ -301,7 +268,7 @@ function ToolbarInsertBlockWithInjectionApi({
301
268
  availableWrapperBlockTypes,
302
269
  canInsertLink,
303
270
  activeLinkMark
304
- } = useSharedState(pluginInjectionApi);
271
+ } = useSharedPluginStateWithSelector(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity'], selector);
305
272
  const emojiProviderPromise = useSharedPluginStateSelector(pluginInjectionApi, 'emoji.emojiProviderPromise', {
306
273
  disabled: !editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true)
307
274
  });
@@ -12,7 +12,7 @@ import { useIntl } from 'react-intl-next';
12
12
  import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
13
13
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
14
14
  import { ELEMENT_ITEM_HEIGHT, ElementBrowser } from '@atlaskit/editor-common/element-browser';
15
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
15
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
16
16
  import { messages, IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
17
17
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
18
18
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -25,16 +25,6 @@ const selector = states => {
25
25
  connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
26
26
  };
27
27
  };
28
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
29
- return useSharedPluginStateWithSelector(api, ['connectivity'], selector);
30
- }, api => {
31
- const {
32
- connectivityState
33
- } = useSharedPluginState(api, ['connectivity']);
34
- return {
35
- connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
36
- };
37
- });
38
28
  const InsertMenu = ({
39
29
  editorView,
40
30
  dropdownItems,
@@ -101,7 +91,7 @@ const InsertMenu = ({
101
91
  }, [editorView, toggleVisiblity, pluginInjectionApi]);
102
92
  const {
103
93
  connectivityMode
104
- } = useSharedState(pluginInjectionApi);
94
+ } = useSharedPluginStateWithSelector(pluginInjectionApi, ['connectivity'], selector);
105
95
  const getItems = useCallback((query, category) => {
106
96
  const filterForPinWhiteboardsExperiment = featuredItems => {
107
97
  // Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { createItems } from '../ToolbarInsertBlock/create-items';
5
5
  const selector = states => {
6
6
  var _states$dateState, _states$hyperlinkStat, _states$hyperlinkStat2, _states$typeAheadStat, _states$blockTypeStat, _states$imageUploadSt, _states$placeholderTe, _states$emojiState, _states$mentionState, _states$mentionState2, _states$mediaState;
@@ -18,34 +18,6 @@ const selector = states => {
18
18
  mediaAllowsUploads: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.allowsUploads
19
19
  };
20
20
  };
21
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
22
- return useSharedPluginStateWithSelector(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText'], selector);
23
- }, api => {
24
- const {
25
- dateState,
26
- hyperlinkState,
27
- imageUploadState,
28
- mentionState,
29
- emojiState,
30
- blockTypeState,
31
- mediaState,
32
- typeAheadState,
33
- placeholderTextState
34
- } = useSharedPluginState(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']);
35
- return {
36
- dateEnabled: dateState === null || dateState === void 0 ? void 0 : dateState.isInitialised,
37
- canInsertLink: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.canInsertLink,
38
- activeLinkMark: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.activeLinkMark,
39
- isTypeAheadAllowed: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed,
40
- availableWrapperBlockTypes: blockTypeState === null || blockTypeState === void 0 ? void 0 : blockTypeState.availableWrapperBlockTypes,
41
- imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
42
- placeholderTextAllowInserting: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.allowInserting,
43
- emojiProvider: emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider,
44
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider,
45
- canInsertMention: mentionState === null || mentionState === void 0 ? void 0 : mentionState.canInsertMention,
46
- mediaAllowsUploads: mediaState === null || mediaState === void 0 ? void 0 : mediaState.allowsUploads
47
- };
48
- });
49
21
  export const useInsertMenuRailItems = (editorView, options, api) => {
50
22
  const {
51
23
  formatMessage
@@ -62,7 +34,7 @@ export const useInsertMenuRailItems = (editorView, options, api) => {
62
34
  mentionProvider,
63
35
  canInsertMention,
64
36
  mediaAllowsUploads
65
- } = useSharedState(api);
37
+ } = useSharedPluginStateWithSelector(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText'], selector);
66
38
  const [_, dropdownItems] = useMemo(() => {
67
39
  return createItems({
68
40
  isTypeAheadAllowed: Boolean(isTypeAheadAllowed),
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
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 } from '@atlaskit/editor-common/toolbar';
3
+ import { Show, ToolbarButtonGroup } from '@atlaskit/editor-toolbar';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
5
  import { EmojiButton } from './toolbar-components/EmojiButton';
4
6
  import { ImageButton } from './toolbar-components/ImageButton';
5
7
  import { InsertButton } from './toolbar-components/InsertButton';
@@ -53,7 +55,12 @@ export const getToolbarComponents = ({
53
55
  type: INSERT_BLOCK_SECTION.type,
54
56
  key: INSERT_BLOCK_SECTION.key,
55
57
  rank: INSERT_BLOCK_SECTION_RANK[TASK_LIST_GROUP.key]
56
- }]
58
+ }],
59
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
60
+ children
61
+ }) => /*#__PURE__*/React.createElement(Show, {
62
+ above: "lg"
63
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
57
64
  }, {
58
65
  type: TASK_LIST_BUTTON.type,
59
66
  key: TASK_LIST_BUTTON.key,
@@ -72,7 +79,12 @@ export const getToolbarComponents = ({
72
79
  type: INSERT_BLOCK_SECTION.type,
73
80
  key: INSERT_BLOCK_SECTION.key,
74
81
  rank: INSERT_BLOCK_SECTION_RANK[MEDIA_GROUP.key]
75
- }]
82
+ }],
83
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
84
+ children
85
+ }) => /*#__PURE__*/React.createElement(Show, {
86
+ above: "lg"
87
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
76
88
  }, {
77
89
  type: MEDIA_BUTTON.type,
78
90
  key: MEDIA_BUTTON.key,
@@ -93,7 +105,12 @@ export const getToolbarComponents = ({
93
105
  type: INSERT_BLOCK_SECTION.type,
94
106
  key: INSERT_BLOCK_SECTION.key,
95
107
  rank: INSERT_BLOCK_SECTION_RANK[MENTION_GROUP.key]
96
- }]
108
+ }],
109
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
110
+ children
111
+ }) => /*#__PURE__*/React.createElement(Show, {
112
+ above: "lg"
113
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
97
114
  }, {
98
115
  type: MENTION_BUTTON.type,
99
116
  key: MENTION_BUTTON.key,
@@ -112,7 +129,12 @@ export const getToolbarComponents = ({
112
129
  type: INSERT_BLOCK_SECTION.type,
113
130
  key: INSERT_BLOCK_SECTION.key,
114
131
  rank: INSERT_BLOCK_SECTION_RANK[EMOJI_GROUP.key]
115
- }]
132
+ }],
133
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
134
+ children
135
+ }) => /*#__PURE__*/React.createElement(Show, {
136
+ above: "lg"
137
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
116
138
  }, {
117
139
  type: EMOJI_BUTTON.type,
118
140
  key: EMOJI_BUTTON.key,
@@ -131,7 +153,12 @@ export const getToolbarComponents = ({
131
153
  type: INSERT_BLOCK_SECTION.type,
132
154
  key: INSERT_BLOCK_SECTION.key,
133
155
  rank: INSERT_BLOCK_SECTION_RANK[LAYOUT_GROUP.key]
134
- }]
156
+ }],
157
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
158
+ children
159
+ }) => /*#__PURE__*/React.createElement(Show, {
160
+ above: "lg"
161
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
135
162
  }, {
136
163
  type: LAYOUT_BUTTON.type,
137
164
  key: LAYOUT_BUTTON.key,
@@ -150,7 +177,12 @@ export const getToolbarComponents = ({
150
177
  type: INSERT_BLOCK_SECTION.type,
151
178
  key: INSERT_BLOCK_SECTION.key,
152
179
  rank: INSERT_BLOCK_SECTION_RANK[TABLE_GROUP.key]
153
- }]
180
+ }],
181
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
182
+ children
183
+ }) => /*#__PURE__*/React.createElement(Show, {
184
+ above: "md"
185
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined
154
186
  }, {
155
187
  type: TABLE_BUTTON.type,
156
188
  key: TABLE_BUTTON.key,
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
4
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
6
6
  import { ToolbarSize } from '@atlaskit/editor-common/types';
7
7
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
@@ -241,38 +241,6 @@ var selector = function selector(states) {
241
241
  activeLinkMark: (_states$hyperlinkStat2 = states.hyperlinkState) === null || _states$hyperlinkStat2 === void 0 ? void 0 : _states$hyperlinkStat2.activeLinkMark
242
242
  };
243
243
  };
244
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
245
- return useSharedPluginStateWithSelector(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity'], selector);
246
- }, function (api) {
247
- var _useSharedPluginState = useSharedPluginState(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity']),
248
- dateState = _useSharedPluginState.dateState,
249
- hyperlinkState = _useSharedPluginState.hyperlinkState,
250
- imageUploadState = _useSharedPluginState.imageUploadState,
251
- mentionState = _useSharedPluginState.mentionState,
252
- emojiState = _useSharedPluginState.emojiState,
253
- blockTypeState = _useSharedPluginState.blockTypeState,
254
- mediaState = _useSharedPluginState.mediaState,
255
- typeAheadState = _useSharedPluginState.typeAheadState,
256
- placeholderTextState = _useSharedPluginState.placeholderTextState,
257
- insertBlockState = _useSharedPluginState.insertBlockState,
258
- connectivityState = _useSharedPluginState.connectivityState;
259
- return {
260
- emojiProviderSelector: emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider,
261
- showMediaPicker: mediaState === null || mediaState === void 0 ? void 0 : mediaState.showMediaPicker,
262
- mediaAllowsUploads: mediaState === null || mediaState === void 0 ? void 0 : mediaState.allowsUploads,
263
- showElementBrowser: insertBlockState === null || insertBlockState === void 0 ? void 0 : insertBlockState.showElementBrowser,
264
- isTypeAheadAllowed: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed,
265
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider,
266
- canInsertMention: mentionState === null || mentionState === void 0 ? void 0 : mentionState.canInsertMention,
267
- dateEnabled: dateState === null || dateState === void 0 ? void 0 : dateState.isInitialised,
268
- placeholderTextAllowInserting: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.allowInserting,
269
- connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode,
270
- imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
271
- availableWrapperBlockTypes: blockTypeState === null || blockTypeState === void 0 ? void 0 : blockTypeState.availableWrapperBlockTypes,
272
- canInsertLink: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.canInsertLink,
273
- activeLinkMark: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.activeLinkMark
274
- };
275
- });
276
244
  function ToolbarInsertBlockWithInjectionApi(_ref4) {
277
245
  var _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
278
246
  var editorView = _ref4.editorView,
@@ -290,21 +258,21 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
290
258
  options = _ref4.options,
291
259
  appearance = _ref4.appearance;
292
260
  var buttons = toolbarSizeToButtons(toolbarSize, appearance);
293
- var _useSharedState = useSharedState(pluginInjectionApi),
294
- emojiProviderSelector = _useSharedState.emojiProviderSelector,
295
- showMediaPicker = _useSharedState.showMediaPicker,
296
- mediaAllowsUploads = _useSharedState.mediaAllowsUploads,
297
- showElementBrowser = _useSharedState.showElementBrowser,
298
- isTypeAheadAllowed = _useSharedState.isTypeAheadAllowed,
299
- mentionProvider = _useSharedState.mentionProvider,
300
- canInsertMention = _useSharedState.canInsertMention,
301
- dateEnabled = _useSharedState.dateEnabled,
302
- placeholderTextAllowInserting = _useSharedState.placeholderTextAllowInserting,
303
- connectivityMode = _useSharedState.connectivityMode,
304
- imageUploadEnabled = _useSharedState.imageUploadEnabled,
305
- availableWrapperBlockTypes = _useSharedState.availableWrapperBlockTypes,
306
- canInsertLink = _useSharedState.canInsertLink,
307
- activeLinkMark = _useSharedState.activeLinkMark;
261
+ var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText', 'insertBlock', 'connectivity'], selector),
262
+ emojiProviderSelector = _useSharedPluginState.emojiProviderSelector,
263
+ showMediaPicker = _useSharedPluginState.showMediaPicker,
264
+ mediaAllowsUploads = _useSharedPluginState.mediaAllowsUploads,
265
+ showElementBrowser = _useSharedPluginState.showElementBrowser,
266
+ isTypeAheadAllowed = _useSharedPluginState.isTypeAheadAllowed,
267
+ mentionProvider = _useSharedPluginState.mentionProvider,
268
+ canInsertMention = _useSharedPluginState.canInsertMention,
269
+ dateEnabled = _useSharedPluginState.dateEnabled,
270
+ placeholderTextAllowInserting = _useSharedPluginState.placeholderTextAllowInserting,
271
+ connectivityMode = _useSharedPluginState.connectivityMode,
272
+ imageUploadEnabled = _useSharedPluginState.imageUploadEnabled,
273
+ availableWrapperBlockTypes = _useSharedPluginState.availableWrapperBlockTypes,
274
+ canInsertLink = _useSharedPluginState.canInsertLink,
275
+ activeLinkMark = _useSharedPluginState.activeLinkMark;
308
276
  var emojiProviderPromise = useSharedPluginStateSelector(pluginInjectionApi, 'emoji.emojiProviderPromise', {
309
277
  disabled: !editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true)
310
278
  });
@@ -19,7 +19,7 @@ import { useIntl } from 'react-intl-next';
19
19
  import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
20
20
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
21
21
  import { ELEMENT_ITEM_HEIGHT, ElementBrowser } from '@atlaskit/editor-common/element-browser';
22
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
22
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
23
23
  import { messages, IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
24
24
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
25
25
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -32,15 +32,6 @@ var selector = function selector(states) {
32
32
  connectivityMode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
33
33
  };
34
34
  };
35
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
36
- return useSharedPluginStateWithSelector(api, ['connectivity'], selector);
37
- }, function (api) {
38
- var _useSharedPluginState = useSharedPluginState(api, ['connectivity']),
39
- connectivityState = _useSharedPluginState.connectivityState;
40
- return {
41
- connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
42
- };
43
- });
44
35
  var InsertMenu = function InsertMenu(_ref) {
45
36
  var _pluginInjectionApi$q6, _pluginInjectionApi$q7;
46
37
  var editorView = _ref.editorView,
@@ -117,8 +108,8 @@ var InsertMenu = function InsertMenu(_ref) {
117
108
  }
118
109
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 || _pluginInjectionApi$q.actions.insertItem(item, INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
119
110
  }, [editorView, toggleVisiblity, pluginInjectionApi]);
120
- var _useSharedState = useSharedState(pluginInjectionApi),
121
- connectivityMode = _useSharedState.connectivityMode;
111
+ var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['connectivity'], selector),
112
+ connectivityMode = _useSharedPluginState.connectivityMode;
122
113
  var getItems = useCallback(function (query, category) {
123
114
  var filterForPinWhiteboardsExperiment = function filterForPinWhiteboardsExperiment(featuredItems) {
124
115
  // Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { useMemo } from 'react';
3
3
  import { useIntl } from 'react-intl-next';
4
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { createItems } from '../ToolbarInsertBlock/create-items';
6
6
  var selector = function selector(states) {
7
7
  var _states$dateState, _states$hyperlinkStat, _states$hyperlinkStat2, _states$typeAheadStat, _states$blockTypeStat, _states$imageUploadSt, _states$placeholderTe, _states$emojiState, _states$mentionState, _states$mentionState2, _states$mediaState;
@@ -19,48 +19,21 @@ var selector = function selector(states) {
19
19
  mediaAllowsUploads: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.allowsUploads
20
20
  };
21
21
  };
22
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
23
- return useSharedPluginStateWithSelector(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText'], selector);
24
- }, function (api) {
25
- var _useSharedPluginState = useSharedPluginState(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
26
- dateState = _useSharedPluginState.dateState,
27
- hyperlinkState = _useSharedPluginState.hyperlinkState,
28
- imageUploadState = _useSharedPluginState.imageUploadState,
29
- mentionState = _useSharedPluginState.mentionState,
30
- emojiState = _useSharedPluginState.emojiState,
31
- blockTypeState = _useSharedPluginState.blockTypeState,
32
- mediaState = _useSharedPluginState.mediaState,
33
- typeAheadState = _useSharedPluginState.typeAheadState,
34
- placeholderTextState = _useSharedPluginState.placeholderTextState;
35
- return {
36
- dateEnabled: dateState === null || dateState === void 0 ? void 0 : dateState.isInitialised,
37
- canInsertLink: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.canInsertLink,
38
- activeLinkMark: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.activeLinkMark,
39
- isTypeAheadAllowed: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed,
40
- availableWrapperBlockTypes: blockTypeState === null || blockTypeState === void 0 ? void 0 : blockTypeState.availableWrapperBlockTypes,
41
- imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
42
- placeholderTextAllowInserting: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.allowInserting,
43
- emojiProvider: emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider,
44
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider,
45
- canInsertMention: mentionState === null || mentionState === void 0 ? void 0 : mentionState.canInsertMention,
46
- mediaAllowsUploads: mediaState === null || mediaState === void 0 ? void 0 : mediaState.allowsUploads
47
- };
48
- });
49
22
  export var useInsertMenuRailItems = function useInsertMenuRailItems(editorView, options, api) {
50
23
  var _useIntl = useIntl(),
51
24
  formatMessage = _useIntl.formatMessage;
52
- var _useSharedState = useSharedState(api),
53
- dateEnabled = _useSharedState.dateEnabled,
54
- canInsertLink = _useSharedState.canInsertLink,
55
- activeLinkMark = _useSharedState.activeLinkMark,
56
- isTypeAheadAllowed = _useSharedState.isTypeAheadAllowed,
57
- availableWrapperBlockTypes = _useSharedState.availableWrapperBlockTypes,
58
- imageUploadEnabled = _useSharedState.imageUploadEnabled,
59
- placeholderTextAllowInserting = _useSharedState.placeholderTextAllowInserting,
60
- emojiProvider = _useSharedState.emojiProvider,
61
- mentionProvider = _useSharedState.mentionProvider,
62
- canInsertMention = _useSharedState.canInsertMention,
63
- mediaAllowsUploads = _useSharedState.mediaAllowsUploads;
25
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText'], selector),
26
+ dateEnabled = _useSharedPluginState.dateEnabled,
27
+ canInsertLink = _useSharedPluginState.canInsertLink,
28
+ activeLinkMark = _useSharedPluginState.activeLinkMark,
29
+ isTypeAheadAllowed = _useSharedPluginState.isTypeAheadAllowed,
30
+ availableWrapperBlockTypes = _useSharedPluginState.availableWrapperBlockTypes,
31
+ imageUploadEnabled = _useSharedPluginState.imageUploadEnabled,
32
+ placeholderTextAllowInserting = _useSharedPluginState.placeholderTextAllowInserting,
33
+ emojiProvider = _useSharedPluginState.emojiProvider,
34
+ mentionProvider = _useSharedPluginState.mentionProvider,
35
+ canInsertMention = _useSharedPluginState.canInsertMention,
36
+ mediaAllowsUploads = _useSharedPluginState.mediaAllowsUploads;
64
37
  var _useMemo = useMemo(function () {
65
38
  return createItems({
66
39
  isTypeAheadAllowed: Boolean(isTypeAheadAllowed),
@@ -1,6 +1,8 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import React from 'react';
3
3
  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 } from '@atlaskit/editor-common/toolbar';
4
+ import { Show, ToolbarButtonGroup } from '@atlaskit/editor-toolbar';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
6
  import { EmojiButton } from './toolbar-components/EmojiButton';
5
7
  import { ImageButton } from './toolbar-components/ImageButton';
6
8
  import { InsertButton } from './toolbar-components/InsertButton';
@@ -55,7 +57,13 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
55
57
  type: INSERT_BLOCK_SECTION.type,
56
58
  key: INSERT_BLOCK_SECTION.key,
57
59
  rank: INSERT_BLOCK_SECTION_RANK[TASK_LIST_GROUP.key]
58
- }]
60
+ }],
61
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
62
+ var children = _ref2.children;
63
+ return /*#__PURE__*/React.createElement(Show, {
64
+ above: "lg"
65
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
66
+ } : undefined
59
67
  }, {
60
68
  type: TASK_LIST_BUTTON.type,
61
69
  key: TASK_LIST_BUTTON.key,
@@ -76,7 +84,13 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
76
84
  type: INSERT_BLOCK_SECTION.type,
77
85
  key: INSERT_BLOCK_SECTION.key,
78
86
  rank: INSERT_BLOCK_SECTION_RANK[MEDIA_GROUP.key]
79
- }]
87
+ }],
88
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref3) {
89
+ var children = _ref3.children;
90
+ return /*#__PURE__*/React.createElement(Show, {
91
+ above: "lg"
92
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
93
+ } : undefined
80
94
  }, {
81
95
  type: MEDIA_BUTTON.type,
82
96
  key: MEDIA_BUTTON.key,
@@ -99,7 +113,13 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
99
113
  type: INSERT_BLOCK_SECTION.type,
100
114
  key: INSERT_BLOCK_SECTION.key,
101
115
  rank: INSERT_BLOCK_SECTION_RANK[MENTION_GROUP.key]
102
- }]
116
+ }],
117
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref4) {
118
+ var children = _ref4.children;
119
+ return /*#__PURE__*/React.createElement(Show, {
120
+ above: "lg"
121
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
122
+ } : undefined
103
123
  }, {
104
124
  type: MENTION_BUTTON.type,
105
125
  key: MENTION_BUTTON.key,
@@ -120,7 +140,13 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
120
140
  type: INSERT_BLOCK_SECTION.type,
121
141
  key: INSERT_BLOCK_SECTION.key,
122
142
  rank: INSERT_BLOCK_SECTION_RANK[EMOJI_GROUP.key]
123
- }]
143
+ }],
144
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref5) {
145
+ var children = _ref5.children;
146
+ return /*#__PURE__*/React.createElement(Show, {
147
+ above: "lg"
148
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
149
+ } : undefined
124
150
  }, {
125
151
  type: EMOJI_BUTTON.type,
126
152
  key: EMOJI_BUTTON.key,
@@ -141,7 +167,13 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
141
167
  type: INSERT_BLOCK_SECTION.type,
142
168
  key: INSERT_BLOCK_SECTION.key,
143
169
  rank: INSERT_BLOCK_SECTION_RANK[LAYOUT_GROUP.key]
144
- }]
170
+ }],
171
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref6) {
172
+ var children = _ref6.children;
173
+ return /*#__PURE__*/React.createElement(Show, {
174
+ above: "lg"
175
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
176
+ } : undefined
145
177
  }, {
146
178
  type: LAYOUT_BUTTON.type,
147
179
  key: LAYOUT_BUTTON.key,
@@ -162,7 +194,13 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
162
194
  type: INSERT_BLOCK_SECTION.type,
163
195
  key: INSERT_BLOCK_SECTION.key,
164
196
  rank: INSERT_BLOCK_SECTION_RANK[TABLE_GROUP.key]
165
- }]
197
+ }],
198
+ component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref7) {
199
+ var children = _ref7.children;
200
+ return /*#__PURE__*/React.createElement(Show, {
201
+ above: "md"
202
+ }, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
203
+ } : undefined
166
204
  }, {
167
205
  type: TABLE_BUTTON.type,
168
206
  key: TABLE_BUTTON.key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "4.3.7",
3
+ "version": "4.3.9",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -58,8 +58,8 @@
58
58
  "@atlaskit/editor-plugin-type-ahead": "^3.1.0",
59
59
  "@atlaskit/editor-prosemirror": "7.0.0",
60
60
  "@atlaskit/editor-shared-styles": "^3.6.0",
61
- "@atlaskit/editor-toolbar": "^0.5.0",
62
- "@atlaskit/editor-toolbar-model": "^0.1.0",
61
+ "@atlaskit/editor-toolbar": "^0.6.0",
62
+ "@atlaskit/editor-toolbar-model": "^0.2.0",
63
63
  "@atlaskit/emoji": "^69.5.0",
64
64
  "@atlaskit/heading": "^5.2.0",
65
65
  "@atlaskit/icon": "^28.1.0",
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/platform-feature-flags": "^1.1.0",
68
68
  "@atlaskit/primitives": "^14.12.0",
69
69
  "@atlaskit/theme": "^20.0.0",
70
- "@atlaskit/tmp-editor-statsig": "^11.9.0",
70
+ "@atlaskit/tmp-editor-statsig": "^11.11.0",
71
71
  "@atlaskit/tokens": "^6.1.0",
72
72
  "@atlaskit/tooltip": "^20.4.0",
73
73
  "@babel/runtime": "^7.0.0",
@@ -78,7 +78,7 @@
78
78
  "react-virtualized": "^9.8.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@atlaskit/editor-common": "^107.33.0",
81
+ "@atlaskit/editor-common": "^107.34.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"