@atlaskit/editor-plugin-floating-toolbar 5.1.6 → 5.1.8

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-floating-toolbar
2
2
 
3
+ ## 5.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#197019](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/197019)
8
+ [`a0cb47e879f31`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a0cb47e879f31) -
9
+ ENGHEALTH-32239 Only group as radio button if not explicitly set to false behind FG
10
+ - Updated dependencies
11
+
12
+ ## 5.1.7
13
+
14
+ ### Patch Changes
15
+
16
+ - [`558ab977a6b1c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/558ab977a6b1c) -
17
+ Remove feature gate: platform_editor_overflow_dropdown_click_analytics
18
+ - Updated dependencies
19
+
3
20
  ## 5.1.6
4
21
 
5
22
  ### Patch Changes
@@ -23,7 +23,6 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
23
23
  var _ui = require("@atlaskit/editor-common/ui");
24
24
  var _state = require("@atlaskit/editor-prosemirror/state");
25
25
  var _utils = require("@atlaskit/editor-prosemirror/utils");
26
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
26
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
28
27
  var _commands = require("./pm-plugins/commands");
29
28
  var _forceFocus = _interopRequireWildcard(require("./pm-plugins/force-focus"));
@@ -316,7 +315,7 @@ function ContentComponent(_ref5) {
316
315
  }
317
316
 
318
317
  // Apply analytics to dropdown
319
- if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_editor_overflow_dropdown_click_analytics')) {
318
+ if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent) {
320
319
  var _items3;
321
320
  var currentItems = Array.isArray(items) ? items : (_items3 = items) === null || _items3 === void 0 ? void 0 : _items3(node);
322
321
  var updatedItems = currentItems.map(function (item) {
@@ -53,7 +53,10 @@ function groupItems(items) {
53
53
  var notLastItem = i < items.length - 1;
54
54
  var nextItemIsButton = items[i + 1] && items[i + 1].type === 'button';
55
55
  var wasPreviousButton = items[i - 1] && items[i - 1].type === 'button';
56
- var isRadioButton = notLastItem && nextItemIsButton || wasPreviousButton;
56
+ var shouldBeRadioButton = notLastItem && nextItemIsButton || wasPreviousButton;
57
+
58
+ // Only group as radio button if not explicitly set to false
59
+ var isRadioButton = !(0, _expValEquals.expValEquals)('platform_editor_august_a11y', 'isEnabled', true) ? shouldBeRadioButton : shouldBeRadioButton && item.isRadioButton !== false;
57
60
  if (isRadioButton) {
58
61
  item.isRadioButton = true;
59
62
  buttonGroup.push(item);
@@ -135,15 +138,15 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
135
138
  icon: item.icon ? item.iconFallback ? (0, _react2.jsx)(ButtonIcon, {
136
139
  color: getIconColor(item.disabled, item.selected),
137
140
  spacing: "spacious",
138
- label: (0, _platformFeatureFlags.fg)('editor_a11y_remove_redundant_wrap_icon_label') ? undefined : item.title,
141
+ label: undefined,
139
142
  LEGACY_fallbackIcon: item.iconFallback,
140
143
  LEGACY_primaryColor: "currentColor",
141
144
  Legacy_secondaryColor: "var(--ds-surface, #FFFFFF)",
142
- "aria-hidden": (0, _platformFeatureFlags.fg)('editor_a11y_remove_redundant_wrap_icon_label') ? true : false // Icon is described by the button for screen readers
145
+ "aria-hidden": true // Icon is described by the button for screen readers
143
146
  }) : (0, _react2.jsx)(ButtonIcon, {
144
147
  spacing: "spacious",
145
- label: (0, _platformFeatureFlags.fg)('editor_a11y_remove_redundant_wrap_icon_label') ? undefined : item.title,
146
- "aria-hidden": (0, _platformFeatureFlags.fg)('editor_a11y_remove_redundant_wrap_icon_label') ? true : false // Icon is described by the button for screen readers
148
+ label: undefined,
149
+ "aria-hidden": true // Icon is described by the button for screen readers
147
150
  }) : undefined,
148
151
  iconAfter: item.iconAfter ? (0, _react2.jsx)(item.iconAfter, {
149
152
  label: ""
@@ -12,7 +12,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
12
12
  import { Popup } from '@atlaskit/editor-common/ui';
13
13
  import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
14
14
  import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
15
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
16
  import { copyNode } from './pm-plugins/commands';
18
17
  import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
@@ -301,7 +300,7 @@ export function ContentComponent({
301
300
  }
302
301
 
303
302
  // Apply analytics to dropdown
304
- if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent && fg('platform_editor_overflow_dropdown_click_analytics')) {
303
+ if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent) {
305
304
  var _items3;
306
305
  const currentItems = Array.isArray(items) ? items : (_items3 = items) === null || _items3 === void 0 ? void 0 : _items3(node);
307
306
  const updatedItems = currentItems.map(item => {
@@ -42,7 +42,10 @@ export function groupItems(items) {
42
42
  const notLastItem = i < items.length - 1;
43
43
  const nextItemIsButton = items[i + 1] && items[i + 1].type === 'button';
44
44
  const wasPreviousButton = items[i - 1] && items[i - 1].type === 'button';
45
- const isRadioButton = notLastItem && nextItemIsButton || wasPreviousButton;
45
+ const shouldBeRadioButton = notLastItem && nextItemIsButton || wasPreviousButton;
46
+
47
+ // Only group as radio button if not explicitly set to false
48
+ const isRadioButton = !expValEquals('platform_editor_august_a11y', 'isEnabled', true) ? shouldBeRadioButton : shouldBeRadioButton && item.isRadioButton !== false;
46
49
  if (isRadioButton) {
47
50
  item.isRadioButton = true;
48
51
  buttonGroup.push(item);
@@ -125,15 +128,15 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
125
128
  icon: item.icon ? item.iconFallback ? jsx(ButtonIcon, {
126
129
  color: getIconColor(item.disabled, item.selected),
127
130
  spacing: "spacious",
128
- label: fg('editor_a11y_remove_redundant_wrap_icon_label') ? undefined : item.title,
131
+ label: undefined,
129
132
  LEGACY_fallbackIcon: item.iconFallback,
130
133
  LEGACY_primaryColor: "currentColor",
131
134
  Legacy_secondaryColor: "var(--ds-surface, #FFFFFF)",
132
- "aria-hidden": fg('editor_a11y_remove_redundant_wrap_icon_label') ? true : false // Icon is described by the button for screen readers
135
+ "aria-hidden": true // Icon is described by the button for screen readers
133
136
  }) : jsx(ButtonIcon, {
134
137
  spacing: "spacious",
135
- label: fg('editor_a11y_remove_redundant_wrap_icon_label') ? undefined : item.title,
136
- "aria-hidden": fg('editor_a11y_remove_redundant_wrap_icon_label') ? true : false // Icon is described by the button for screen readers
138
+ label: undefined,
139
+ "aria-hidden": true // Icon is described by the button for screen readers
137
140
  }) : undefined,
138
141
  iconAfter: item.iconAfter ? jsx(item.iconAfter, {
139
142
  label: ""
@@ -16,7 +16,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
16
16
  import { Popup } from '@atlaskit/editor-common/ui';
17
17
  import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
18
18
  import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
19
- import { fg } from '@atlaskit/platform-feature-flags';
20
19
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
20
  import { copyNode as _copyNode } from './pm-plugins/commands';
22
21
  import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
@@ -307,7 +306,7 @@ export function ContentComponent(_ref5) {
307
306
  }
308
307
 
309
308
  // Apply analytics to dropdown
310
- if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent && fg('platform_editor_overflow_dropdown_click_analytics')) {
309
+ if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent) {
311
310
  var _items3;
312
311
  var currentItems = Array.isArray(items) ? items : (_items3 = items) === null || _items3 === void 0 ? void 0 : _items3(node);
313
312
  var updatedItems = currentItems.map(function (item) {
@@ -47,7 +47,10 @@ export function groupItems(items) {
47
47
  var notLastItem = i < items.length - 1;
48
48
  var nextItemIsButton = items[i + 1] && items[i + 1].type === 'button';
49
49
  var wasPreviousButton = items[i - 1] && items[i - 1].type === 'button';
50
- var isRadioButton = notLastItem && nextItemIsButton || wasPreviousButton;
50
+ var shouldBeRadioButton = notLastItem && nextItemIsButton || wasPreviousButton;
51
+
52
+ // Only group as radio button if not explicitly set to false
53
+ var isRadioButton = !expValEquals('platform_editor_august_a11y', 'isEnabled', true) ? shouldBeRadioButton : shouldBeRadioButton && item.isRadioButton !== false;
51
54
  if (isRadioButton) {
52
55
  item.isRadioButton = true;
53
56
  buttonGroup.push(item);
@@ -129,15 +132,15 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
129
132
  icon: item.icon ? item.iconFallback ? jsx(ButtonIcon, {
130
133
  color: getIconColor(item.disabled, item.selected),
131
134
  spacing: "spacious",
132
- label: fg('editor_a11y_remove_redundant_wrap_icon_label') ? undefined : item.title,
135
+ label: undefined,
133
136
  LEGACY_fallbackIcon: item.iconFallback,
134
137
  LEGACY_primaryColor: "currentColor",
135
138
  Legacy_secondaryColor: "var(--ds-surface, #FFFFFF)",
136
- "aria-hidden": fg('editor_a11y_remove_redundant_wrap_icon_label') ? true : false // Icon is described by the button for screen readers
139
+ "aria-hidden": true // Icon is described by the button for screen readers
137
140
  }) : jsx(ButtonIcon, {
138
141
  spacing: "spacious",
139
- label: fg('editor_a11y_remove_redundant_wrap_icon_label') ? undefined : item.title,
140
- "aria-hidden": fg('editor_a11y_remove_redundant_wrap_icon_label') ? true : false // Icon is described by the button for screen readers
142
+ label: undefined,
143
+ "aria-hidden": true // Icon is described by the button for screen readers
141
144
  }) : undefined,
142
145
  iconAfter: item.iconAfter ? jsx(item.iconAfter, {
143
146
  label: ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "5.1.6",
3
+ "version": "5.1.8",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/primitives": "^14.11.0",
49
49
  "@atlaskit/select": "^21.2.0",
50
50
  "@atlaskit/theme": "^19.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^9.23.0",
51
+ "@atlaskit/tmp-editor-statsig": "^9.25.0",
52
52
  "@atlaskit/tokens": "^6.0.0",
53
53
  "@atlaskit/tooltip": "^20.4.0",
54
54
  "@babel/runtime": "^7.0.0",
@@ -60,7 +60,7 @@
60
60
  "react-loadable": "^5.1.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^107.16.0",
63
+ "@atlaskit/editor-common": "^107.18.0",
64
64
  "react": "^18.2.0",
65
65
  "react-dom": "^18.2.0"
66
66
  },
@@ -70,7 +70,6 @@
70
70
  "@testing-library/react": "^13.4.0",
71
71
  "@testing-library/user-event": "^14.4.3",
72
72
  "enzyme": "^3.10.0",
73
- "typescript": "~5.4.2",
74
73
  "wait-for-expect": "^1.2.0"
75
74
  },
76
75
  "techstack": {
@@ -124,14 +123,8 @@
124
123
  "platform_editor_use_nested_table_pm_nodes": {
125
124
  "type": "boolean"
126
125
  },
127
- "editor_a11y_remove_redundant_wrap_icon_label": {
128
- "type": "boolean"
129
- },
130
126
  "platform_editor_user_intent_plugin": {
131
127
  "type": "boolean"
132
- },
133
- "platform_editor_overflow_dropdown_click_analytics": {
134
- "type": "boolean"
135
128
  }
136
129
  }
137
130
  }