@atlaskit/editor-plugin-primary-toolbar 3.2.5 → 3.2.7

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,22 @@
1
1
  # @atlaskit/editor-plugin-primary-toolbar
2
2
 
3
+ ## 3.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#154313](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154313)
8
+ [`36c5067417688`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36c5067417688) -
9
+ Clean up platform_editor_insert_button_on_primary_toolbar feature gate
10
+ - Updated dependencies
11
+
12
+ ## 3.2.6
13
+
14
+ ### Patch Changes
15
+
16
+ - [#153512](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/153512)
17
+ [`795799207e556`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/795799207e556) -
18
+ ED-27817 Hide find button on primary toolbar when contextualFormattingEnabled option is false
19
+
3
20
  ## 3.2.5
4
21
 
5
22
  ### Patch Changes
@@ -16,11 +16,11 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
16
16
  if (contextualFormattingEnabled && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
17
17
  exposure: true
18
18
  })) {
19
- var shouldShowInsertBlock = (0, _platformFeatureFlags.fg)('platform_editor_insert_button_on_primary_toolbar');
20
19
  var shouldShowUndoRedoGroup = (0, _platformFeatureFlags.fg)('platform_editor_undo_redo_find_on_primary_toolbar');
21
- configuration = toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup);
20
+ configuration = toolbarConfigurationV2(true, shouldShowUndoRedoGroup);
22
21
  } else {
23
- configuration = toolbarConfiguration;
22
+ var shouldShowFindGroup = !(!contextualFormattingEnabled && (0, _platformFeatureFlags.fg)('platform_editor_controls_fix_toolbar_config_embeds'));
23
+ configuration = toolbarConfiguration(shouldShowFindGroup);
24
24
  }
