@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/esm/ui/Replace.js
CHANGED
|
@@ -13,7 +13,6 @@ import React, { Fragment } from 'react';
|
|
|
13
13
|
import { jsx } from '@emotion/react';
|
|
14
14
|
import { injectIntl } from 'react-intl-next';
|
|
15
15
|
import Button from '@atlaskit/button/new';
|
|
16
|
-
import LegacyButton from '@atlaskit/button/standard-button';
|
|
17
16
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
18
17
|
import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
|
|
19
18
|
import { Label, ValidMessage } from '@atlaskit/form';
|
|
@@ -23,7 +22,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
23
22
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
24
23
|
import Textfield from '@atlaskit/textfield';
|
|
25
24
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
26
|
-
import { nextPreviousItemStyles, orderOneStyles,
|
|
25
|
+
import { nextPreviousItemStyles, orderOneStyles, orderZeroStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
|
|
27
26
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
28
27
|
var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
29
28
|
_inherits(Replace, _React$PureComponent);
|
|
@@ -151,12 +150,6 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
151
150
|
_this.replaceAll = formatMessage(messages.replaceAll);
|
|
152
151
|
_this.findNext = formatMessage(messages.findNext);
|
|
153
152
|
_this.findPrevious = formatMessage(messages.findPrevious);
|
|
154
|
-
_this.findNextIcon = jsx(ChevronDownIcon, {
|
|
155
|
-
label: _this.findNext
|
|
156
|
-
});
|
|
157
|
-
_this.findPrevIcon = jsx(ChevronUpIcon, {
|
|
158
|
-
label: _this.findPrevious
|
|
159
|
-
});
|
|
160
153
|
_this.closeFindReplaceDialog = formatMessage(messages.closeFindReplaceDialog);
|
|
161
154
|
return _this;
|
|
162
155
|
}
|
|
@@ -214,7 +207,6 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
214
207
|
var resultsReplace = formatMessage(messages.replaceSuccess, {
|
|
215
208
|
numberOfMatches: replaceCount
|
|
216
209
|
});
|
|
217
|
-
var replaceSectionButtonStyles = getBooleanFF('platform.editor.a11y-find-replace') ? replaceSectionButtonNewStyles : replaceSectionButtonOldStyles;
|
|
218
210
|
return getBooleanFF('platform.editor.a11y-find-replace') ? jsx(Fragment, null, jsx("div", {
|
|
219
211
|
css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
|
|
220
212
|
}, jsx("div", {
|
|
@@ -238,9 +230,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
238
230
|
testId: "message-success-replacement"
|
|
239
231
|
},
|
|
240
232
|
/*
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
233
|
+
Replacement needed to trigger the SR announcement if message hasn't changed. e.g Replace button clicked twice.
|
|
234
|
+
'\u00a0' is value for  
|
|
235
|
+
*/
|
|
244
236
|
this.state.fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(/ /, "\xA0") : resultsReplace)))), jsx("div", {
|
|
245
237
|
css: [sectionWrapperStyles, sectionWrapperStylesAlternate, sectionWrapperJustified]
|
|
246
238
|
}, jsx("div", {
|
|
@@ -249,8 +241,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
249
241
|
css: nextPreviousItemStyles
|
|
250
242
|
}, jsx(FindReplaceTooltipButton, {
|
|
251
243
|
title: this.findNext,
|
|
252
|
-
icon:
|
|
253
|
-
newIcon: ChevronDownIcon,
|
|
244
|
+
icon: ChevronDownIcon,
|
|
254
245
|
iconLabel: this.findNext,
|
|
255
246
|
keymapDescription: 'Enter',
|
|
256
247
|
onClick: this.handleFindNextClick,
|
|
@@ -259,13 +250,12 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
259
250
|
css: nextPreviousItemStyles
|
|
260
251
|
}, jsx(FindReplaceTooltipButton, {
|
|
261
252
|
title: this.findPrevious,
|
|
262
|
-
icon:
|
|
263
|
-
newIcon: ChevronUpIcon,
|
|
253
|
+
icon: ChevronUpIcon,
|
|
264
254
|
iconLabel: this.findPrevious,
|
|
265
255
|
keymapDescription: 'Shift Enter',
|
|
266
256
|
onClick: this.handleFindPrevClick,
|
|
267
257
|
disabled: count.total <= 1
|
|
268
|
-
})),
|
|
258
|
+
})), jsx(Inline, {
|
|
269
259
|
space: "space.075",
|
|
270
260
|
xcss: xcss({
|
|
271
261
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
@@ -284,27 +274,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
284
274
|
id: "replaceAll-button",
|
|
285
275
|
onClick: this.handleReplaceAllClick,
|
|
286
276
|
isDisabled: !canReplace
|
|
287
|
-
}, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
|
|
288
|
-
css: replaceSectionButtonStyles,
|
|
289
|
-
testId: this.replace,
|
|
290
|
-
id: "replace-button",
|
|
291
|
-
onClick: this.handleReplaceClick,
|
|
292
|
-
isDisabled: !canReplace
|
|
293
|
-
}, this.replace), jsx(LegacyButton, {
|
|
294
|
-
css: replaceSectionButtonStyles,
|
|
295
|
-
appearance: "primary",
|
|
296
|
-
testId: this.replaceAll,
|
|
297
|
-
id: "replaceAll-button",
|
|
298
|
-
onClick: this.handleReplaceAllClick,
|
|
299
|
-
isDisabled: !canReplace
|
|
300
277
|
}, this.replaceAll))), jsx("div", {
|
|
301
|
-
css:
|
|
302
|
-
},
|
|
303
|
-
appearance: "subtle",
|
|
304
|
-
testId: this.closeFindReplaceDialog,
|
|
305
|
-
onClick: this.clearSearch
|
|
306
|
-
}, this.closeFindReplaceDialog) : jsx(LegacyButton, {
|
|
307
|
-
css: replaceSectionButtonStyles,
|
|
278
|
+
css: orderZeroStyles
|
|
279
|
+
}, jsx(Button, {
|
|
308
280
|
appearance: "subtle",
|
|
309
281
|
testId: this.closeFindReplaceDialog,
|
|
310
282
|
onClick: this.clearSearch
|
|
@@ -321,7 +293,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
321
293
|
onKeyDown: this.handleReplaceKeyDown,
|
|
322
294
|
onCompositionStart: this.handleCompositionStart,
|
|
323
295
|
onCompositionEnd: this.handleCompositionEnd
|
|
324
|
-
}),
|
|
296
|
+
}), jsx(Inline, {
|
|
325
297
|
space: "space.050"
|
|
326
298
|
}, jsx(Button, {
|
|
327
299
|
testId: this.replace,
|
|
@@ -331,16 +303,6 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
331
303
|
testId: this.replaceAll,
|
|
332
304
|
onClick: this.handleReplaceAllClick,
|
|
333
305
|
isDisabled: !canReplace
|
|
334
|
-
}, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
|
|
335
|
-
css: replaceSectionButtonStyles,
|
|
336
|
-
testId: this.replace,
|
|
337
|
-
onClick: this.handleReplaceClick,
|
|
338
|
-
isDisabled: !canReplace
|
|
339
|
-
}, this.replace), jsx(LegacyButton, {
|
|
340
|
-
css: replaceSectionButtonStyles,
|
|
341
|
-
testId: this.replaceAll,
|
|
342
|
-
onClick: this.handleReplaceAllClick,
|
|
343
|
-
isDisabled: !canReplace
|
|
344
306
|
}, this.replaceAll)));
|
|
345
307
|
}
|
|
346
308
|
}]);
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -9,13 +9,6 @@ import { fontSize as getFontSize,
|
|
|
9
9
|
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
10
10
|
var fontSize = getFontSize();
|
|
11
11
|
var gridSize = getGridSize();
|
|
12
|
-
export var replaceSectionButtonNewStyles = css({
|
|
13
|
-
marginLeft: "var(--ds-space-050, 4px)",
|
|
14
|
-
marginRight: "var(--ds-space-050, 2px)"
|
|
15
|
-
});
|
|
16
|
-
export var replaceSectionButtonOldStyles = css({
|
|
17
|
-
marginLeft: "var(--ds-space-050, 4px)"
|
|
18
|
-
});
|
|
19
12
|
export var ruleStyles = css({
|
|
20
13
|
width: '100%',
|
|
21
14
|
border: 'none',
|
|
@@ -103,10 +96,6 @@ export var orderZeroStyles = css({
|
|
|
103
96
|
order: '0',
|
|
104
97
|
marginInline: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
105
98
|
});
|
|
106
|
-
export var orderZeroDeprecatedStyles = css({
|
|
107
|
-
order: '0',
|
|
108
|
-
marginInline: 0
|
|
109
|
-
});
|
|
110
99
|
export var orderOneStyles = css({
|
|
111
100
|
order: '1'
|
|
112
101
|
});
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { IconProps } from '@atlaskit/icon/types';
|
|
3
3
|
interface Props {
|
|
4
4
|
title: string;
|
|
5
|
-
icon:
|
|
6
|
-
newIcon: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
5
|
+
icon: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
7
6
|
iconLabel: string;
|
|
8
7
|
iconSize?: 'small' | undefined;
|
|
9
8
|
keymapDescription: string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const replaceSectionButtonNewStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
-
export declare const replaceSectionButtonOldStyles: import("@emotion/react").SerializedStyles;
|
|
3
1
|
export declare const ruleStyles: import("@emotion/react").SerializedStyles;
|
|
4
2
|
export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
|
|
5
3
|
export declare const wrapperPaddingStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -14,5 +12,4 @@ export declare const countStyles: import("@emotion/react").SerializedStyles;
|
|
|
14
12
|
export declare const countStylesAlternateStyles: import("@emotion/react").SerializedStyles;
|
|
15
13
|
export declare const countWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
16
14
|
export declare const orderZeroStyles: import("@emotion/react").SerializedStyles;
|
|
17
|
-
export declare const orderZeroDeprecatedStyles: import("@emotion/react").SerializedStyles;
|
|
18
15
|
export declare const orderOneStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { IconProps } from '@atlaskit/icon/types';
|
|
3
3
|
interface Props {
|
|
4
4
|
title: string;
|
|
5
|
-
icon:
|
|
6
|
-
newIcon: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
5
|
+
icon: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
7
6
|
iconLabel: string;
|
|
8
7
|
iconSize?: 'small' | undefined;
|
|
9
8
|
keymapDescription: string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const replaceSectionButtonNewStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
-
export declare const replaceSectionButtonOldStyles: import("@emotion/react").SerializedStyles;
|
|
3
1
|
export declare const ruleStyles: import("@emotion/react").SerializedStyles;
|
|
4
2
|
export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
|
|
5
3
|
export declare const wrapperPaddingStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -14,5 +12,4 @@ export declare const countStyles: import("@emotion/react").SerializedStyles;
|
|
|
14
12
|
export declare const countStylesAlternateStyles: import("@emotion/react").SerializedStyles;
|
|
15
13
|
export declare const countWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
16
14
|
export declare const orderZeroStyles: import("@emotion/react").SerializedStyles;
|
|
17
|
-
export declare const orderZeroDeprecatedStyles: import("@emotion/react").SerializedStyles;
|
|
18
15
|
export declare const orderOneStyles: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"./styles": "./src/styles.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@atlaskit/button": "^17.
|
|
38
|
-
"@atlaskit/editor-common": "^
|
|
37
|
+
"@atlaskit/button": "^17.17.0",
|
|
38
|
+
"@atlaskit/editor-common": "^82.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
41
|
-
"@atlaskit/editor-shared-styles": "^2.
|
|
42
|
-
"@atlaskit/form": "^10.
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
42
|
+
"@atlaskit/form": "^10.3.0",
|
|
43
43
|
"@atlaskit/icon": "^22.3.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
45
|
-
"@atlaskit/primitives": "^6.
|
|
45
|
+
"@atlaskit/primitives": "^6.5.0",
|
|
46
46
|
"@atlaskit/textfield": "^6.3.0",
|
|
47
47
|
"@atlaskit/theme": "^12.8.0",
|
|
48
48
|
"@atlaskit/tokens": "^1.49.0",
|
|
@@ -54,9 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@af/visual-regression": "*",
|
|
57
|
-
"@atlaskit/editor-plugin-block-type": "^3.
|
|
57
|
+
"@atlaskit/editor-plugin-block-type": "^3.5.0",
|
|
58
58
|
"@atlaskit/editor-plugin-text-formatting": "^1.7.0",
|
|
59
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
60
59
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
61
60
|
"@testing-library/react": "^12.1.5",
|
|
62
61
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -101,13 +100,9 @@
|
|
|
101
100
|
]
|
|
102
101
|
}
|
|
103
102
|
},
|
|
104
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
105
103
|
"platform-feature-flags": {
|
|
106
104
|
"platform.editor.a11y-find-replace": {
|
|
107
105
|
"type": "boolean"
|
|
108
|
-
},
|
|
109
|
-
"platform.design-system-team.editor-new-button_jjjdo": {
|
|
110
|
-
"type": "boolean"
|
|
111
106
|
}
|
|
112
107
|
},
|
|
113
108
|
"stricter": {
|