@atlaskit/editor-plugin-find-replace 3.2.4 → 3.2.5

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,13 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 3.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3d41d42ada6d5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d41d42ada6d5) -
8
+ [ED-28600] fix A11Y violations for screen reader announcements
9
+ - Updated dependencies
10
+
3
11
  ## 3.2.4
4
12
 
5
13
  ### Patch Changes
@@ -140,11 +140,11 @@ var Find = /*#__PURE__*/function (_React$Component) {
140
140
  _this.props.onFind(_this.props.findText);
141
141
  }
142
142
  });
143
- (0, _defineProperty2.default)(_this, "matchCaseIconEle", function () {
143
+ (0, _defineProperty2.default)(_this, "matchCaseIconEle", function (iconProps) {
144
144
  return (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_find_and_replace_improvements_1') ? (0, _react2.jsx)(_textLetterCase.default, {
145
145
  LEGACY_size: 'small',
146
146
  LEGACY_fallbackIcon: _textStyle.default,
147
- label: _this.matchCase,
147
+ label: (0, _expValEquals.expValEquals)('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? iconProps.label : _this.matchCase,
148
148
  size: "small"
149
149
  }) : (0, _react2.jsx)(_textStyleEmojiKeyboard.default, {
150
150
  LEGACY_size: 'small',
@@ -123,63 +123,65 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
123
123
  shouldMatchCase = _this$props.shouldMatchCase,
124
124
  onToggleMatchCase = _this$props.onToggleMatchCase;
125
125
  var focusToolbarButton = this.props.focusToolbarButton || function () {};
126
- return (
126
+ return (0, _react2.jsx)("div", {
127
+ role: (0, _expValEquals.expValEquals)('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? 'dialog' : undefined,
128
+ "aria-label": (0, _expValEquals.expValEquals)('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? 'Find and Replace' : undefined,
129
+ "aria-modal": (0, _expValEquals.expValEquals)('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? false : undefined,
130
+ ref: this.modalRef
127
131
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
128
- (0, _react2.jsx)("div", {
129
- ref: this.modalRef,
130
- css: [_uiStyles.wrapperStyles, _uiStyles.wrapperPaddingStyles]
131
- }, (0, _react2.jsx)(_Find.default, {
132
- allowMatchCase: allowMatchCase,
133
- shouldMatchCase: shouldMatchCase,
134
- onToggleMatchCase: onToggleMatchCase,
135
- findText: findText,
136
- count: count,
137
- shouldFocus: shouldFocus,
138
- onFind: onFind,
139
- onFindBlur: onFindBlur,
140
- onFindPrev: onFindPrev,
141
- onFindNext: onFindNext,
142
- onFindTextfieldRefSet: this.setFindTextfieldRef,
143
- onCancel: onCancel,
144
- onArrowDown: this.setFocusToReplace,
145
- findTyped: this.state.findTyped,
146
- setFindTyped: this.setFindTyped
147
- }), (0, _react2.jsx)("hr", {
148
- role: "presentation",
149
- css: _uiStyles.ruleStyles,
150
- id: "replace-hr-element"
151
- }), (0, _platformFeatureFlags.fg)('editor_a11y_refactor_find_replace_style') ? (0, _react2.jsx)(_ReplaceNext.default, {
152
- canReplace: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
153
- replaceText: replaceText,
154
- onReplace: onReplace,
155
- onReplaceAll: onReplaceAll,
156
- onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
157
- onArrowUp: this.setFocusToFind,
158
- onCancel: onCancel,
159
- count: count,
160
- onFindPrev: onFindPrev,
161
- onFindNext: onFindNext,
162
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
163
- findTyped: this.state.findTyped,
164
- setFindTyped: this.setFindTyped,
165
- focusToolbarButton: focusToolbarButton
166
- }) : (0, _react2.jsx)(_Replace.default, {
167
- canReplace: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
168
- replaceText: replaceText,
169
- onReplace: onReplace,
170
- onReplaceAll: onReplaceAll,
171
- onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
172
- onArrowUp: this.setFocusToFind,
173
- onCancel: onCancel,
174
- count: count,
175
- onFindPrev: onFindPrev,
176
- onFindNext: onFindNext,
177
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
178
- findTyped: this.state.findTyped,
179
- setFindTyped: this.setFindTyped,
180
- focusToolbarButton: focusToolbarButton
181
- }))
182
- );
132
+ ,
133
+ css: [_uiStyles.wrapperStyles, _uiStyles.wrapperPaddingStyles]
134
+ }, (0, _react2.jsx)(_Find.default, {
135
+ allowMatchCase: allowMatchCase,
136
+ shouldMatchCase: shouldMatchCase,
137
+ onToggleMatchCase: onToggleMatchCase,
138
+ findText: findText,
139
+ count: count,
140
+ shouldFocus: shouldFocus,
141
+ onFind: onFind,
142
+ onFindBlur: onFindBlur,
143
+ onFindPrev: onFindPrev,
144
+ onFindNext: onFindNext,
145
+ onFindTextfieldRefSet: this.setFindTextfieldRef,
146
+ onCancel: onCancel,
147
+ onArrowDown: this.setFocusToReplace,
148
+ findTyped: this.state.findTyped,
149
+ setFindTyped: this.setFindTyped
150
+ }), (0, _react2.jsx)("hr", {
151
+ role: "presentation",
152
+ css: _uiStyles.ruleStyles,
153
+ id: "replace-hr-element"
154
+ }), (0, _platformFeatureFlags.fg)('editor_a11y_refactor_find_replace_style') ? (0, _react2.jsx)(_ReplaceNext.default, {
155
+ canReplace: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
156
+ replaceText: replaceText,
157
+ onReplace: onReplace,
158
+ onReplaceAll: onReplaceAll,
159
+ onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
160
+ onArrowUp: this.setFocusToFind,
161
+ onCancel: onCancel,
162
+ count: count,
163
+ onFindPrev: onFindPrev,
164
+ onFindNext: onFindNext,
165
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
166
+ findTyped: this.state.findTyped,
167
+ setFindTyped: this.setFindTyped,
168
+ focusToolbarButton: focusToolbarButton
169
+ }) : (0, _react2.jsx)(_Replace.default, {
170
+ canReplace: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
171
+ replaceText: replaceText,
172
+ onReplace: onReplace,
173
+ onReplaceAll: onReplaceAll,
174
+ onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
175
+ onArrowUp: this.setFocusToFind,
176
+ onCancel: onCancel,
177
+ count: count,
178
+ onFindPrev: onFindPrev,
179
+ onFindNext: onFindNext,
180
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
181
+ findTyped: this.state.findTyped,
182
+ setFindTyped: this.setFindTyped,
183
+ focusToolbarButton: focusToolbarButton
184
+ }));
183
185
  }
184
186
  }]);
185
187
  }(_react.default.PureComponent);
@@ -128,11 +128,11 @@ class Find extends React.Component {
128
128
  this.props.onFind(this.props.findText);
129
129
  }
130
130
  });
131
- _defineProperty(this, "matchCaseIconEle", () => {
131
+ _defineProperty(this, "matchCaseIconEle", iconProps => {
132
132
  return expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? jsx(TextLetterCaseIcon, {
133
133
  LEGACY_size: 'small',
134
134
  LEGACY_fallbackIcon: EditorTextStyleIcon,
135
- label: this.matchCase,
135
+ label: expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? iconProps.label : this.matchCase,
136
136
  size: "small"
137
137
  }) : jsx(MatchCaseIcon, {
138
138
  LEGACY_size: 'small',
@@ -101,63 +101,65 @@ class FindReplace extends React.PureComponent {
101
101
  onToggleMatchCase
102
102
  } = this.props;
103
103
  const focusToolbarButton = this.props.focusToolbarButton || (() => {});
104
- return (
104
+ return jsx("div", {
105
+ role: expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? 'dialog' : undefined,
106
+ "aria-label": expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? 'Find and Replace' : undefined,
107
+ "aria-modal": expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? false : undefined,
108
+ ref: this.modalRef
105
109
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
106
- jsx("div", {
107
- ref: this.modalRef,
108
- css: [wrapperStyles, wrapperPaddingStyles]
109
- }, jsx(Find, {
110
- allowMatchCase: allowMatchCase,
111
- shouldMatchCase: shouldMatchCase,
112
- onToggleMatchCase: onToggleMatchCase,
113
- findText: findText,
114
- count: count,
115
- shouldFocus: shouldFocus,
116
- onFind: onFind,
117
- onFindBlur: onFindBlur,
118
- onFindPrev: onFindPrev,
119
- onFindNext: onFindNext,
120
- onFindTextfieldRefSet: this.setFindTextfieldRef,
121
- onCancel: onCancel,
122
- onArrowDown: this.setFocusToReplace,
123
- findTyped: this.state.findTyped,
124
- setFindTyped: this.setFindTyped
125
- }), jsx("hr", {
126
- role: "presentation",
127
- css: ruleStyles,
128
- id: "replace-hr-element"
129
- }), fg('editor_a11y_refactor_find_replace_style') ? jsx(ReplaceNext, {
130
- canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
131
- replaceText: replaceText,
132
- onReplace: onReplace,
133
- onReplaceAll: onReplaceAll,
134
- onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
135
- onArrowUp: this.setFocusToFind,
136
- onCancel: onCancel,
137
- count: count,
138
- onFindPrev: onFindPrev,
139
- onFindNext: onFindNext,
140
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
141
- findTyped: this.state.findTyped,
142
- setFindTyped: this.setFindTyped,
143
- focusToolbarButton: focusToolbarButton
144
- }) : jsx(Replace, {
145
- canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
146
- replaceText: replaceText,
147
- onReplace: onReplace,
148
- onReplaceAll: onReplaceAll,
149
- onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
150
- onArrowUp: this.setFocusToFind,
151
- onCancel: onCancel,
152
- count: count,
153
- onFindPrev: onFindPrev,
154
- onFindNext: onFindNext,
155
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
156
- findTyped: this.state.findTyped,
157
- setFindTyped: this.setFindTyped,
158
- focusToolbarButton: focusToolbarButton
159
- }))
160
- );
110
+ ,
111
+ css: [wrapperStyles, wrapperPaddingStyles]
112
+ }, jsx(Find, {
113
+ allowMatchCase: allowMatchCase,
114
+ shouldMatchCase: shouldMatchCase,
115
+ onToggleMatchCase: onToggleMatchCase,
116
+ findText: findText,
117
+ count: count,
118
+ shouldFocus: shouldFocus,
119
+ onFind: onFind,
120
+ onFindBlur: onFindBlur,
121
+ onFindPrev: onFindPrev,
122
+ onFindNext: onFindNext,
123
+ onFindTextfieldRefSet: this.setFindTextfieldRef,
124
+ onCancel: onCancel,
125
+ onArrowDown: this.setFocusToReplace,
126
+ findTyped: this.state.findTyped,
127
+ setFindTyped: this.setFindTyped
128
+ }), jsx("hr", {
129
+ role: "presentation",
130
+ css: ruleStyles,
131
+ id: "replace-hr-element"
132
+ }), fg('editor_a11y_refactor_find_replace_style') ? jsx(ReplaceNext, {
133
+ canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
134
+ replaceText: replaceText,
135
+ onReplace: onReplace,
136
+ onReplaceAll: onReplaceAll,
137
+ onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
138
+ onArrowUp: this.setFocusToFind,
139
+ onCancel: onCancel,
140
+ count: count,
141
+ onFindPrev: onFindPrev,
142
+ onFindNext: onFindNext,
143
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
144
+ findTyped: this.state.findTyped,
145
+ setFindTyped: this.setFindTyped,
146
+ focusToolbarButton: focusToolbarButton
147
+ }) : jsx(Replace, {
148
+ canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
149
+ replaceText: replaceText,
150
+ onReplace: onReplace,
151
+ onReplaceAll: onReplaceAll,
152
+ onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
153
+ onArrowUp: this.setFocusToFind,
154
+ onCancel: onCancel,
155
+ count: count,
156
+ onFindPrev: onFindPrev,
157
+ onFindNext: onFindNext,
158
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
159
+ findTyped: this.state.findTyped,
160
+ setFindTyped: this.setFindTyped,
161
+ focusToolbarButton: focusToolbarButton
162
+ }));
161
163
  }
162
164
  }
163
165
  export default FindReplace;
@@ -137,11 +137,11 @@ var Find = /*#__PURE__*/function (_React$Component) {
137
137
  _this.props.onFind(_this.props.findText);
138
138
  }
139
139
  });
140
- _defineProperty(_this, "matchCaseIconEle", function () {
140
+ _defineProperty(_this, "matchCaseIconEle", function (iconProps) {
141
141
  return expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? jsx(TextLetterCaseIcon, {
142
142
  LEGACY_size: 'small',
143
143
  LEGACY_fallbackIcon: EditorTextStyleIcon,
144
- label: _this.matchCase,
144
+ label: expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? iconProps.label : _this.matchCase,
145
145
  size: "small"
146
146
  }) : jsx(MatchCaseIcon, {
147
147
  LEGACY_size: 'small',
@@ -121,63 +121,65 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
121
121
  shouldMatchCase = _this$props.shouldMatchCase,
122
122
  onToggleMatchCase = _this$props.onToggleMatchCase;
123
123
  var focusToolbarButton = this.props.focusToolbarButton || function () {};
124
- return (
124
+ return jsx("div", {
125
+ role: expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? 'dialog' : undefined,
126
+ "aria-label": expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? 'Find and Replace' : undefined,
127
+ "aria-modal": expValEquals('platform_editor_find_replace_a11y_fixes', 'isEnabled', true) ? false : undefined,
128
+ ref: this.modalRef
125
129
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
126
- jsx("div", {
127
- ref: this.modalRef,
128
- css: [wrapperStyles, wrapperPaddingStyles]
129
- }, jsx(Find, {
130
- allowMatchCase: allowMatchCase,
131
- shouldMatchCase: shouldMatchCase,
132
- onToggleMatchCase: onToggleMatchCase,
133
- findText: findText,
134
- count: count,
135
- shouldFocus: shouldFocus,
136
- onFind: onFind,
137
- onFindBlur: onFindBlur,
138
- onFindPrev: onFindPrev,
139
- onFindNext: onFindNext,
140
- onFindTextfieldRefSet: this.setFindTextfieldRef,
141
- onCancel: onCancel,
142
- onArrowDown: this.setFocusToReplace,
143
- findTyped: this.state.findTyped,
144
- setFindTyped: this.setFindTyped
145
- }), jsx("hr", {
146
- role: "presentation",
147
- css: ruleStyles,
148
- id: "replace-hr-element"
149
- }), fg('editor_a11y_refactor_find_replace_style') ? jsx(ReplaceNext, {
150
- canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
151
- replaceText: replaceText,
152
- onReplace: onReplace,
153
- onReplaceAll: onReplaceAll,
154
- onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
155
- onArrowUp: this.setFocusToFind,
156
- onCancel: onCancel,
157
- count: count,
158
- onFindPrev: onFindPrev,
159
- onFindNext: onFindNext,
160
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
161
- findTyped: this.state.findTyped,
162
- setFindTyped: this.setFindTyped,
163
- focusToolbarButton: focusToolbarButton
164
- }) : jsx(Replace, {
165
- canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
166
- replaceText: replaceText,
167
- onReplace: onReplace,
168
- onReplaceAll: onReplaceAll,
169
- onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
170
- onArrowUp: this.setFocusToFind,
171
- onCancel: onCancel,
172
- count: count,
173
- onFindPrev: onFindPrev,
174
- onFindNext: onFindNext,
175
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
176
- findTyped: this.state.findTyped,
177
- setFindTyped: this.setFindTyped,
178
- focusToolbarButton: focusToolbarButton
179
- }))
180
- );
130
+ ,
131
+ css: [wrapperStyles, wrapperPaddingStyles]
132
+ }, jsx(Find, {
133
+ allowMatchCase: allowMatchCase,
134
+ shouldMatchCase: shouldMatchCase,
135
+ onToggleMatchCase: onToggleMatchCase,
136
+ findText: findText,
137
+ count: count,
138
+ shouldFocus: shouldFocus,
139
+ onFind: onFind,
140
+ onFindBlur: onFindBlur,
141
+ onFindPrev: onFindPrev,
142
+ onFindNext: onFindNext,
143
+ onFindTextfieldRefSet: this.setFindTextfieldRef,
144
+ onCancel: onCancel,
145
+ onArrowDown: this.setFocusToReplace,
146
+ findTyped: this.state.findTyped,
147
+ setFindTyped: this.setFindTyped
148
+ }), jsx("hr", {
149
+ role: "presentation",
150
+ css: ruleStyles,
151
+ id: "replace-hr-element"
152
+ }), fg('editor_a11y_refactor_find_replace_style') ? jsx(ReplaceNext, {
153
+ canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
154
+ replaceText: replaceText,
155
+ onReplace: onReplace,
156
+ onReplaceAll: onReplaceAll,
157
+ onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
158
+ onArrowUp: this.setFocusToFind,
159
+ onCancel: onCancel,
160
+ count: count,
161
+ onFindPrev: onFindPrev,
162
+ onFindNext: onFindNext,
163
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
164
+ findTyped: this.state.findTyped,
165
+ setFindTyped: this.setFindTyped,
166
+ focusToolbarButton: focusToolbarButton
167
+ }) : jsx(Replace, {
168
+ canReplace: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
169
+ replaceText: replaceText,
170
+ onReplace: onReplace,
171
+ onReplaceAll: onReplaceAll,
172
+ onReplaceTextfieldRefSet: this.setReplaceTextfieldRef,
173
+ onArrowUp: this.setFocusToFind,
174
+ onCancel: onCancel,
175
+ count: count,
176
+ onFindPrev: onFindPrev,
177
+ onFindNext: onFindNext,
178
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
179
+ findTyped: this.state.findTyped,
180
+ setFindTyped: this.setFindTyped,
181
+ focusToolbarButton: focusToolbarButton
182
+ }));
181
183
  }
182
184
  }]);
183
185
  }(React.PureComponent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "description": "find replace 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/textfield": "^8.0.0",
50
50
  "@atlaskit/theme": "^19.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^11.0.0",
51
+ "@atlaskit/tmp-editor-statsig": "^11.2.0",
52
52
  "@atlaskit/tokens": "^6.0.0",
53
53
  "@atlaskit/tooltip": "^20.4.0",
54
54
  "@babel/runtime": "^7.0.0",