@atlaskit/editor-plugin-find-replace 1.2.7 → 1.2.9
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/.eslintrc.js +28 -28
- package/CHANGELOG.md +105 -90
- package/LICENSE.md +6 -8
- package/dist/cjs/ui/Find.js +5 -23
- package/dist/cjs/ui/FindReplaceToolbarButton.js +1 -1
- package/dist/cjs/ui/FindReplaceTooltipButton.js +2 -16
- package/dist/cjs/ui/Replace.js +9 -47
- package/dist/cjs/ui/styles.js +1 -12
- package/dist/es2019/ui/Find.js +5 -23
- package/dist/es2019/ui/FindReplaceToolbarButton.js +10 -10
- package/dist/es2019/ui/FindReplaceTooltipButton.js +2 -16
- package/dist/es2019/ui/Replace.js +10 -48
- package/dist/es2019/ui/styles.js +0 -11
- package/dist/esm/ui/Find.js +5 -23
- package/dist/esm/ui/FindReplaceToolbarButton.js +1 -1
- package/dist/esm/ui/FindReplaceTooltipButton.js +2 -16
- package/dist/esm/ui/Replace.js +10 -48
- package/dist/esm/ui/styles.js +0 -11
- package/dist/types/ui/FindReplaceTooltipButton.d.ts +1 -2
- package/dist/types/ui/styles.d.ts +0 -3
- package/dist/types-ts4.5/ui/FindReplaceTooltipButton.d.ts +1 -2
- package/dist/types-ts4.5/ui/styles.d.ts +0 -3
- package/package.json +7 -12
package/dist/cjs/ui/Replace.js
CHANGED
|
@@ -17,7 +17,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
18
|
var _reactIntlNext = require("react-intl-next");
|
|
19
19
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
20
|
-
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
21
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
22
21
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
23
22
|
var _form = require("@atlaskit/form");
|
|
@@ -159,12 +158,6 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
159
158
|
_this.replaceAll = formatMessage(_messages.findReplaceMessages.replaceAll);
|
|
160
159
|
_this.findNext = formatMessage(_messages.findReplaceMessages.findNext);
|
|
161
160
|
_this.findPrevious = formatMessage(_messages.findReplaceMessages.findPrevious);
|
|
162
|
-
_this.findNextIcon = (0, _react2.jsx)(_chevronDown.default, {
|
|
163
|
-
label: _this.findNext
|
|
164
|
-
});
|
|
165
|
-
_this.findPrevIcon = (0, _react2.jsx)(_chevronUp.default, {
|
|
166
|
-
label: _this.findPrevious
|
|
167
|
-
});
|
|
168
161
|
_this.closeFindReplaceDialog = formatMessage(_messages.findReplaceMessages.closeFindReplaceDialog);
|
|
169
162
|
return _this;
|
|
170
163
|
}
|
|
@@ -222,7 +215,6 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
222
215
|
var resultsReplace = formatMessage(_messages.findReplaceMessages.replaceSuccess, {
|
|
223
216
|
numberOfMatches: replaceCount
|
|
224
217
|
});
|
|
225
|
-
var replaceSectionButtonStyles = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? _styles.replaceSectionButtonNewStyles : _styles.replaceSectionButtonOldStyles;
|
|
226
218
|
return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", {
|
|
227
219
|
css: [_styles.sectionWrapperStyles, _styles.sectionWrapperStylesAlternate]
|
|
228
220
|
}, (0, _react2.jsx)("div", {
|
|
@@ -246,9 +238,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
246
238
|
testId: "message-success-replacement"
|
|
247
239
|
},
|
|
248
240
|
/*
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
241
|
+
Replacement needed to trigger the SR announcement if message hasn't changed. e.g Replace button clicked twice.
|
|
242
|
+
'\u00a0' is value for  
|
|
243
|
+
*/
|
|
252
244
|
this.state.fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(/ /, "\xA0") : resultsReplace)))), (0, _react2.jsx)("div", {
|
|
253
245
|
css: [_styles.sectionWrapperStyles, _styles.sectionWrapperStylesAlternate, _styles.sectionWrapperJustified]
|
|
254
246
|
}, (0, _react2.jsx)("div", {
|
|
@@ -257,8 +249,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
257
249
|
css: _styles.nextPreviousItemStyles
|
|
258
250
|
}, (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
259
251
|
title: this.findNext,
|
|
260
|
-
icon:
|
|
261
|
-
newIcon: _chevronDown.default,
|
|
252
|
+
icon: _chevronDown.default,
|
|
262
253
|
iconLabel: this.findNext,
|
|
263
254
|
keymapDescription: 'Enter',
|
|
264
255
|
onClick: this.handleFindNextClick,
|
|
@@ -267,13 +258,12 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
267
258
|
css: _styles.nextPreviousItemStyles
|
|
268
259
|
}, (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
269
260
|
title: this.findPrevious,
|
|
270
|
-
icon:
|
|
271
|
-
newIcon: _chevronUp.default,
|
|
261
|
+
icon: _chevronUp.default,
|
|
272
262
|
iconLabel: this.findPrevious,
|
|
273
263
|
keymapDescription: 'Shift Enter',
|
|
274
264
|
onClick: this.handleFindPrevClick,
|
|
275
265
|
disabled: count.total <= 1
|
|
276
|
-
})), (0,
|
|
266
|
+
})), (0, _react2.jsx)(_primitives.Inline, {
|
|
277
267
|
space: "space.075",
|
|
278
268
|
xcss: (0, _primitives.xcss)({
|
|
279
269
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
@@ -292,27 +282,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
292
282
|
id: "replaceAll-button",
|
|
293
283
|
onClick: this.handleReplaceAllClick,
|
|
294
284
|
isDisabled: !canReplace
|
|
295
|
-
}, this.replaceAll)) : (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_standardButton.default, {
|
|
296
|
-
css: replaceSectionButtonStyles,
|
|
297
|
-
testId: this.replace,
|
|
298
|
-
id: "replace-button",
|
|
299
|
-
onClick: this.handleReplaceClick,
|
|
300
|
-
isDisabled: !canReplace
|
|
301
|
-
}, this.replace), (0, _react2.jsx)(_standardButton.default, {
|
|
302
|
-
css: replaceSectionButtonStyles,
|
|
303
|
-
appearance: "primary",
|
|
304
|
-
testId: this.replaceAll,
|
|
305
|
-
id: "replaceAll-button",
|
|
306
|
-
onClick: this.handleReplaceAllClick,
|
|
307
|
-
isDisabled: !canReplace
|
|
308
285
|
}, this.replaceAll))), (0, _react2.jsx)("div", {
|
|
309
|
-
css:
|
|
310
|
-
}, (0,
|
|
311
|
-
appearance: "subtle",
|
|
312
|
-
testId: this.closeFindReplaceDialog,
|
|
313
|
-
onClick: this.clearSearch
|
|
314
|
-
}, this.closeFindReplaceDialog) : (0, _react2.jsx)(_standardButton.default, {
|
|
315
|
-
css: replaceSectionButtonStyles,
|
|
286
|
+
css: _styles.orderZeroStyles
|
|
287
|
+
}, (0, _react2.jsx)(_new.default, {
|
|
316
288
|
appearance: "subtle",
|
|
317
289
|
testId: this.closeFindReplaceDialog,
|
|
318
290
|
onClick: this.clearSearch
|
|
@@ -329,7 +301,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
329
301
|
onKeyDown: this.handleReplaceKeyDown,
|
|
330
302
|
onCompositionStart: this.handleCompositionStart,
|
|
331
303
|
onCompositionEnd: this.handleCompositionEnd
|
|
332
|
-
}), (0,
|
|
304
|
+
}), (0, _react2.jsx)(_primitives.Inline, {
|
|
333
305
|
space: "space.050"
|
|
334
306
|
}, (0, _react2.jsx)(_new.default, {
|
|
335
307
|
testId: this.replace,
|
|
@@ -339,16 +311,6 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
339
311
|
testId: this.replaceAll,
|
|
340
312
|
onClick: this.handleReplaceAllClick,
|
|
341
313
|
isDisabled: !canReplace
|
|
342
|
-
}, this.replaceAll)) : (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_standardButton.default, {
|
|
343
|
-
css: replaceSectionButtonStyles,
|
|
344
|
-
testId: this.replace,
|
|
345
|
-
onClick: this.handleReplaceClick,
|
|
346
|
-
isDisabled: !canReplace
|
|
347
|
-
}, this.replace), (0, _react2.jsx)(_standardButton.default, {
|
|
348
|
-
css: replaceSectionButtonStyles,
|
|
349
|
-
testId: this.replaceAll,
|
|
350
|
-
onClick: this.handleReplaceAllClick,
|
|
351
|
-
isDisabled: !canReplace
|
|
352
314
|
}, this.replaceAll)));
|
|
353
315
|
}
|
|
354
316
|
}]);
|
package/dist/cjs/ui/styles.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.wrapperStyles = exports.wrapperPaddingStyles = exports.textFieldWrapper = exports.sectionWrapperStylesAlternate = exports.sectionWrapperStyles = exports.sectionWrapperJustified = exports.ruleStyles = exports.
|
|
6
|
+
exports.wrapperStyles = exports.wrapperPaddingStyles = exports.textFieldWrapper = exports.sectionWrapperStylesAlternate = exports.sectionWrapperStyles = exports.sectionWrapperJustified = exports.ruleStyles = exports.orderZeroStyles = exports.orderOneStyles = exports.nextPreviousItemStyles = exports.matchCaseSection = exports.countWrapperStyles = exports.countStylesAlternateStyles = exports.countStyles = exports.afterInputSection = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
9
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -14,13 +14,6 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
14
14
|
|
|
15
15
|
var fontSize = (0, _constants.fontSize)();
|
|
16
16
|
var gridSize = (0, _constants.gridSize)();
|
|
17
|
-
var replaceSectionButtonNewStyles = exports.replaceSectionButtonNewStyles = (0, _react.css)({
|
|
18
|
-
marginLeft: "var(--ds-space-050, 4px)",
|
|
19
|
-
marginRight: "var(--ds-space-050, 2px)"
|
|
20
|
-
});
|
|
21
|
-
var replaceSectionButtonOldStyles = exports.replaceSectionButtonOldStyles = (0, _react.css)({
|
|
22
|
-
marginLeft: "var(--ds-space-050, 4px)"
|
|
23
|
-
});
|
|
24
17
|
var ruleStyles = exports.ruleStyles = (0, _react.css)({
|
|
25
18
|
width: '100%',
|
|
26
19
|
border: 'none',
|
|
@@ -108,10 +101,6 @@ var orderZeroStyles = exports.orderZeroStyles = (0, _react.css)({
|
|
|
108
101
|
order: '0',
|
|
109
102
|
marginInline: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
110
103
|
});
|
|
111
|
-
var orderZeroDeprecatedStyles = exports.orderZeroDeprecatedStyles = (0, _react.css)({
|
|
112
|
-
order: '0',
|
|
113
|
-
marginInline: 0
|
|
114
|
-
});
|
|
115
104
|
var orderOneStyles = exports.orderOneStyles = (0, _react.css)({
|
|
116
105
|
order: '1'
|
|
117
106
|
});
|
package/dist/es2019/ui/Find.js
CHANGED
|
@@ -134,19 +134,6 @@ class Find extends React.Component {
|
|
|
134
134
|
this.findNext = formatMessage(messages.findNext);
|
|
135
135
|
this.findPrevious = formatMessage(messages.findPrevious);
|
|
136
136
|
this.matchCase = formatMessage(messages.matchCase);
|
|
137
|
-
this.matchCaseIcon = jsx(MatchCaseIcon, {
|
|
138
|
-
label: this.matchCase,
|
|
139
|
-
size: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : 'medium'
|
|
140
|
-
});
|
|
141
|
-
this.findNextIcon = jsx(ChevronDownIcon, {
|
|
142
|
-
label: this.findNext
|
|
143
|
-
});
|
|
144
|
-
this.findPrevIcon = jsx(ChevronUpIcon, {
|
|
145
|
-
label: this.findPrevious
|
|
146
|
-
});
|
|
147
|
-
this.closeIcon = jsx(EditorCloseIcon, {
|
|
148
|
-
label: this.closeFindReplaceDialog
|
|
149
|
-
});
|
|
150
137
|
|
|
151
138
|
// We locally manage the value of the input inside this component in order to support compositions.
|
|
152
139
|
// This requires some additional work inside componentDidUpdate to ensure we support changes that
|
|
@@ -214,8 +201,7 @@ class Find extends React.Component {
|
|
|
214
201
|
}, jsx(FindReplaceTooltipButton, {
|
|
215
202
|
title: this.matchCase,
|
|
216
203
|
appearance: "default",
|
|
217
|
-
icon:
|
|
218
|
-
newIcon: MatchCaseIcon,
|
|
204
|
+
icon: MatchCaseIcon,
|
|
219
205
|
iconLabel: this.matchCase,
|
|
220
206
|
iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
|
|
221
207
|
onClick: this.handleMatchCaseClick,
|
|
@@ -266,32 +252,28 @@ class Find extends React.Component {
|
|
|
266
252
|
css: countStyles
|
|
267
253
|
}, count.total === 0 ? this.noResultsFound : resultsCount)), jsx(FindReplaceTooltipButton, {
|
|
268
254
|
title: this.matchCase,
|
|
269
|
-
icon:
|
|
270
|
-
newIcon: MatchCaseIcon,
|
|
255
|
+
icon: MatchCaseIcon,
|
|
271
256
|
iconLabel: this.matchCase,
|
|
272
257
|
iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
|
|
273
258
|
onClick: this.handleMatchCaseClick,
|
|
274
259
|
isPressed: shouldMatchCase
|
|
275
260
|
}), jsx(FindReplaceTooltipButton, {
|
|
276
261
|
title: this.findNext,
|
|
277
|
-
icon:
|
|
278
|
-
newIcon: ChevronDownIcon,
|
|
262
|
+
icon: ChevronDownIcon,
|
|
279
263
|
iconLabel: this.findNext,
|
|
280
264
|
keymapDescription: 'Enter',
|
|
281
265
|
onClick: this.handleFindNextClick,
|
|
282
266
|
disabled: count.total <= 1
|
|
283
267
|
}), jsx(FindReplaceTooltipButton, {
|
|
284
268
|
title: this.findPrevious,
|
|
285
|
-
icon:
|
|
286
|
-
newIcon: ChevronUpIcon,
|
|
269
|
+
icon: ChevronUpIcon,
|
|
287
270
|
iconLabel: this.findPrevious,
|
|
288
271
|
keymapDescription: 'Shift Enter',
|
|
289
272
|
onClick: this.handleFindPrevClick,
|
|
290
273
|
disabled: count.total <= 1
|
|
291
274
|
}), jsx(FindReplaceTooltipButton, {
|
|
292
275
|
title: this.closeFindReplaceDialog,
|
|
293
|
-
icon:
|
|
294
|
-
newIcon: EditorCloseIcon,
|
|
276
|
+
icon: EditorCloseIcon,
|
|
295
277
|
iconLabel: this.closeFindReplaceDialog,
|
|
296
278
|
keymapDescription: 'Escape',
|
|
297
279
|
onClick: this.clearSearch
|
|
@@ -16,16 +16,16 @@ import FindReplace from './FindReplace';
|
|
|
16
16
|
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
18
18
|
const toolbarButtonWrapper = css`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
display: flex;
|
|
20
|
+
flex: 1 1 auto;
|
|
21
|
+
flex-grow: 0;
|
|
22
|
+
justify-content: flex-end;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding: 0 ${"var(--ds-space-100, 8px)"};
|
|
25
|
+
@media (max-width: ${akEditorMobileMaxWidth}px) {
|
|
26
|
+
justify-content: center;
|
|
27
|
+
padding: 0;
|
|
28
|
+
}
|
|
29
29
|
`;
|
|
30
30
|
const toolbarButtonWrapperFullWith = css({
|
|
31
31
|
flexGrow: 1
|
|
@@ -2,9 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { IconButton } from '@atlaskit/button/new';
|
|
5
|
-
import LegacyButton from '@atlaskit/button/standard-button';
|
|
6
5
|
import { findKeymapByDescription, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
7
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
10
8
|
export class FindReplaceTooltipButton extends React.PureComponent {
|
|
@@ -19,7 +17,6 @@ export class FindReplaceTooltipButton extends React.PureComponent {
|
|
|
19
17
|
const {
|
|
20
18
|
title,
|
|
21
19
|
icon,
|
|
22
|
-
newIcon,
|
|
23
20
|
iconSize,
|
|
24
21
|
keymapDescription,
|
|
25
22
|
disabled,
|
|
@@ -38,28 +35,17 @@ export class FindReplaceTooltipButton extends React.PureComponent {
|
|
|
38
35
|
}),
|
|
39
36
|
hideTooltipOnClick: true,
|
|
40
37
|
position: 'top'
|
|
41
|
-
},
|
|
38
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
42
39
|
id: "afterInputSection",
|
|
43
40
|
label: title,
|
|
44
41
|
appearance: appearance,
|
|
45
42
|
testId: title,
|
|
46
43
|
ref: this.buttonRef,
|
|
47
|
-
icon:
|
|
44
|
+
icon: icon,
|
|
48
45
|
UNSAFE_size: iconSize,
|
|
49
46
|
isDisabled: disabled,
|
|
50
47
|
onClick: this.handleClick,
|
|
51
48
|
isSelected: isPressed
|
|
52
|
-
}, pressedProps)) : /*#__PURE__*/React.createElement(LegacyButton, _extends({
|
|
53
|
-
id: "afterInputSection",
|
|
54
|
-
label: title,
|
|
55
|
-
appearance: appearance,
|
|
56
|
-
testId: title,
|
|
57
|
-
ref: this.buttonRef,
|
|
58
|
-
iconBefore: icon,
|
|
59
|
-
isDisabled: disabled,
|
|
60
|
-
onClick: this.handleClick,
|
|
61
|
-
isSelected: isPressed,
|
|
62
|
-
shouldFitContainer: true
|
|
63
49
|
}, pressedProps)));
|
|
64
50
|
}
|
|
65
51
|
}
|
|
@@ -5,7 +5,6 @@ import React, { Fragment } from 'react';
|
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import Button from '@atlaskit/button/new';
|
|
8
|
-
import LegacyButton from '@atlaskit/button/standard-button';
|
|
9
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
9
|
import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
10
|
import { Label, ValidMessage } from '@atlaskit/form';
|
|
@@ -15,7 +14,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
15
14
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
16
15
|
import Textfield from '@atlaskit/textfield';
|
|
17
16
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
18
|
-
import { nextPreviousItemStyles, orderOneStyles,
|
|
17
|
+
import { nextPreviousItemStyles, orderOneStyles, orderZeroStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
|
|
19
18
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
20
19
|
class Replace extends React.PureComponent {
|
|
21
20
|
constructor(props) {
|
|
@@ -137,12 +136,6 @@ class Replace extends React.PureComponent {
|
|
|
137
136
|
this.replaceAll = formatMessage(messages.replaceAll);
|
|
138
137
|
this.findNext = formatMessage(messages.findNext);
|
|
139
138
|
this.findPrevious = formatMessage(messages.findPrevious);
|
|
140
|
-
this.findNextIcon = jsx(ChevronDownIcon, {
|
|
141
|
-
label: this.findNext
|
|
142
|
-
});
|
|
143
|
-
this.findPrevIcon = jsx(ChevronUpIcon, {
|
|
144
|
-
label: this.findPrevious
|
|
145
|
-
});
|
|
146
139
|
this.closeFindReplaceDialog = formatMessage(messages.closeFindReplaceDialog);
|
|
147
140
|
}
|
|
148
141
|
componentDidMount() {
|
|
@@ -198,7 +191,6 @@ class Replace extends React.PureComponent {
|
|
|
198
191
|
const resultsReplace = formatMessage(messages.replaceSuccess, {
|
|
199
192
|
numberOfMatches: replaceCount
|
|
200
193
|
});
|
|
201
|
-
const replaceSectionButtonStyles = getBooleanFF('platform.editor.a11y-find-replace') ? replaceSectionButtonNewStyles : replaceSectionButtonOldStyles;
|
|
202
194
|
return getBooleanFF('platform.editor.a11y-find-replace') ? jsx(Fragment, null, jsx("div", {
|
|
203
195
|
css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
|
|
204
196
|
}, jsx("div", {
|
|
@@ -222,9 +214,9 @@ class Replace extends React.PureComponent {
|
|
|
222
214
|
testId: "message-success-replacement"
|
|
223
215
|
},
|
|
224
216
|
/*
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
217
|
+
Replacement needed to trigger the SR announcement if message hasn't changed. e.g Replace button clicked twice.
|
|
218
|
+
'\u00a0' is value for  
|
|
219
|
+
*/
|
|
228
220
|
this.state.fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(/ /, '\u00a0') : resultsReplace)))), jsx("div", {
|
|
229
221
|
css: [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
230
222
|
}, jsx("div", {
|
|
@@ -233,8 +225,7 @@ class Replace extends React.PureComponent {
|
|
|
233
225
|
css: nextPreviousItemStyles
|
|
234
226
|
}, jsx(FindReplaceTooltipButton, {
|
|
235
227
|
title: this.findNext,
|
|
236
|
-
icon:
|
|
237
|
-
newIcon: ChevronDownIcon,
|
|
228
|
+
icon: ChevronDownIcon,
|
|
238
229
|
iconLabel: this.findNext,
|
|
239
230
|
keymapDescription: 'Enter',
|
|
240
231
|
onClick: this.handleFindNextClick,
|
|
@@ -243,13 +234,12 @@ class Replace extends React.PureComponent {
|
|
|
243
234
|
css: nextPreviousItemStyles
|
|
244
235
|
}, jsx(FindReplaceTooltipButton, {
|
|
245
236
|
title: this.findPrevious,
|
|
246
|
-
icon:
|
|
247
|
-
newIcon: ChevronUpIcon,
|
|
237
|
+
icon: ChevronUpIcon,
|
|
248
238
|
iconLabel: this.findPrevious,
|
|
249
239
|
keymapDescription: 'Shift Enter',
|
|
250
240
|
onClick: this.handleFindPrevClick,
|
|
251
241
|
disabled: count.total <= 1
|
|
252
|
-
})),
|
|
242
|
+
})), jsx(Inline, {
|
|
253
243
|
space: "space.075",
|
|
254
244
|
xcss: xcss({
|
|
255
245
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
@@ -268,27 +258,9 @@ class Replace extends React.PureComponent {
|
|
|
268
258
|
id: "replaceAll-button",
|
|
269
259
|
onClick: this.handleReplaceAllClick,
|
|
270
260
|
isDisabled: !canReplace
|
|
271
|
-
}, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
|
|
272
|
-
css: replaceSectionButtonStyles,
|
|
273
|
-
testId: this.replace,
|
|
274
|
-
id: "replace-button",
|
|
275
|
-
onClick: this.handleReplaceClick,
|
|
276
|
-
isDisabled: !canReplace
|
|
277
|
-
}, this.replace), jsx(LegacyButton, {
|
|
278
|
-
css: replaceSectionButtonStyles,
|
|
279
|
-
appearance: "primary",
|
|
280
|
-
testId: this.replaceAll,
|
|
281
|
-
id: "replaceAll-button",
|
|
282
|
-
onClick: this.handleReplaceAllClick,
|
|
283
|
-
isDisabled: !canReplace
|
|
284
261
|
}, this.replaceAll))), jsx("div", {
|
|
285
|
-
css:
|
|
286
|
-
},
|
|
287
|
-
appearance: "subtle",
|
|
288
|
-
testId: this.closeFindReplaceDialog,
|
|
289
|
-
onClick: this.clearSearch
|
|
290
|
-
}, this.closeFindReplaceDialog) : jsx(LegacyButton, {
|
|
291
|
-
css: replaceSectionButtonStyles,
|
|
262
|
+
css: orderZeroStyles
|
|
263
|
+
}, jsx(Button, {
|
|
292
264
|
appearance: "subtle",
|
|
293
265
|
testId: this.closeFindReplaceDialog,
|
|
294
266
|
onClick: this.clearSearch
|
|
@@ -305,7 +277,7 @@ class Replace extends React.PureComponent {
|
|
|
305
277
|
onKeyDown: this.handleReplaceKeyDown,
|
|
306
278
|
onCompositionStart: this.handleCompositionStart,
|
|
307
279
|
onCompositionEnd: this.handleCompositionEnd
|
|
308
|
-
}),
|
|
280
|
+
}), jsx(Inline, {
|
|
309
281
|
space: "space.050"
|
|
310
282
|
}, jsx(Button, {
|
|
311
283
|
testId: this.replace,
|
|
@@ -315,16 +287,6 @@ class Replace extends React.PureComponent {
|
|
|
315
287
|
testId: this.replaceAll,
|
|
316
288
|
onClick: this.handleReplaceAllClick,
|
|
317
289
|
isDisabled: !canReplace
|
|
318
|
-
}, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
|
|
319
|
-
css: replaceSectionButtonStyles,
|
|
320
|
-
testId: this.replace,
|
|
321
|
-
onClick: this.handleReplaceClick,
|
|
322
|
-
isDisabled: !canReplace
|
|
323
|
-
}, this.replace), jsx(LegacyButton, {
|
|
324
|
-
css: replaceSectionButtonStyles,
|
|
325
|
-
testId: this.replaceAll,
|
|
326
|
-
onClick: this.handleReplaceAllClick,
|
|
327
|
-
isDisabled: !canReplace
|
|
328
290
|
}, this.replaceAll)));
|
|
329
291
|
}
|
|
330
292
|
}
|
package/dist/es2019/ui/styles.js
CHANGED
|
@@ -9,13 +9,6 @@ import { fontSize as getFontSize,
|
|
|
9
9
|
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
10
10
|
const fontSize = getFontSize();
|
|
11
11
|
const gridSize = getGridSize();
|
|
12
|
-
export const replaceSectionButtonNewStyles = css({
|
|
13
|
-
marginLeft: "var(--ds-space-050, 4px)",
|
|
14
|
-
marginRight: "var(--ds-space-050, 2px)"
|
|
15
|
-
});
|
|
16
|
-
export const replaceSectionButtonOldStyles = css({
|
|
17
|
-
marginLeft: "var(--ds-space-050, 4px)"
|
|
18
|
-
});
|
|
19
12
|
export const ruleStyles = css({
|
|
20
13
|
width: '100%',
|
|
21
14
|
border: 'none',
|
|
@@ -103,10 +96,6 @@ export const orderZeroStyles = css({
|
|
|
103
96
|
order: '0',
|
|
104
97
|
marginInline: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}`
|
|
105
98
|
});
|
|
106
|
-
export const orderZeroDeprecatedStyles = css({
|
|
107
|
-
order: '0',
|
|
108
|
-
marginInline: 0
|
|
109
|
-
});
|
|
110
99
|
export const orderOneStyles = css({
|
|
111
100
|
order: '1'
|
|
112
101
|
});
|
package/dist/esm/ui/Find.js
CHANGED
|
@@ -142,19 +142,6 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
142
142
|
_this.findNext = formatMessage(messages.findNext);
|
|
143
143
|
_this.findPrevious = formatMessage(messages.findPrevious);
|
|
144
144
|
_this.matchCase = formatMessage(messages.matchCase);
|
|
145
|
-
_this.matchCaseIcon = jsx(MatchCaseIcon, {
|
|
146
|
-
label: _this.matchCase,
|
|
147
|
-
size: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : 'medium'
|
|
148
|
-
});
|
|
149
|
-
_this.findNextIcon = jsx(ChevronDownIcon, {
|
|
150
|
-
label: _this.findNext
|
|
151
|
-
});
|
|
152
|
-
_this.findPrevIcon = jsx(ChevronUpIcon, {
|
|
153
|
-
label: _this.findPrevious
|
|
154
|
-
});
|
|
155
|
-
_this.closeIcon = jsx(EditorCloseIcon, {
|
|
156
|
-
label: _this.closeFindReplaceDialog
|
|
157
|
-
});
|
|
158
145
|
|
|
159
146
|
// We locally manage the value of the input inside this component in order to support compositions.
|
|
160
147
|
// This requires some additional work inside componentDidUpdate to ensure we support changes that
|
|
@@ -230,8 +217,7 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
230
217
|
}, jsx(FindReplaceTooltipButton, {
|
|
231
218
|
title: this.matchCase,
|
|
232
219
|
appearance: "default",
|
|
233
|
-
icon:
|
|
234
|
-
newIcon: MatchCaseIcon,
|
|
220
|
+
icon: MatchCaseIcon,
|
|
235
221
|
iconLabel: this.matchCase,
|
|
236
222
|
iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
|
|
237
223
|
onClick: this.handleMatchCaseClick,
|
|
@@ -282,32 +268,28 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
282
268
|
css: countStyles
|
|
283
269
|
}, count.total === 0 ? this.noResultsFound : resultsCount)), jsx(FindReplaceTooltipButton, {
|
|
284
270
|
title: this.matchCase,
|
|
285
|
-
icon:
|
|
286
|
-
newIcon: MatchCaseIcon,
|
|
271
|
+
icon: MatchCaseIcon,
|
|
287
272
|
iconLabel: this.matchCase,
|
|
288
273
|
iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
|
|
289
274
|
onClick: this.handleMatchCaseClick,
|
|
290
275
|
isPressed: shouldMatchCase
|
|
291
276
|
}), jsx(FindReplaceTooltipButton, {
|
|
292
277
|
title: this.findNext,
|
|
293
|
-
icon:
|
|
294
|
-
newIcon: ChevronDownIcon,
|
|
278
|
+
icon: ChevronDownIcon,
|
|
295
279
|
iconLabel: this.findNext,
|
|
296
280
|
keymapDescription: 'Enter',
|
|
297
281
|
onClick: this.handleFindNextClick,
|
|
298
282
|
disabled: count.total <= 1
|
|
299
283
|
}), jsx(FindReplaceTooltipButton, {
|
|
300
284
|
title: this.findPrevious,
|
|
301
|
-
icon:
|
|
302
|
-
newIcon: ChevronUpIcon,
|
|
285
|
+
icon: ChevronUpIcon,
|
|
303
286
|
iconLabel: this.findPrevious,
|
|
304
287
|
keymapDescription: 'Shift Enter',
|
|
305
288
|
onClick: this.handleFindPrevClick,
|
|
306
289
|
disabled: count.total <= 1
|
|
307
290
|
}), jsx(FindReplaceTooltipButton, {
|
|
308
291
|
title: this.closeFindReplaceDialog,
|
|
309
|
-
icon:
|
|
310
|
-
newIcon: EditorCloseIcon,
|
|
292
|
+
icon: EditorCloseIcon,
|
|
311
293
|
iconLabel: this.closeFindReplaceDialog,
|
|
312
294
|
keymapDescription: 'Escape',
|
|
313
295
|
onClick: this.clearSearch
|
|
@@ -25,7 +25,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
25
25
|
import FindReplace from './FindReplace';
|
|
26
26
|
|
|
27
27
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
28
|
-
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
28
|
+
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-grow: 0;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tpadding: 0 ", ";\n\t@media (max-width: ", "px) {\n\t\tjustify-content: center;\n\t\tpadding: 0;\n\t}\n"])), "var(--ds-space-100, 8px)", akEditorMobileMaxWidth);
|
|
29
29
|
var toolbarButtonWrapperFullWith = css({
|
|
30
30
|
flexGrow: 1
|
|
31
31
|
});
|
|
@@ -12,9 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { IconButton } from '@atlaskit/button/new';
|
|
15
|
-
import LegacyButton from '@atlaskit/button/standard-button';
|
|
16
15
|
import { findKeymapByDescription, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
17
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
16
|
import Tooltip from '@atlaskit/tooltip';
|
|
19
17
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
20
18
|
export var FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -39,7 +37,6 @@ export var FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponen
|
|
|
39
37
|
var _this$props = this.props,
|
|
40
38
|
title = _this$props.title,
|
|
41
39
|
icon = _this$props.icon,
|
|
42
|
-
newIcon = _this$props.newIcon,
|
|
43
40
|
iconSize = _this$props.iconSize,
|
|
44
41
|
keymapDescription = _this$props.keymapDescription,
|
|
45
42
|
disabled = _this$props.disabled,
|
|
@@ -55,28 +52,17 @@ export var FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponen
|
|
|
55
52
|
}),
|
|
56
53
|
hideTooltipOnClick: true,
|
|
57
54
|
position: 'top'
|
|
58
|
-
},
|
|
55
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
59
56
|
id: "afterInputSection",
|
|
60
57
|
label: title,
|
|
61
58
|
appearance: appearance,
|
|
62
59
|
testId: title,
|
|
63
60
|
ref: this.buttonRef,
|
|
64
|
-
icon:
|
|
61
|
+
icon: icon,
|
|
65
62
|
UNSAFE_size: iconSize,
|
|
66
63
|
isDisabled: disabled,
|
|
67
64
|
onClick: this.handleClick,
|
|
68
65
|
isSelected: isPressed
|
|
69
|
-
}, pressedProps)) : /*#__PURE__*/React.createElement(LegacyButton, _extends({
|
|
70
|
-
id: "afterInputSection",
|
|
71
|
-
label: title,
|
|
72
|
-
appearance: appearance,
|
|
73
|
-
testId: title,
|
|
74
|
-
ref: this.buttonRef,
|
|
75
|
-
iconBefore: icon,
|
|
76
|
-
isDisabled: disabled,
|
|
77
|
-
onClick: this.handleClick,
|
|
78
|
-
isSelected: isPressed,
|
|
79
|
-
shouldFitContainer: true
|
|
80
66
|
}, pressedProps)));
|
|
81
67
|
}
|
|
82
68
|
}]);
|