@atlaskit/editor-plugin-insert-block 26.0.2 → 27.0.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,23 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 27.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`92fc57a354c33`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92fc57a354c33) -
8
+ Clean up feature gate `platform_editor_toolbar_responsive_fixes`. The responsive toolbar behaviour
9
+ is now permanently enabled. Remove the obsolete `ToolbarWidths` and `ToolbarWidthsFullPage`
10
+ exports; consumers should use `ToolbarWidthsNext` and `ToolbarWidthsFullPageNext`. Also remove the
11
+ unread `BlockTypePluginOptions.isUndoRedoButtonsEnabled` option, which no longer affects toolbar
12
+ sizing.
13
+ - Updated dependencies
14
+
15
+ ## 26.0.3
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 26.0.2
4
22
 
5
23
  ### Patch Changes
@@ -14,7 +14,6 @@ var _types = require("@atlaskit/editor-common/types");
14
14
  var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
15
15
  var _consts = require("@atlaskit/editor-plugin-block-type/consts");
16
16
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
17
- var _fg = require("@atlaskit/platform-feature-flags/fg");
18
17
  var _toolbarActionExperiences = require("./pm-plugins/experiences/toolbar-action-experiences");
19
18
  var _toggleInsertBlock = require("./pm-plugins/toggleInsertBlock");
20
19
  var _toolbarComponents = require("./ui/toolbar-components");
@@ -25,7 +24,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
25
24
 
26
25
  var toolbarSizeToButtons = exports.toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
27
26
  // Different button numbers for full-page to better match full page toolbar breakpoints