25
25
  return configuration.filter(function (toolbarElement) {
26
26
  return typeof toolbarElement.enabled === 'undefined' || toolbarElement.enabled(componentRegistry, editorState);
@@ -117,10 +117,22 @@ var others = [{
117
117
  }, {
118
118
  name: 'loom'
119
119
  }];
120
+ var othersGroupNoFind = [{
121
+ name: 'beforePrimaryToolbar'
122
+ }, {
123
+ name: 'avatarGroup'
124
+ }, {
125
+ // TODO: ED-26962 - Should likely be split into three: spelling & grammar, separator, and AI trigger
126
+ name: 'aiExperience'
127
+ }, {
128
+ name: 'loom'
129
+ }];
120
130
  var findGroup = [{
121
131
  name: 'findReplace'
122
132
  }];
123
- var toolbarConfiguration = [].concat(undoRedoGroup, spellCheckGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormattingGroup, insertBlockGroup, others);
133
+ var toolbarConfiguration = function toolbarConfiguration(shouldShowFindGroup) {
134
+ return [].concat(undoRedoGroup, spellCheckGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormattingGroup, insertBlockGroup, (0, _toConsumableArray2.default)(shouldShowFindGroup ? others : othersGroupNoFind));
135
+ };
124
136
  var toolbarConfigurationV2 = function toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup) {
125
137
  var shouldShowFindGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
126
138
  return [].concat((0, _toConsumableArray2.default)(shouldShowUndoRedoGroup ? undoRedoGroup : []), blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, (0, _toConsumableArray2.default)(shouldShowInsertBlock ? insertBlockGroup : []), [{
@@ -9,11 +9,11 @@ export const getToolbarComponents = ({
9
9
  if (contextualFormattingEnabled && editorExperiment('platform_editor_controls', 'variant1', {
10
10
  exposure: true
11
11
  })) {
12
- const shouldShowInsertBlock = fg('platform_editor_insert_button_on_primary_toolbar');
13
12
  const shouldShowUndoRedoGroup = fg('platform_editor_undo_redo_find_on_primary_toolbar');
14
- configuration = toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup);
13
+ configuration = toolbarConfigurationV2(true, shouldShowUndoRedoGroup);
15
14
  } else {
16
- configuration = toolbarConfiguration;
15
+ const shouldShowFindGroup = !(!contextualFormattingEnabled && fg('platform_editor_controls_fix_toolbar_config_embeds'));
16
+ configuration = toolbarConfiguration(shouldShowFindGroup);
17
17
  }
18
18
  return configuration.filter(toolbarElement => typeof toolbarElement.enabled === 'undefined' || toolbarElement.enabled(componentRegistry, editorState)).reduce((acc, toolbarElement) => {
19
19
  if (componentRegistry.has(toolbarElement.name)) {
@@ -92,10 +92,20 @@ const others = [{
92
92
  }, {
93
93
  name: 'loom'
94
94
  }];
95
+ const othersGroupNoFind = [{
96
+ name: 'beforePrimaryToolbar'
97
+ }, {
98
+ name: 'avatarGroup'
99
+ }, {
100
+ // TODO: ED-26962 - Should likely be split into three: spelling & grammar, separator, and AI trigger
101
+ name: 'aiExperience'
102
+ }, {
103
+ name: 'loom'
104
+ }];
95
105
  const findGroup = [{
96
106
  name: 'findReplace'
97
107
  }];
98
- const toolbarConfiguration = [...undoRedoGroup, ...spellCheckGroup, ...blockTypeGroup, ...textFormattingGroup, ...alignmentGroup, ...textColorGroup, ...listFormattingGroup, ...insertBlockGroup, ...others];
108
+ const toolbarConfiguration = shouldShowFindGroup => [...undoRedoGroup, ...spellCheckGroup, ...blockTypeGroup, ...textFormattingGroup, ...alignmentGroup, ...textColorGroup, ...listFormattingGroup, ...insertBlockGroup, ...(shouldShowFindGroup ? others : othersGroupNoFind)];
99
109
  const toolbarConfigurationV2 = (shouldShowInsertBlock, shouldShowUndoRedoGroup, shouldShowFindGroup = false) => [...(shouldShowUndoRedoGroup ? undoRedoGroup : []), ...blockTypeGroup, ...textFormattingGroup, ...textColorGroup, ...alignmentGroup, ...listFormattingGroup, ...hyperlinkGroup, ...(shouldShowInsertBlock ? insertBlockGroup : []), {
100
110
  name: 'overflowMenu'
101
111
  }, {
@@ -9,11 +9,11 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
9
9
  if (contextualFormattingEnabled && editorExperiment('platform_editor_controls', 'variant1', {
10
10
  exposure: true
11
11
  })) {
12
- var shouldShowInsertBlock = fg('platform_editor_insert_button_on_primary_toolbar');
13
12
  var shouldShowUndoRedoGroup = fg('platform_editor_undo_redo_find_on_primary_toolbar');
14
- configuration = toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup);
13
+ configuration = toolbarConfigurationV2(true, shouldShowUndoRedoGroup);
15
14
  } else {
16
- configuration = toolbarConfiguration;
15
+ var shouldShowFindGroup = !(!contextualFormattingEnabled && fg('platform_editor_controls_fix_toolbar_config_embeds'));
16
+ configuration = toolbarConfiguration(shouldShowFindGroup);
17
17
  }
18
18
  return configuration.filter(function (toolbarElement) {
19
19
  return typeof toolbarElement.enabled === 'undefined' || toolbarElement.enabled(componentRegistry, editorState);
@@ -110,10 +110,22 @@ var others = [{
110
110
  }, {
111
111
  name: 'loom'
112
112
  }];
113
+ var othersGroupNoFind = [{
114
+ name: 'beforePrimaryToolbar'
115
+ }, {
116
+ name: 'avatarGroup'
117
+ }, {
118
+ // TODO: ED-26962 - Should likely be split into three: spelling & grammar, separator, and AI trigger
119
+ name: 'aiExperience'
120
+ }, {
121
+ name: 'loom'
122
+ }];
113
123
  var findGroup = [{
114
124
  name: 'findReplace'
115
125
  }];
116
- var toolbarConfiguration = [].concat(undoRedoGroup, spellCheckGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormattingGroup, insertBlockGroup, others);
126
+ var toolbarConfiguration = function toolbarConfiguration(shouldShowFindGroup) {
127
+ return [].concat(undoRedoGroup, spellCheckGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormattingGroup, insertBlockGroup, _toConsumableArray(shouldShowFindGroup ? others : othersGroupNoFind));
128
+ };
117
129
  var toolbarConfigurationV2 = function toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup) {
118
130
  var shouldShowFindGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
119
131
  return [].concat(_toConsumableArray(shouldShowUndoRedoGroup ? undoRedoGroup : []), blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, _toConsumableArray(shouldShowInsertBlock ? insertBlockGroup : []), [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-primary-toolbar",
3
- "version": "3.2.5",
3
+ "version": "3.2.7",
4
4
  "description": "Primary toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,10 +36,10 @@
36
36
  ".": "./src/index.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@atlaskit/editor-common": "^105.0.0",
39
+ "@atlaskit/editor-common": "^105.3.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
- "@atlaskit/tmp-editor-statsig": "^4.19.0",
42
+ "@atlaskit/tmp-editor-statsig": "^4.22.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1"
45
45
  },
@@ -88,10 +88,10 @@
88
88
  "platform_editor_controls_move_actions": {
89
89
  "type": "boolean"
90
90
  },
91
- "platform_editor_insert_button_on_primary_toolbar": {
91
+ "platform_editor_undo_redo_find_on_primary_toolbar": {
92
92
  "type": "boolean"
93
93
  },
94
- "platform_editor_undo_redo_find_on_primary_toolbar": {
94
+ "platform_editor_controls_fix_toolbar_config_embeds": {
95
95
  "type": "boolean"
96
96
  }
97
97
  }