@atlaskit/editor-plugin-floating-toolbar 5.1.7 → 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,14 @@
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
+
3
12
  ## 5.1.7
4
13
 
5
14
  ### Patch Changes
@@ -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: ""
@@ -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: ""
@@ -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.7",
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.24.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.17.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,9 +123,6 @@
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
128
  }