28
- if (appearance === 'full-page' && (0, _fg.fg)('platform_editor_toolbar_responsive_fixes')) {
27
+ if (appearance === 'full-page') {
29
28
  switch (toolbarSize) {
30
29
  case _types.ToolbarSize.XXL:
31
30
  case _types.ToolbarSize.XL:
@@ -37,31 +36,17 @@ var toolbarSizeToButtons = exports.toolbarSizeToButtons = function toolbarSizeTo
37
36
  return 0;
38
37
  }
39
38
  }
40
- if ((0, _fg.fg)('platform_editor_toolbar_responsive_fixes')) {
41
- switch (toolbarSize) {
42
- case _types.ToolbarSize.XXL:
43
- case _types.ToolbarSize.XL:
44
- return 7;
45
- case _types.ToolbarSize.L:
46
- return 5;
47
- case _types.ToolbarSize.M:
48
- case _types.ToolbarSize.S:
49
- return 2;
50
- default:
51
- return 0;
52
- }
53
- } else {
54
- switch (toolbarSize) {
55
- case _types.ToolbarSize.XXL:
56
- case _types.ToolbarSize.XL:
57
- case _types.ToolbarSize.L:
58
- case _types.ToolbarSize.M:
59
- return 7;
60
- case _types.ToolbarSize.S:
61
- return 2;
62
- default:
63
- return 0;
64
- }
39
+ switch (toolbarSize) {
40
+ case _types.ToolbarSize.XXL:
41
+ case _types.ToolbarSize.XL:
42
+ return 7;
43
+ case _types.ToolbarSize.L:
44
+ return 5;
45
+ case _types.ToolbarSize.M:
46
+ case _types.ToolbarSize.S:
47
+ return 2;
48
+ default:
49
+ return 0;
65
50
  }
66
51
  };
67
52
 
@@ -12,7 +12,6 @@ var _memoize = _interopRequireDefault(require("lodash/memoize"));
12
12
  var _memoizeOne = _interopRequireDefault(require("memoize-one"));
13
13
  var _keymaps = require("@atlaskit/editor-common/keymaps");
14
14
  var _messages = require("@atlaskit/editor-common/messages");
15
- var _fg = require("@atlaskit/platform-feature-flags/fg");
16
15
  var _item = require("./item");
17
16
  var _shallowEquals = require("./shallow-equals");
18
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -219,14 +218,10 @@ var createInsertBlockItems = function createInsertBlockItems(config) {
219
218
  // correct downstream.
220
219
  var filteredItems = itemFilter ? items.filter(itemFilter) : items;
221
220
  var numButtonsAdjusted = numberOfButtons;
222
- if ((0, _fg.fg)('platform_editor_toolbar_responsive_fixes')) {
223
- if (filteredItems.slice(0, numButtonsAdjusted).some(function (item) {
224
- return item.value.name === 'table selector';
225
- })) {
226
- numButtonsAdjusted++;
227
- }
228
- } else {
229
- numButtonsAdjusted = tableSupported && tableSelectorSupported ? numberOfButtons + 1 : numberOfButtons;
221
+ if (filteredItems.slice(0, numButtonsAdjusted).some(function (item) {
222
+ return item.value.name === 'table selector';
223
+ })) {
224
+ numButtonsAdjusted++;
230
225
  }
231
226
  var buttonItems = filteredItems.slice(0, numButtonsAdjusted).map(buttonToItem);
232
227
  var remainingItems = filteredItems.slice(numButtonsAdjusted).filter(function (_ref) {
@@ -6,7 +6,6 @@ import { ToolbarSize } from '@atlaskit/editor-common/types';
6
6
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
7
7
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
8
8
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
9
- import { fg } from '@atlaskit/platform-feature-flags/fg';
10
9
  import { getToolbarActionExperiencesPlugin } from './pm-plugins/experiences/toolbar-action-experiences';
11
10
  import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
12
11
  import { getToolbarComponents } from './ui/toolbar-components';
@@ -15,7 +14,7 @@ import { getToolbarComponents } from './ui/toolbar-components';
15
14
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
16
15
  export const toolbarSizeToButtons = (toolbarSize, appearance) => {
17
16
  // Different button numbers for full-page to better match full page toolbar breakpoints
18
- if (appearance === 'full-page' && fg('platform_editor_toolbar_responsive_fixes')) {
17
+ if (appearance === 'full-page') {
19
18
  switch (toolbarSize) {
20
19
  case ToolbarSize.XXL:
21
20
  case ToolbarSize.XL:
@@ -27,31 +26,17 @@ export const toolbarSizeToButtons = (toolbarSize, appearance) => {
27
26
  return 0;
28
27
  }
29
28
  }
30
- if (fg('platform_editor_toolbar_responsive_fixes')) {
31
- switch (toolbarSize) {
32
- case ToolbarSize.XXL:
33
- case ToolbarSize.XL:
34
- return 7;
35
- case ToolbarSize.L:
36
- return 5;
37
- case ToolbarSize.M:
38
- case ToolbarSize.S:
39
- return 2;
40
- default:
41
- return 0;
42
- }
43
- } else {
44
- switch (toolbarSize) {
45
- case ToolbarSize.XXL:
46
- case ToolbarSize.XL:
47
- case ToolbarSize.L:
48
- case ToolbarSize.M:
49
- return 7;
50
- case ToolbarSize.S:
51
- return 2;
52
- default:
53
- return 0;
54
- }
29
+ switch (toolbarSize) {
30
+ case ToolbarSize.XXL:
31
+ case ToolbarSize.XL:
32
+ return 7;
33
+ case ToolbarSize.L:
34
+ return 5;
35
+ case ToolbarSize.M:
36
+ case ToolbarSize.S:
37
+ return 2;
38
+ default:
39
+ return 0;
55
40
  }
56
41
  };
57
42
 
@@ -3,7 +3,6 @@ import memoize from 'lodash/memoize';
3
3
  import memoizeOne from 'memoize-one';
4
4
  import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
5
5
  import { blockTypeMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
6
- import { fg } from '@atlaskit/platform-feature-flags/fg';
7
6
  import { action, blockquote, codeblock, date, decision, emoji, expand, horizontalrule, imageUpload, layout, link, media, mention, panel, placeholder, status, table, tableSelector } from './item';
8
7
  import { shallowEquals } from './shallow-equals';
9
8
  const buttonToItem = memoize(button => ({
@@ -200,12 +199,8 @@ const createInsertBlockItems = config => {
200
199
  // correct downstream.
201
200
  const filteredItems = itemFilter ? items.filter(itemFilter) : items;
202
201
  let numButtonsAdjusted = numberOfButtons;
203
- if (fg('platform_editor_toolbar_responsive_fixes')) {
204
- if (filteredItems.slice(0, numButtonsAdjusted).some(item => item.value.name === 'table selector')) {
205
- numButtonsAdjusted++;
206
- }
207
- } else {
208
- numButtonsAdjusted = tableSupported && tableSelectorSupported ? numberOfButtons + 1 : numberOfButtons;
202
+ if (filteredItems.slice(0, numButtonsAdjusted).some(item => item.value.name === 'table selector')) {
203
+ numButtonsAdjusted++;
209
204
  }
210
205
  const buttonItems = filteredItems.slice(0, numButtonsAdjusted).map(buttonToItem);
211
206
  const remainingItems = filteredItems.slice(numButtonsAdjusted).filter(({
@@ -6,7 +6,6 @@ import { ToolbarSize } from '@atlaskit/editor-common/types';
6
6
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
7
7
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
8
8
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
9
- import { fg } from '@atlaskit/platform-feature-flags/fg';
10
9
  import { getToolbarActionExperiencesPlugin } from './pm-plugins/experiences/toolbar-action-experiences';
11
10
  import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
12
11
  import { getToolbarComponents } from './ui/toolbar-components';
@@ -15,7 +14,7 @@ import { getToolbarComponents } from './ui/toolbar-components';
15
14
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
16
15
  export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
17
16
  // Different button numbers for full-page to better match full page toolbar breakpoints
18
- if (appearance === 'full-page' && fg('platform_editor_toolbar_responsive_fixes')) {
17
+ if (appearance === 'full-page') {
19
18
  switch (toolbarSize) {
20
19
  case ToolbarSize.XXL:
21
20
  case ToolbarSize.XL:
@@ -27,31 +26,17 @@ export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, app
27
26
  return 0;
28
27
  }
29
28
  }
30
- if (fg('platform_editor_toolbar_responsive_fixes')) {
31
- switch (toolbarSize) {
32
- case ToolbarSize.XXL:
33
- case ToolbarSize.XL:
34
- return 7;
35
- case ToolbarSize.L:
36
- return 5;
37
- case ToolbarSize.M:
38
- case ToolbarSize.S:
39
- return 2;
40
- default:
41
- return 0;
42
- }
43
- } else {
44
- switch (toolbarSize) {
45
- case ToolbarSize.XXL:
46
- case ToolbarSize.XL:
47
- case ToolbarSize.L:
48
- case ToolbarSize.M:
49
- return 7;
50
- case ToolbarSize.S:
51
- return 2;
52
- default:
53
- return 0;
54
- }
29
+ switch (toolbarSize) {
30
+ case ToolbarSize.XXL:
31
+ case ToolbarSize.XL:
32
+ return 7;
33
+ case ToolbarSize.L:
34
+ return 5;
35
+ case ToolbarSize.M:
36
+ case ToolbarSize.S:
37
+ return 2;
38
+ default:
39
+ return 0;
55
40
  }
56
41
  };
57
42
 
@@ -7,7 +7,6 @@ import memoize from 'lodash/memoize';
7
7
  import memoizeOne from 'memoize-one';
8
8
  import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
9
9
  import { blockTypeMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
10
- import { fg } from '@atlaskit/platform-feature-flags/fg';
11
10
  import { action, blockquote, codeblock, date, decision, emoji, expand, horizontalrule, imageUpload, layout, link, media, mention, panel, placeholder, status, table, tableSelector } from './item';
12
11
  import { shallowEquals } from './shallow-equals';
13
12
  var buttonToItem = memoize(function (button) {
@@ -212,14 +211,10 @@ var createInsertBlockItems = function createInsertBlockItems(config) {
212
211
  // correct downstream.
213
212
  var filteredItems = itemFilter ? items.filter(itemFilter) : items;
214
213
  var numButtonsAdjusted = numberOfButtons;
215
- if (fg('platform_editor_toolbar_responsive_fixes')) {
216
- if (filteredItems.slice(0, numButtonsAdjusted).some(function (item) {
217
- return item.value.name === 'table selector';
218
- })) {
219
- numButtonsAdjusted++;
220
- }
221
- } else {
222
- numButtonsAdjusted = tableSupported && tableSelectorSupported ? numberOfButtons + 1 : numberOfButtons;
214
+ if (filteredItems.slice(0, numButtonsAdjusted).some(function (item) {
215
+ return item.value.name === 'table selector';
216
+ })) {
217
+ numButtonsAdjusted++;
223
218
  }
224
219
  var buttonItems = filteredItems.slice(0, numButtonsAdjusted).map(buttonToItem);
225
220
  var remainingItems = filteredItems.slice(numButtonsAdjusted).filter(function (_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "26.0.2",
3
+ "version": "27.0.0",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,33 +23,33 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/browser-apis": "^1.2.0",
25
25
  "@atlaskit/css": "^1.1.0",
26
- "@atlaskit/editor-plugin-analytics": "^25.0.0",
27
- "@atlaskit/editor-plugin-block-type": "^29.0.0",
28
- "@atlaskit/editor-plugin-code-block": "^27.0.0",
29
- "@atlaskit/editor-plugin-connectivity": "^25.0.0",
30
- "@atlaskit/editor-plugin-date": "^27.0.0",
31
- "@atlaskit/editor-plugin-emoji": "^26.0.0",
32
- "@atlaskit/editor-plugin-expand": "^26.0.0",
33
- "@atlaskit/editor-plugin-extension": "^28.0.0",
34
- "@atlaskit/editor-plugin-feature-flags": "^24.0.0",
35
- "@atlaskit/editor-plugin-hyperlink": "^27.0.0",
36
- "@atlaskit/editor-plugin-image-upload": "^25.0.0",
37
- "@atlaskit/editor-plugin-layout": "^26.0.0",
38
- "@atlaskit/editor-plugin-media": "^27.0.0",
39
- "@atlaskit/editor-plugin-media-insert": "^43.0.0",
40
- "@atlaskit/editor-plugin-mentions": "^27.0.0",
41
- "@atlaskit/editor-plugin-metrics": "^26.0.0",
42
- "@atlaskit/editor-plugin-panel": "^27.0.0",
43
- "@atlaskit/editor-plugin-placeholder-text": "^26.0.0",
44
- "@atlaskit/editor-plugin-primary-toolbar": "^26.0.0",
45
- "@atlaskit/editor-plugin-quick-insert": "^25.0.0",
46
- "@atlaskit/editor-plugin-rule": "^25.0.0",
47
- "@atlaskit/editor-plugin-status": "^26.0.0",
48
- "@atlaskit/editor-plugin-table": "^37.0.0",
49
- "@atlaskit/editor-plugin-tasks-and-decisions": "^28.0.0",
50
- "@atlaskit/editor-plugin-toolbar": "^22.0.0",
51
- "@atlaskit/editor-plugin-type-ahead": "^26.0.0",
52
- "@atlaskit/editor-plugin-ui-control-registry": "^19.0.0",
26
+ "@atlaskit/editor-plugin-analytics": "^26.0.0",
27
+ "@atlaskit/editor-plugin-block-type": "^30.0.0",
28
+ "@atlaskit/editor-plugin-code-block": "^28.0.0",
29
+ "@atlaskit/editor-plugin-connectivity": "^26.0.0",
30
+ "@atlaskit/editor-plugin-date": "^28.0.0",
31
+ "@atlaskit/editor-plugin-emoji": "^27.0.0",
32
+ "@atlaskit/editor-plugin-expand": "^27.0.0",
33
+ "@atlaskit/editor-plugin-extension": "^29.0.0",
34
+ "@atlaskit/editor-plugin-feature-flags": "^25.0.0",
35
+ "@atlaskit/editor-plugin-hyperlink": "^28.0.0",
36
+ "@atlaskit/editor-plugin-image-upload": "^26.0.0",
37
+ "@atlaskit/editor-plugin-layout": "^27.0.0",
38
+ "@atlaskit/editor-plugin-media": "^28.0.0",
39
+ "@atlaskit/editor-plugin-media-insert": "^44.0.0",
40
+ "@atlaskit/editor-plugin-mentions": "^28.0.0",
41
+ "@atlaskit/editor-plugin-metrics": "^27.0.0",
42
+ "@atlaskit/editor-plugin-panel": "^28.0.0",
43
+ "@atlaskit/editor-plugin-placeholder-text": "^27.0.0",
44
+ "@atlaskit/editor-plugin-primary-toolbar": "^27.0.0",
45
+ "@atlaskit/editor-plugin-quick-insert": "^26.0.0",
46
+ "@atlaskit/editor-plugin-rule": "^26.0.0",
47
+ "@atlaskit/editor-plugin-status": "^27.0.0",
48
+ "@atlaskit/editor-plugin-table": "^38.0.0",
49
+ "@atlaskit/editor-plugin-tasks-and-decisions": "^29.0.0",
50
+ "@atlaskit/editor-plugin-toolbar": "^23.0.0",
51
+ "@atlaskit/editor-plugin-type-ahead": "^27.0.0",
52
+ "@atlaskit/editor-plugin-ui-control-registry": "^20.0.0",
53
53
  "@atlaskit/editor-prosemirror": "^9.0.0",
54
54
  "@atlaskit/editor-shared-styles": "^4.3.0",
55
55
  "@atlaskit/editor-toolbar": "^2.8.0",
@@ -62,8 +62,8 @@
62
62
  "@atlaskit/platform-feature-flags": "^2.2.0",
63
63
  "@atlaskit/primitives": "^22.5.0",
64
64
  "@atlaskit/textfield": "^10.2.0",
65
- "@atlaskit/tmp-editor-statsig": "^226.0.0",
66
- "@atlaskit/tokens": "^20.3.0",
65
+ "@atlaskit/tmp-editor-statsig": "^227.0.0",
66
+ "@atlaskit/tokens": "^20.4.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",
69
69
  "bind-event-listener": "^3.0.0",
@@ -72,7 +72,7 @@
72
72
  "react-virtualized": "^9.22.6"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^129.1.0",
75
+ "@atlaskit/editor-common": "^130.0.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-dom": "^18.2.0 || ^19.2.0",
78
78
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -85,9 +85,6 @@
85
85
  "react-intl": "^7.0.0"
86
86
  },
87
87
  "platform-feature-flags": {
88
- "platform_editor_toolbar_responsive_fixes": {
89
- "type": "boolean"
90
- },
91
88
  "platform_editor_ease_of_use_metrics": {
92
89
  "type": "boolean"
93
90
  }