@atlaskit/editor-plugin-floating-toolbar 3.5.0 → 3.6.1

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,27 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 3.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#139216](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139216)
8
+ [`e8f596d2b1910`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8f596d2b1910) -
9
+ [ux] Cleaned up platform_editor_controls_patch_1 FG
10
+ - Updated dependencies
11
+
12
+ ## 3.6.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#139053](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139053)
17
+ [`c1c6278a78c4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c1c6278a78c4a) -
18
+ [ux] Adds a new temporary floating toolbar's config option to hide any toolbars when any table's
19
+ menu is opend.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 3.5.0
4
26
 
5
27
  ### Minor Changes
@@ -278,7 +278,7 @@ function ContentComponent(_ref5) {
278
278
  return toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp];
279
279
  });
280
280
  }
281
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_1')) {
281
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
282
282
  var _items2;
283
283
  // Consolidate floating toolbar items
284
284
  var toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
@@ -478,6 +478,10 @@ function floatingToolbarPluginFactory(options) {
478
478
  var handler = floatingToolbarHandlers[index];
479
479
  var config = handler(editorState, intl, providerFactory, activeConfigs);
480
480
  if (config) {
481
+ if (config.__suppressAllToolbars && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
482
+ activeConfigs = undefined;
483
+ break;
484
+ }
481
485
  activeConfigs.push(sanitizeFloatingToolbarConfig(config));
482
486
  }
483
487
  }
@@ -261,7 +261,7 @@ export function ContentComponent({
261
261
  const toolbarItemViewModeProp = 'supportsViewMode';
262
262
  items = iterableItems.filter(item => toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp]);
263
263
  }
264
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_1')) {
264
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
265
265
  var _items2;
266
266
  // Consolidate floating toolbar items
267
267
  const toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
@@ -447,11 +447,15 @@ export function floatingToolbarPluginFactory(options) {
447
447
  } = options;
448
448
  const intl = getIntl();
449
449
  const getConfigWithNodeInfo = editorState => {
450
- const activeConfigs = [];
450
+ let activeConfigs = [];
451
451
  for (let index = 0; index < floatingToolbarHandlers.length; index++) {
452
452
  const handler = floatingToolbarHandlers[index];
453
453
  const config = handler(editorState, intl, providerFactory, activeConfigs);
454
454
  if (config) {
455
+ if (config.__suppressAllToolbars && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
456
+ activeConfigs = undefined;
457
+ break;
458
+ }
455
459
  activeConfigs.push(sanitizeFloatingToolbarConfig(config));
456
460
  }
457
461
  }
@@ -266,7 +266,7 @@ export function ContentComponent(_ref5) {
266
266
  return toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp];
267
267
  });
268
268
  }
269
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_1')) {
269
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
270
270
  var _items2;
271
271
  // Consolidate floating toolbar items
272
272
  var toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
@@ -466,6 +466,10 @@ export function floatingToolbarPluginFactory(options) {
466
466
  var handler = floatingToolbarHandlers[index];
467
467
  var config = handler(editorState, intl, providerFactory, activeConfigs);
468
468
  if (config) {
469
+ if (config.__suppressAllToolbars && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
470
+ activeConfigs = undefined;
471
+ break;
472
+ }
469
473
  activeConfigs.push(sanitizeFloatingToolbarConfig(config));
470
474
  }
471
475
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "3.5.0",
3
+ "version": "3.6.1",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,17 +28,17 @@
28
28
  "@atlaskit/adf-utils": "^19.19.0",
29
29
  "@atlaskit/button": "^23.0.0",
30
30
  "@atlaskit/checkbox": "^17.0.0",
31
- "@atlaskit/editor-common": "^103.1.0",
31
+ "@atlaskit/editor-common": "^103.4.0",
32
32
  "@atlaskit/editor-palette": "^2.1.0",
33
33
  "@atlaskit/editor-plugin-block-controls": "^3.8.0",
34
34
  "@atlaskit/editor-plugin-context-panel": "^4.0.0",
35
35
  "@atlaskit/editor-plugin-copy-button": "^2.0.0",
36
36
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
37
37
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
38
- "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
38
+ "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
39
39
  "@atlaskit/editor-plugin-emoji": "^3.5.0",
40
40
  "@atlaskit/editor-plugin-extension": "^5.2.0",
41
- "@atlaskit/editor-plugin-table": "^10.6.0",
41
+ "@atlaskit/editor-plugin-table": "^10.7.0",
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/emoji": "^69.0.0",
44
44
  "@atlaskit/icon": "^25.5.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/modal-dialog": "^14.1.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/primitives": "^14.4.0",
49
- "@atlaskit/select": "^20.2.0",
49
+ "@atlaskit/select": "^20.3.0",
50
50
  "@atlaskit/theme": "^18.0.0",
51
51
  "@atlaskit/tmp-editor-statsig": "^4.6.0",
52
52
  "@atlaskit/tokens": "^4.7.0",
@@ -132,10 +132,10 @@
132
132
  "platform_editor_fix_floating_toolbar_scrollbar": {
133
133
  "type": "boolean"
134
134
  },
135
- "platform_editor_controls_patch_1": {
135
+ "platform_editor_controls_patch_2": {
136
136
  "type": "boolean"
137
137
  },
138
- "platform_editor_controls_patch_2": {
138
+ "platform_editor_controls_patch_4": {
139
139
  "type": "boolean"
140
140
  }
141
141
  }