@atlaskit/editor-plugin-find-replace 1.5.0 → 1.5.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,14 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#124134](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124134)
8
+ [`80147d04d87b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/80147d04d87b6) -
9
+ Fix bug in React 18 concurrent mode where find input swallows characters
10
+ - Updated dependencies
11
+
3
12
  ## 1.5.0
4
13
 
5
14
  ### Minor Changes
@@ -21,6 +21,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
21
21
  var _messages = require("@atlaskit/editor-common/messages");
22
22
  var _form = require("@atlaskit/form");
23
23
  var _keyboard = _interopRequireDefault(require("@atlaskit/icon/glyph/emoji/keyboard"));
24
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
25
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
25
26
  var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
26
27
  var _styles = require("./styles");
@@ -178,13 +179,24 @@ var Find = /*#__PURE__*/function (_React$Component) {
178
179
  if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
179
180
  this.focusFindTextfield();
180
181
  }
181
- if (this.props.findText !== prevProps.findText) {
182
- this.syncFindText(function () {
183
- // focus after input is synced if find text provided
184
- if (_this3.props.findText) {
185
- _this3.focusFindTextfield();
186
- }
187
- });
182
+ if ((0, _platformFeatureFlags.fg)('react_18_find_replace_concurrent_mode')) {
183
+ if (this.props.findText !== prevProps.findText && this.props.shouldFocus) {
184
+ this.syncFindText(function () {
185
+ // focus after input is synced if find text provided
186
+ if (_this3.props.findText) {
187
+ _this3.focusFindTextfield();
188
+ }
189
+ });
190
+ }
191
+ } else {
192
+ if (this.props.findText !== prevProps.findText) {
193
+ this.syncFindText(function () {
194
+ // focus after input is synced if find text provided
195
+ if (_this3.props.findText) {
196
+ _this3.focusFindTextfield();
197
+ }
198
+ });
199
+ }
188
200
  }
189
201
  }
190
202
  }, {
@@ -15,6 +15,7 @@ import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
15
15
  import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
16
16
  import { Label } from '@atlaskit/form';
17
17
  import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
18
19
  import Textfield from '@atlaskit/textfield';
19
20
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
20
21
  import { afterInputSection, countStyles, countStylesAlternateStyles, matchCaseSection, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
@@ -160,13 +161,24 @@ class Find extends React.Component {
160
161
  if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
161
162
  this.focusFindTextfield();
162
163
  }
163
- if (this.props.findText !== prevProps.findText) {
164
- this.syncFindText(() => {
165
- // focus after input is synced if find text provided
166
- if (this.props.findText) {
167
- this.focusFindTextfield();
168
- }
169
- });
164
+ if (fg('react_18_find_replace_concurrent_mode')) {
165
+ if (this.props.findText !== prevProps.findText && this.props.shouldFocus) {
166
+ this.syncFindText(() => {
167
+ // focus after input is synced if find text provided
168
+ if (this.props.findText) {
169
+ this.focusFindTextfield();
170
+ }
171
+ });
172
+ }
173
+ } else {
174
+ if (this.props.findText !== prevProps.findText) {
175
+ this.syncFindText(() => {
176
+ // focus after input is synced if find text provided
177
+ if (this.props.findText) {
178
+ this.focusFindTextfield();
179
+ }
180
+ });
181
+ }
170
182
  }
171
183
  }
172
184
  componentWillUnmount() {
@@ -23,6 +23,7 @@ import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
23
23
  import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
24
24
  import { Label } from '@atlaskit/form';
25
25
  import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
26
+ import { fg } from '@atlaskit/platform-feature-flags';
26
27
  import Textfield from '@atlaskit/textfield';
27
28
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
28
29
  import { afterInputSection, countStyles, countStylesAlternateStyles, matchCaseSection, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
@@ -175,13 +176,24 @@ var Find = /*#__PURE__*/function (_React$Component) {
175
176
  if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
176
177
  this.focusFindTextfield();
177
178
  }
178
- if (this.props.findText !== prevProps.findText) {
179
- this.syncFindText(function () {
180
- // focus after input is synced if find text provided
181
- if (_this3.props.findText) {
182
- _this3.focusFindTextfield();
183
- }
184
- });
179
+ if (fg('react_18_find_replace_concurrent_mode')) {
180
+ if (this.props.findText !== prevProps.findText && this.props.shouldFocus) {
181
+ this.syncFindText(function () {
182
+ // focus after input is synced if find text provided
183
+ if (_this3.props.findText) {
184
+ _this3.focusFindTextfield();
185
+ }
186
+ });
187
+ }
188
+ } else {
189
+ if (this.props.findText !== prevProps.findText) {
190
+ this.syncFindText(function () {
191
+ // focus after input is synced if find text provided
192
+ if (_this3.props.findText) {
193
+ _this3.focusFindTextfield();
194
+ }
195
+ });
196
+ }
185
197
  }
186
198
  }
187
199
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "find replace plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,13 +35,14 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@atlaskit/button": "^19.1.0",
38
- "@atlaskit/editor-common": "^86.8.0",
38
+ "@atlaskit/editor-common": "^87.0.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.6.0",
40
40
  "@atlaskit/editor-plugin-primary-toolbar": "^1.3.0",
41
41
  "@atlaskit/editor-prosemirror": "5.0.1",
42
42
  "@atlaskit/editor-shared-styles": "^2.13.0",
43
43
  "@atlaskit/form": "^10.4.0",
44
44
  "@atlaskit/icon": "^22.7.0",
45
+ "@atlaskit/platform-feature-flags": "^0.3.0",
45
46
  "@atlaskit/primitives": "^11.1.0",
46
47
  "@atlaskit/textfield": "^6.4.0",
47
48
  "@atlaskit/theme": "^12.11.0",
@@ -105,5 +106,10 @@
105
106
  "@atlaskit/editor-plugin-analytics"
106
107
  ]
107
108
  }
109
+ },
110
+ "platform-feature-flags": {
111
+ "react_18_find_replace_concurrent_mode": {
112
+ "type": "boolean"
113
+ }
108
114
  }
109
115
  }