@atlaskit/editor-plugin-find-replace 6.0.9 → 6.1.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,23 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 6.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8854ad2383b33`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8854ad2383b33) -
8
+ Suppress no-literal-string-in-jsx
9
+
10
+ ## 6.1.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`a21ace8d15c80`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a21ace8d15c80) -
15
+ [ux] Removing a feature gate that was introduced to improve the find and replace experience
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 6.0.9
4
22
 
5
23
  ### Patch Changes
@@ -13,11 +13,9 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _react2 = require("@emotion/react");
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
16
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
17
  var _Find = _interopRequireDefault(require("./Find"));
19
18
  var _Replace = _interopRequireDefault(require("./Replace"));
20
- var _ReplaceNext = _interopRequireDefault(require("./ReplaceNext"));
21
19
  var _uiStyles = require("./ui-styles");
22
20
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
23
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /* eslint-disable @atlaskit/design-system/prefer-primitives */ /**
@@ -32,36 +30,6 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
32
30
  _this = _callSuper(this, FindReplace, [props]);
33
31
  (0, _defineProperty2.default)(_this, "findTextfield", null);
34
32
  (0, _defineProperty2.default)(_this, "replaceTextfield", null);
35
- /**
36
- * Delete this function on cleanup of
37
- * editor_a11y_refactor_find_replace_style
38
- */
39
- (0, _defineProperty2.default)(_this, "handleTabNavigation", function (event) {
40
- if ((0, _platformFeatureFlags.fg)('editor_a11y_refactor_find_replace_style')) {
41
- return;
42
- }
43
- if (event.key === 'Tab') {
44
- event.preventDefault();
45
- var modalFindReplace = _this.modalRef.current;
46
- if (!modalFindReplace || !modalFindReplace.contains(document.activeElement)) {
47
- return;
48
- }
49
- var focusableElements = Array.from(modalFindReplace.querySelectorAll('[tabindex]:not([tabindex="-1"]), input, button')).filter(function (el) {
50
- return el.getAttribute('tabindex') !== '-1';
51
- });
52
- var currentIndex = focusableElements.findIndex(function (el) {
53
- return el === document.activeElement;
54
- });
55
- var isShiftPressed = event.shiftKey;
56
- if (isShiftPressed) {
57
- var prevIndex = (currentIndex - 1 + focusableElements.length) % focusableElements.length;
58
- focusableElements[prevIndex].focus();
59
- } else {
60
- var nextIndex = (currentIndex + 1) % focusableElements.length;
61
- focusableElements[nextIndex].focus();
62
- }
63
- }
64
- });
65
33
  (0, _defineProperty2.default)(_this, "state", {
66
34
  findTyped: false
67
35
  });
@@ -91,18 +59,6 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
91
59
  }
92
60
  (0, _inherits2.default)(FindReplace, _React$PureComponent);
93
61
  return (0, _createClass2.default)(FindReplace, [{
94
- key: "componentDidMount",
95
- value: function componentDidMount() {
96
- // eslint-disable-next-line
97
- window.addEventListener('keydown', this.handleTabNavigation);
98
- }
99
- }, {
100
- key: "componentWillUnmount",
101
- value: function componentWillUnmount() {
102
- // eslint-disable-next-line
103
- window.removeEventListener('keydown', this.handleTabNavigation);
104
- }
105
- }, {
106
62
  key: "render",
107
63
  value: function render() {
108
64
  var _this$props = this.props,
@@ -124,7 +80,9 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
124
80
  onToggleMatchCase = _this$props.onToggleMatchCase;
125
81
  var focusToolbarButton = this.props.focusToolbarButton || function () {};
126
82
  return (0, _react2.jsx)("div", {
127
- role: 'dialog',
83
+ role: 'dialog'
84
+ // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
85
+ ,
128
86
  "aria-label": 'Find and Replace',
129
87
  "aria-modal": false,
130
88
  ref: this.modalRef
@@ -151,22 +109,7 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
151
109
  role: "presentation",
152
110
  css: _uiStyles.ruleStyles,
153
111
  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, {
112
+ }), (0, _react2.jsx)(_Replace.default, {
170
113
  canReplace: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? !!isReplaceable : count.total > 0,
171
114
  replaceText: replaceText,
172
115
  onReplace: onReplace,