@atlaskit/editor-plugin-find-replace 3.1.0 → 3.1.2
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 +14 -0
- package/dist/cjs/ui/Replace.js +43 -3
- package/dist/cjs/ui/ReplaceNext.js +17 -2
- package/dist/es2019/ui/Replace.js +44 -4
- package/dist/es2019/ui/ReplaceNext.js +17 -2
- package/dist/esm/ui/Replace.js +44 -4
- package/dist/esm/ui/ReplaceNext.js +17 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-find-replace
|
|
2
2
|
|
|
3
|
+
## 3.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#183007](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183007)
|
|
8
|
+
[`a1cfc7e470ca7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a1cfc7e470ca7) -
|
|
9
|
+
[ux] ED-28316 wrap find and replace close button to next line if it would overflow
|
|
10
|
+
|
|
11
|
+
## 3.1.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 3.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/cjs/ui/Replace.js
CHANGED
|
@@ -18,9 +18,11 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
18
18
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
19
19
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
20
20
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
21
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
21
22
|
var _form = require("@atlaskit/form");
|
|
22
23
|
var _chevronDownHipchatChevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down"));
|
|
23
24
|
var _chevronUpHipchatChevronUp = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up"));
|
|
25
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
26
|
var _primitives = require("@atlaskit/primitives");
|
|
25
27
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
26
28
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -32,6 +34,44 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
32
34
|
* @jsxRuntime classic
|
|
33
35
|
* @jsx jsx
|
|
34
36
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
37
|
+
var sectionWrapperStyles = (0, _react2.css)({
|
|
38
|
+
display: 'flex',
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
40
|
+
'& > *': {
|
|
41
|
+
display: 'inline-flex',
|
|
42
|
+
height: '32px',
|
|
43
|
+
flex: '0 0 auto'
|
|
44
|
+
},
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
|
+
'& > [data-ds--text-field--container]': {
|
|
47
|
+
display: 'flex',
|
|
48
|
+
flex: '1 1 auto'
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var sectionWrapperStylesAlternate = (0, _react2.css)({
|
|
52
|
+
display: 'flex',
|
|
53
|
+
padding: "var(--ds-space-100, 8px)",
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
55
|
+
'& > *': {
|
|
56
|
+
height: 'unset'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var sectionWrapperJustified = (0, _react2.css)({
|
|
60
|
+
justifyContent: 'space-between',
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
62
|
+
fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(14)
|
|
63
|
+
});
|
|
64
|
+
var sectionWrapperFlexWrap = (0, _react2.css)({
|
|
65
|
+
flexWrap: 'wrap-reverse',
|
|
66
|
+
gap: "var(--ds-space-075, 6px)"
|
|
67
|
+
});
|
|
68
|
+
var orderOneStyles = (0, _react2.css)({
|
|
69
|
+
order: '1'
|
|
70
|
+
});
|
|
71
|
+
var orderOneStylesNew = (0, _react2.css)({
|
|
72
|
+
order: '1',
|
|
73
|
+
marginLeft: 'auto'
|
|
74
|
+
});
|
|
35
75
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
36
76
|
var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
37
77
|
function Replace(props) {
|
|
@@ -221,7 +261,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
221
261
|
numberOfMatches: replaceCount
|
|
222
262
|
});
|
|
223
263
|
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", {
|
|
224
|
-
css: [
|
|
264
|
+
css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
|
|
225
265
|
}, (0, _react2.jsx)("div", {
|
|
226
266
|
css: _uiStyles.textFieldWrapper
|
|
227
267
|
}, (0, _react2.jsx)(_form.Label, {
|
|
@@ -251,9 +291,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
251
291
|
// Ignored via go/ees005
|
|
252
292
|
// eslint-disable-next-line require-unicode-regexp
|
|
253
293
|
resultsReplace.replace(/ /, "\xA0") : resultsReplace)))), (0, _react2.jsx)("div", {
|
|
254
|
-
css: [
|
|
294
|
+
css: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_find_and_replace_improvements_1') ? [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified, sectionWrapperFlexWrap] : [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
255
295
|
}, (0, _react2.jsx)("div", {
|
|
256
|
-
css:
|
|
296
|
+
css: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_find_and_replace_improvements_1') ? orderOneStylesNew : orderOneStyles
|
|
257
297
|
}, (0, _react2.jsx)("div", {
|
|
258
298
|
css: _uiStyles.nextPreviousItemStyles
|
|
259
299
|
}, (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
@@ -15,6 +15,7 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
15
15
|
var _form = require("@atlaskit/form");
|
|
16
16
|
var _chevronDownHipchatChevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down"));
|
|
17
17
|
var _chevronUpHipchatChevronUp = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up"));
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _primitives = require("@atlaskit/primitives");
|
|
19
20
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
20
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -33,9 +34,17 @@ var actionButtonParentInlineStyles = (0, _primitives.xcss)({
|
|
|
33
34
|
justifyContent: 'space-between',
|
|
34
35
|
flexDirection: 'row-reverse'
|
|
35
36
|
});
|
|
37
|
+
var actionButtonParentInlineStylesNew = (0, _primitives.xcss)({
|
|
38
|
+
justifyContent: 'space-between',
|
|
39
|
+
flexDirection: 'row-reverse',
|
|
40
|
+
flexWrap: 'wrap'
|
|
41
|
+
});
|
|
36
42
|
var actionButtonInlineStyles = (0, _primitives.xcss)({
|
|
37
43
|
gap: 'space.075'
|
|
38
44
|
});
|
|
45
|
+
var closeButtonInlineStyles = (0, _primitives.xcss)({
|
|
46
|
+
marginRight: 'auto'
|
|
47
|
+
});
|
|
39
48
|
var Replace = function Replace(_ref) {
|
|
40
49
|
var canReplace = _ref.canReplace,
|
|
41
50
|
initialReplaceText = _ref.replaceText,
|
|
@@ -212,7 +221,7 @@ var Replace = function Replace(_ref) {
|
|
|
212
221
|
}, fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(/ /, "\xA0") : resultsReplace)), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
213
222
|
xcss: actionButtonContainerStyles
|
|
214
223
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
215
|
-
xcss: [actionButtonInlineStyles, actionButtonParentInlineStyles]
|
|
224
|
+
xcss: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_find_and_replace_improvements_1') ? [actionButtonInlineStyles, actionButtonParentInlineStylesNew] : [actionButtonInlineStyles, actionButtonParentInlineStyles]
|
|
216
225
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
217
226
|
xcss: actionButtonInlineStyles
|
|
218
227
|
}, /*#__PURE__*/_react.default.createElement(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
@@ -250,7 +259,13 @@ var Replace = function Replace(_ref) {
|
|
|
250
259
|
id: "replaceAll-button",
|
|
251
260
|
onClick: handleReplaceAllClick,
|
|
252
261
|
isDisabled: (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? count.totalReplaceable === 0 : !canReplace
|
|
253
|
-
}, replaceAll)), /*#__PURE__*/_react.default.createElement(
|
|
262
|
+
}, replaceAll)), (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_find_and_replace_improvements_1') ? /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
263
|
+
xcss: closeButtonInlineStyles
|
|
264
|
+
}, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
265
|
+
appearance: "subtle",
|
|
266
|
+
testId: closeFindReplaceDialog,
|
|
267
|
+
onClick: clearSearch
|
|
268
|
+
}, closeFindReplaceDialog)) : /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
254
269
|
appearance: "subtle",
|
|
255
270
|
testId: closeFindReplaceDialog,
|
|
256
271
|
onClick: clearSearch
|
|
@@ -7,19 +7,59 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
import React, { Fragment } from 'react';
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { jsx } from '@emotion/react';
|
|
10
|
+
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import Button from '@atlaskit/button/new';
|
|
13
13
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
14
|
import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
15
16
|
import { Label, ValidMessage } from '@atlaskit/form';
|
|
16
17
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
17
18
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
20
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
19
21
|
import Textfield from '@atlaskit/textfield';
|
|
20
22
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
23
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
22
|
-
import { nextPreviousItemStyles,
|
|
24
|
+
import { nextPreviousItemStyles, orderZeroStyles, textFieldWrapper } from './ui-styles';
|
|
25
|
+
const sectionWrapperStyles = css({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
28
|
+
'& > *': {
|
|
29
|
+
display: 'inline-flex',
|
|
30
|
+
height: '32px',
|
|
31
|
+
flex: '0 0 auto'
|
|
32
|
+
},
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
34
|
+
'& > [data-ds--text-field--container]': {
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flex: '1 1 auto'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const sectionWrapperStylesAlternate = css({
|
|
40
|
+
display: 'flex',
|
|
41
|
+
padding: "var(--ds-space-100, 8px)",
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
43
|
+
'& > *': {
|
|
44
|
+
height: 'unset'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const sectionWrapperJustified = css({
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
50
|
+
fontSize: relativeFontSizeToBase16(14)
|
|
51
|
+
});
|
|
52
|
+
const sectionWrapperFlexWrap = css({
|
|
53
|
+
flexWrap: 'wrap-reverse',
|
|
54
|
+
gap: "var(--ds-space-075, 6px)"
|
|
55
|
+
});
|
|
56
|
+
const orderOneStyles = css({
|
|
57
|
+
order: '1'
|
|
58
|
+
});
|
|
59
|
+
const orderOneStylesNew = css({
|
|
60
|
+
order: '1',
|
|
61
|
+
marginLeft: 'auto'
|
|
62
|
+
});
|
|
23
63
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
24
64
|
class Replace extends React.PureComponent {
|
|
25
65
|
constructor(props) {
|
|
@@ -232,9 +272,9 @@ class Replace extends React.PureComponent {
|
|
|
232
272
|
// Ignored via go/ees005
|
|
233
273
|
// eslint-disable-next-line require-unicode-regexp
|
|
234
274
|
resultsReplace.replace(/ /, '\u00a0') : resultsReplace)))), jsx("div", {
|
|
235
|
-
css: [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
275
|
+
css: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified, sectionWrapperFlexWrap] : [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
236
276
|
}, jsx("div", {
|
|
237
|
-
css: orderOneStyles
|
|
277
|
+
css: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? orderOneStylesNew : orderOneStyles
|
|
238
278
|
}, jsx("div", {
|
|
239
279
|
css: nextPreviousItemStyles
|
|
240
280
|
}, jsx(FindReplaceTooltipButton, {
|
|
@@ -6,6 +6,7 @@ import { findReplaceMessages as messages } from '@atlaskit/editor-common/message
|
|
|
6
6
|
import { ValidMessage } from '@atlaskit/form';
|
|
7
7
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
8
8
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { Box, Inline, Text, xcss } from '@atlaskit/primitives';
|
|
10
11
|
import Textfield from '@atlaskit/textfield';
|
|
11
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -23,9 +24,17 @@ const actionButtonParentInlineStyles = xcss({
|
|
|
23
24
|
justifyContent: 'space-between',
|
|
24
25
|
flexDirection: 'row-reverse'
|
|
25
26
|
});
|
|
27
|
+
const actionButtonParentInlineStylesNew = xcss({
|
|
28
|
+
justifyContent: 'space-between',
|
|
29
|
+
flexDirection: 'row-reverse',
|
|
30
|
+
flexWrap: 'wrap'
|
|
31
|
+
});
|
|
26
32
|
const actionButtonInlineStyles = xcss({
|
|
27
33
|
gap: 'space.075'
|
|
28
34
|
});
|
|
35
|
+
const closeButtonInlineStyles = xcss({
|
|
36
|
+
marginRight: 'auto'
|
|
37
|
+
});
|
|
29
38
|
const Replace = ({
|
|
30
39
|
canReplace,
|
|
31
40
|
replaceText: initialReplaceText,
|
|
@@ -182,7 +191,7 @@ const Replace = ({
|
|
|
182
191
|
}, fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(/ /u, '\u00a0') : resultsReplace)), /*#__PURE__*/React.createElement(Box, {
|
|
183
192
|
xcss: actionButtonContainerStyles
|
|
184
193
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
185
|
-
xcss: [actionButtonInlineStyles, actionButtonParentInlineStyles]
|
|
194
|
+
xcss: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? [actionButtonInlineStyles, actionButtonParentInlineStylesNew] : [actionButtonInlineStyles, actionButtonParentInlineStyles]
|
|
186
195
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
187
196
|
xcss: actionButtonInlineStyles
|
|
188
197
|
}, /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
|
|
@@ -216,7 +225,13 @@ const Replace = ({
|
|
|
216
225
|
id: "replaceAll-button",
|
|
217
226
|
onClick: handleReplaceAllClick,
|
|
218
227
|
isDisabled: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? count.totalReplaceable === 0 : !canReplace
|
|
219
|
-
}, replaceAll)), /*#__PURE__*/React.createElement(
|
|
228
|
+
}, replaceAll)), expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? /*#__PURE__*/React.createElement(Inline, {
|
|
229
|
+
xcss: closeButtonInlineStyles
|
|
230
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
231
|
+
appearance: "subtle",
|
|
232
|
+
testId: closeFindReplaceDialog,
|
|
233
|
+
onClick: clearSearch
|
|
234
|
+
}, closeFindReplaceDialog)) : /*#__PURE__*/React.createElement(Button, {
|
|
220
235
|
appearance: "subtle",
|
|
221
236
|
testId: closeFindReplaceDialog,
|
|
222
237
|
onClick: clearSearch
|
package/dist/esm/ui/Replace.js
CHANGED
|
@@ -14,19 +14,59 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
14
14
|
import React, { Fragment } from 'react';
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
|
-
import { jsx } from '@emotion/react';
|
|
17
|
+
import { css, jsx } from '@emotion/react';
|
|
18
18
|
import { injectIntl } from 'react-intl-next';
|
|
19
19
|
import Button from '@atlaskit/button/new';
|
|
20
20
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
21
21
|
import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
|
|
22
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
22
23
|
import { Label, ValidMessage } from '@atlaskit/form';
|
|
23
24
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
24
25
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
26
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
25
27
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
26
28
|
import Textfield from '@atlaskit/textfield';
|
|
27
29
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
28
30
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
29
|
-
import { nextPreviousItemStyles,
|
|
31
|
+
import { nextPreviousItemStyles, orderZeroStyles, textFieldWrapper } from './ui-styles';
|
|
32
|
+
var sectionWrapperStyles = css({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
35
|
+
'& > *': {
|
|
36
|
+
display: 'inline-flex',
|
|
37
|
+
height: '32px',
|
|
38
|
+
flex: '0 0 auto'
|
|
39
|
+
},
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
41
|
+
'& > [data-ds--text-field--container]': {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flex: '1 1 auto'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var sectionWrapperStylesAlternate = css({
|
|
47
|
+
display: 'flex',
|
|
48
|
+
padding: "var(--ds-space-100, 8px)",
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
50
|
+
'& > *': {
|
|
51
|
+
height: 'unset'
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var sectionWrapperJustified = css({
|
|
55
|
+
justifyContent: 'space-between',
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
57
|
+
fontSize: relativeFontSizeToBase16(14)
|
|
58
|
+
});
|
|
59
|
+
var sectionWrapperFlexWrap = css({
|
|
60
|
+
flexWrap: 'wrap-reverse',
|
|
61
|
+
gap: "var(--ds-space-075, 6px)"
|
|
62
|
+
});
|
|
63
|
+
var orderOneStyles = css({
|
|
64
|
+
order: '1'
|
|
65
|
+
});
|
|
66
|
+
var orderOneStylesNew = css({
|
|
67
|
+
order: '1',
|
|
68
|
+
marginLeft: 'auto'
|
|
69
|
+
});
|
|
30
70
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
71
|
var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
32
72
|
function Replace(props) {
|
|
@@ -246,9 +286,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
246
286
|
// Ignored via go/ees005
|
|
247
287
|
// eslint-disable-next-line require-unicode-regexp
|
|
248
288
|
resultsReplace.replace(/ /, "\xA0") : resultsReplace)))), jsx("div", {
|
|
249
|
-
css: [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
289
|
+
css: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified, sectionWrapperFlexWrap] : [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
250
290
|
}, jsx("div", {
|
|
251
|
-
css: orderOneStyles
|
|
291
|
+
css: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? orderOneStylesNew : orderOneStyles
|
|
252
292
|
}, jsx("div", {
|
|
253
293
|
css: nextPreviousItemStyles
|
|
254
294
|
}, jsx(FindReplaceTooltipButton, {
|
|
@@ -7,6 +7,7 @@ import { findReplaceMessages as messages } from '@atlaskit/editor-common/message
|
|
|
7
7
|
import { ValidMessage } from '@atlaskit/form';
|
|
8
8
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
9
9
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { Box, Inline, Text, xcss } from '@atlaskit/primitives';
|
|
11
12
|
import Textfield from '@atlaskit/textfield';
|
|
12
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -24,9 +25,17 @@ var actionButtonParentInlineStyles = xcss({
|
|
|
24
25
|
justifyContent: 'space-between',
|
|
25
26
|
flexDirection: 'row-reverse'
|
|
26
27
|
});
|
|
28
|
+
var actionButtonParentInlineStylesNew = xcss({
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
flexDirection: 'row-reverse',
|
|
31
|
+
flexWrap: 'wrap'
|
|
32
|
+
});
|
|
27
33
|
var actionButtonInlineStyles = xcss({
|
|
28
34
|
gap: 'space.075'
|
|
29
35
|
});
|
|
36
|
+
var closeButtonInlineStyles = xcss({
|
|
37
|
+
marginRight: 'auto'
|
|
38
|
+
});
|
|
30
39
|
var Replace = function Replace(_ref) {
|
|
31
40
|
var canReplace = _ref.canReplace,
|
|
32
41
|
initialReplaceText = _ref.replaceText,
|
|
@@ -203,7 +212,7 @@ var Replace = function Replace(_ref) {
|
|
|
203
212
|
}, fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(/ /, "\xA0") : resultsReplace)), /*#__PURE__*/React.createElement(Box, {
|
|
204
213
|
xcss: actionButtonContainerStyles
|
|
205
214
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
206
|
-
xcss: [actionButtonInlineStyles, actionButtonParentInlineStyles]
|
|
215
|
+
xcss: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? [actionButtonInlineStyles, actionButtonParentInlineStylesNew] : [actionButtonInlineStyles, actionButtonParentInlineStyles]
|
|
207
216
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
208
217
|
xcss: actionButtonInlineStyles
|
|
209
218
|
}, /*#__PURE__*/React.createElement(FindReplaceTooltipButton, {
|
|
@@ -241,7 +250,13 @@ var Replace = function Replace(_ref) {
|
|
|
241
250
|
id: "replaceAll-button",
|
|
242
251
|
onClick: handleReplaceAllClick,
|
|
243
252
|
isDisabled: expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? count.totalReplaceable === 0 : !canReplace
|
|
244
|
-
}, replaceAll)), /*#__PURE__*/React.createElement(
|
|
253
|
+
}, replaceAll)), expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) && fg('platform_editor_find_and_replace_improvements_1') ? /*#__PURE__*/React.createElement(Inline, {
|
|
254
|
+
xcss: closeButtonInlineStyles
|
|
255
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
256
|
+
appearance: "subtle",
|
|
257
|
+
testId: closeFindReplaceDialog,
|
|
258
|
+
onClick: clearSearch
|
|
259
|
+
}, closeFindReplaceDialog)) : /*#__PURE__*/React.createElement(Button, {
|
|
245
260
|
appearance: "subtle",
|
|
246
261
|
testId: closeFindReplaceDialog,
|
|
247
262
|
onClick: clearSearch
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^14.10.0",
|
|
49
49
|
"@atlaskit/textfield": "^8.0.0",
|
|
50
|
-
"@atlaskit/theme": "^
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
50
|
+
"@atlaskit/theme": "^19.0.0",
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^9.3.0",
|
|
52
52
|
"@atlaskit/tokens": "^5.4.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.3.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|