@atlaskit/editor-plugin-find-replace 1.0.1 → 1.1.0

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,42 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#72122](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72122) [`c3186450404a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c3186450404a) - Breaking change:
8
+
9
+ ## WHAT?:
10
+
11
+ Removing feature flags:
12
+
13
+ - singleLayout
14
+ - newInsertionBehaviour
15
+ - interactiveExpand
16
+ - findReplace
17
+ - findReplaceMatchCase
18
+ - extendFloatingToolbar
19
+
20
+ ## WHY?:
21
+
22
+ Because the flags and props are unused/by default active. Removing them will reduce our maintenance burden
23
+
24
+ ## HOW to update your code:
25
+
26
+ - If you were using the feature flag - the behaviour is now default and you can remove the flags
27
+ - If you were not using the feature flag - the behaviour is now default.
28
+ - If you have opted out of using the feature flag - we have been careful to ensure no-one has opted out of the behaviours. If you do have an issue please reach out to #help-editor.
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies
33
+
34
+ ## 1.0.2
35
+
36
+ ### Patch Changes
37
+
38
+ - [#72125](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72125) [`9b19a14df053`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9b19a14df053) - Migrated buttons in find and replace popup to new atlaskit buttons with a feature flag `platform.design-system-team.editor-new-button_jjjdo`.
39
+
3
40
  ## 1.0.1
4
41
 
5
42
  ### Patch Changes
@@ -48,7 +48,6 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
48
48
  editorView = _ref2.editorView,
49
49
  containerElement = _ref2.containerElement,
50
50
  dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
51
- featureFlags = _ref2.featureFlags,
52
51
  takeFullWidth = _ref2.takeFullWidth,
53
52
  api = _ref2.api;
54
53
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
@@ -135,12 +134,10 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
135
134
  var handleToggleMatchCase = function handleToggleMatchCase() {
136
135
  dispatchCommand((0, _commands.toggleMatchCase)());
137
136
  };
138
- var findReplaceMatchCase = featureFlags.findReplaceMatchCase;
139
137
  if (!findReplaceState) {
140
138
  return null;
141
139
  }
142
140
  return /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButton.default, {
143
- allowMatchCase: findReplaceMatchCase,
144
141
  shouldMatchCase: findReplaceState.shouldMatchCase,
145
142
  onToggleMatchCase: handleToggleMatchCase,
146
143
  isActive: findReplaceState.isActive,
@@ -11,10 +11,8 @@ var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
11
11
  var _main = require("./pm-plugins/main");
12
12
  var _pluginKey = require("./pm-plugins/plugin-key");
13
13
  var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_ref) {
14
- var _api$featureFlags;
15
14
  var props = _ref.config,
16
15
  api = _ref.api;
17
- var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
18
16
  return {
19
17
  name: 'findReplace',
20
18
  pmPlugins: function pmPlugins() {
@@ -53,12 +51,7 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
53
51
  popupsScrollableElement: popupsScrollableElement,
54
52
  editorView: editorView,
55
53
  containerElement: containerElement,
56
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
57
- // `allowMatchCase` comes through the preset, but not the feature flags
58
- // prop with the `ComposableEditor` - grab the FFs from the editor API
59
- // instead until we clean this up.
60
- ,
61
- featureFlags: featureFlags,
54
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
62
55
  isToolbarReducedSpacing: isToolbarReducedSpacing,
63
56
  api: api
64
57
  });
@@ -84,7 +77,6 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
84
77
  containerElement: containerElement,
85
78
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
86
79
  takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
87
- featureFlags: featureFlags,
88
80
  api: api
89
81
  });
90
82
  }
@@ -135,7 +135,7 @@ var Find = /*#__PURE__*/function (_React$Component) {
135
135
  });
136
136
  });
137
137
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMatchCaseClick", function (buttonRef) {
138
- if (_this.props.allowMatchCase && _this.props.onToggleMatchCase) {
138
+ if (_this.props.onToggleMatchCase) {
139
139
  _this.props.onToggleMatchCase();
140
140
  _this.props.onFind(_this.props.findText);
141
141
  }
@@ -216,7 +216,6 @@ var Find = /*#__PURE__*/function (_React$Component) {
216
216
  var _this$props = this.props,
217
217
  findText = _this$props.findText,
218
218
  count = _this$props.count,
219
- allowMatchCase = _this$props.allowMatchCase,
220
219
  shouldMatchCase = _this$props.shouldMatchCase,
221
220
  formatMessage = _this$props.intl.formatMessage;
222
221
  var resultsCount = formatMessage(_messages.findReplaceMessages.resultsCount, {
@@ -231,12 +230,15 @@ var Find = /*#__PURE__*/function (_React$Component) {
231
230
  }, findText && (0, _react2.jsx)("span", {
232
231
  "data-testid": "textfield-count",
233
232
  css: [_styles.countStyles, _styles.countStylesAlternateStyles]
234
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && (0, _react2.jsx)("div", {
233
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), (0, _react2.jsx)("div", {
235
234
  css: _styles.matchCaseSection
236
235
  }, (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
237
236
  title: this.matchCase,
238
237
  appearance: "default",
239
238
  icon: this.matchCaseIcon,
239
+ newIcon: _keyboard.default,
240
+ iconLabel: this.matchCase,
241
+ iconSize: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? 'small' : undefined,
240
242
  onClick: this.handleMatchCaseClick,
241
243
  isPressed: shouldMatchCase
242
244
  })));
@@ -283,26 +285,35 @@ var Find = /*#__PURE__*/function (_React$Component) {
283
285
  }, findText && (0, _react2.jsx)("span", {
284
286
  "data-testid": "textfield-count",
285
287
  css: _styles.countStyles
286
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
288
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
287
289
  title: this.matchCase,
288
290
  icon: this.matchCaseIcon,
291
+ newIcon: _keyboard.default,
292
+ iconLabel: this.matchCase,
293
+ iconSize: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? 'small' : undefined,
289
294
  onClick: this.handleMatchCaseClick,
290
295
  isPressed: shouldMatchCase
291
296
  }), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
292
297
  title: this.findNext,
293
298
  icon: this.findNextIcon,
299
+ newIcon: _chevronDown.default,
300
+ iconLabel: this.findNext,
294
301
  keymapDescription: 'Enter',
295
302
  onClick: this.handleFindNextClick,
296
303
  disabled: count.total <= 1
297
304
  }), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
298
305
  title: this.findPrevious,
299
306
  icon: this.findPrevIcon,
307
+ newIcon: _chevronUp.default,
308
+ iconLabel: this.findPrevious,
300
309
  keymapDescription: 'Shift Enter',
301
310
  onClick: this.handleFindPrevClick,
302
311
  disabled: count.total <= 1
303
312
  }), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
304
313
  title: this.closeFindReplaceDialog,
305
314
  icon: this.closeIcon,
315
+ newIcon: _close.default,
316
+ iconLabel: this.closeFindReplaceDialog,
306
317
  keymapDescription: 'Escape',
307
318
  onClick: this.clearSearch
308
319
  }));
@@ -14,8 +14,10 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _react = _interopRequireDefault(require("react"));
17
+ var _new = require("@atlaskit/button/new");
17
18
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
18
19
  var _keymaps = require("@atlaskit/editor-common/keymaps");
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
21
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
20
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -44,6 +46,8 @@ var FindReplaceTooltipButton = exports.FindReplaceTooltipButton = /*#__PURE__*/f
44
46
  var _this$props = this.props,
45
47
  title = _this$props.title,
46
48
  icon = _this$props.icon,
49
+ newIcon = _this$props.newIcon,
50
+ iconSize = _this$props.iconSize,
47
51
  keymapDescription = _this$props.keymapDescription,
48
52
  disabled = _this$props.disabled,
49
53
  isPressed = _this$props.isPressed,
@@ -58,7 +62,18 @@ var FindReplaceTooltipButton = exports.FindReplaceTooltipButton = /*#__PURE__*/f
58
62
  }),
59
63
  hideTooltipOnClick: true,
60
64
  position: 'top'
61
- }, /*#__PURE__*/_react.default.createElement(_standardButton.default, (0, _extends2.default)({
65
+ }, (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.editor-new-button_jjjdo') ? /*#__PURE__*/_react.default.createElement(_new.IconButton, (0, _extends2.default)({
66
+ id: "afterInputSection",
67
+ label: title,
68
+ appearance: appearance,
69
+ testId: title,
70
+ ref: this.buttonRef,
71
+ icon: newIcon,
72
+ UNSAFE_size: iconSize,
73
+ isDisabled: disabled,
74
+ onClick: this.handleClick,
75
+ isSelected: isPressed
76
+ }, pressedProps)) : /*#__PURE__*/_react.default.createElement(_standardButton.default, (0, _extends2.default)({
62
77
  id: "afterInputSection",
63
78
  label: title,
64
79
  appearance: appearance,
@@ -16,6 +16,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _react2 = require("@emotion/react");
18
18
  var _reactIntlNext = require("react-intl-next");
19
+ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
19
20
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
20
21
  var _analytics = require("@atlaskit/editor-common/analytics");
21
22
  var _messages = require("@atlaskit/editor-common/messages");
@@ -23,6 +24,7 @@ var _form = require("@atlaskit/form");
23
24
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-down"));
24
25
  var _chevronUp = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-up"));
25
26
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
+ var _primitives = require("@atlaskit/primitives");
26
28
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
27
29
  var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
28
30
  var _styles = require("./styles");
@@ -255,6 +257,8 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
255
257
  }, (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
256
258
  title: this.findNext,
257
259
  icon: this.findNextIcon,
260
+ newIcon: _chevronDown.default,
261
+ iconLabel: this.findNext,
258
262
  keymapDescription: 'Enter',
259
263
  onClick: this.handleFindNextClick,
260
264
  disabled: count.total <= 1
@@ -263,10 +267,29 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
263
267
  }, (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
264
268
  title: this.findPrevious,
265
269
  icon: this.findPrevIcon,
270
+ newIcon: _chevronUp.default,
271
+ iconLabel: this.findPrevious,
266
272
  keymapDescription: 'Shift Enter',
267
273
  onClick: this.handleFindPrevClick,
268
274
  disabled: count.total <= 1
269
- })), (0, _react2.jsx)(_standardButton.default, {
275
+ })), (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.editor-new-button_jjjdo') ? (0, _react2.jsx)(_primitives.Inline, {
276
+ space: "space.075",
277
+ xcss: (0, _primitives.xcss)({
278
+ paddingInlineStart: 'space.050',
279
+ paddingInlineEnd: 'space.025'
280
+ })
281
+ }, (0, _react2.jsx)(_new.default, {
282
+ testId: this.replace,
283
+ id: "replace-button",
284
+ onClick: this.handleReplaceClick,
285
+ isDisabled: !canReplace
286
+ }, this.replace), (0, _react2.jsx)(_new.default, {
287
+ appearance: "primary",
288
+ testId: this.replaceAll,
289
+ id: "replaceAll-button",
290
+ onClick: this.handleReplaceAllClick,
291
+ isDisabled: !canReplace
292
+ }, this.replaceAll)) : (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_standardButton.default, {
270
293
  css: _styles.replaceSectionButtonStyles,
271
294
  testId: this.replace,
272
295
  id: "replace-button",
@@ -279,9 +302,13 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
279
302
  id: "replaceAll-button",
280
303
  onClick: this.handleReplaceAllClick,
281
304
  isDisabled: !canReplace
282
- }, this.replaceAll)), (0, _react2.jsx)("div", {
305
+ }, this.replaceAll))), (0, _react2.jsx)("div", {
283
306
  css: _styles.orderZeroStyles
284
- }, (0, _react2.jsx)(_standardButton.default, {
307
+ }, (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.editor-new-button_jjjdo') ? (0, _react2.jsx)(_new.default, {
308
+ appearance: "subtle",
309
+ testId: this.closeFindReplaceDialog,
310
+ onClick: this.clearSearch
311
+ }, this.closeFindReplaceDialog) : (0, _react2.jsx)(_standardButton.default, {
285
312
  css: _styles.replaceSectionButtonStyles,
286
313
  appearance: "subtle",
287
314
  testId: this.closeFindReplaceDialog,
@@ -299,7 +326,17 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
299
326
  onKeyDown: this.handleReplaceKeyDown,
300
327
  onCompositionStart: this.handleCompositionStart,
301
328
  onCompositionEnd: this.handleCompositionEnd
302
- }), (0, _react2.jsx)(_standardButton.default, {
329
+ }), (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.editor-new-button_jjjdo') ? (0, _react2.jsx)(_primitives.Inline, {
330
+ space: "space.050"
331
+ }, (0, _react2.jsx)(_new.default, {
332
+ testId: this.replace,
333
+ onClick: this.handleReplaceClick,
334
+ isDisabled: !canReplace
335
+ }, this.replace), (0, _react2.jsx)(_new.default, {
336
+ testId: this.replaceAll,
337
+ onClick: this.handleReplaceAllClick,
338
+ isDisabled: !canReplace
339
+ }, this.replaceAll)) : (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_standardButton.default, {
303
340
  css: _styles.replaceSectionButtonStyles,
304
341
  testId: this.replace,
305
342
  onClick: this.handleReplaceClick,
@@ -309,7 +346,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
309
346
  testId: this.replaceAll,
310
347
  onClick: this.handleReplaceAllClick,
311
348
  isDisabled: !canReplace
312
- }, this.replaceAll));
349
+ }, this.replaceAll)));
313
350
  }
314
351
  }]);
315
352
  return Replace;
@@ -65,7 +65,8 @@ var countWrapperStyles = exports.countWrapperStyles = (0, _react.css)({
65
65
  alignItems: 'center'
66
66
  });
67
67
  var orderZeroStyles = exports.orderZeroStyles = (0, _react.css)({
68
- order: '0'
68
+ order: '0',
69
+ marginInline: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.editor-new-button_jjjdo') ? "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)") : 0
69
70
  });
70
71
  var orderOneStyles = exports.orderOneStyles = (0, _react.css)({
71
72
  order: '1'
@@ -35,7 +35,6 @@ const FindReplaceToolbarButtonWithState = ({
35
35
  editorView,
36
36
  containerElement,
37
37
  dispatchAnalyticsEvent,
38
- featureFlags,
39
38
  takeFullWidth,
40
39
  api
41
40
  }) => {
@@ -120,14 +119,10 @@ const FindReplaceToolbarButtonWithState = ({
120
119
  const handleToggleMatchCase = () => {
121
120
  dispatchCommand(toggleMatchCase());
122
121
  };
123
- const {
124
- findReplaceMatchCase
125
- } = featureFlags;
126
122
  if (!findReplaceState) {
127
123
  return null;
128
124
  }
129
125
  return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
130
- allowMatchCase: findReplaceMatchCase,
131
126
  shouldMatchCase: findReplaceState.shouldMatchCase,
132
127
  onToggleMatchCase: handleToggleMatchCase,
133
128
  isActive: findReplaceState.isActive,
@@ -7,8 +7,6 @@ export const findReplacePlugin = ({
7
7
  config: props,
8
8
  api
9
9
  }) => {
10
- var _api$featureFlags;
11
- const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
12
10
  return {
13
11
  name: 'findReplace',
14
12
  pmPlugins() {
@@ -47,12 +45,7 @@ export const findReplacePlugin = ({
47
45
  popupsScrollableElement: popupsScrollableElement,
48
46
  editorView: editorView,
49
47
  containerElement: containerElement,
50
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
51
- // `allowMatchCase` comes through the preset, but not the feature flags
52
- // prop with the `ComposableEditor` - grab the FFs from the editor API
53
- // instead until we clean this up.
54
- ,
55
- featureFlags: featureFlags,
48
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
56
49
  isToolbarReducedSpacing: isToolbarReducedSpacing,
57
50
  api: api
58
51
  });
@@ -79,7 +72,6 @@ export const findReplacePlugin = ({
79
72
  containerElement: containerElement,
80
73
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
81
74
  takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
82
- featureFlags: featureFlags,
83
75
  api: api
84
76
  });
85
77
  }
@@ -118,7 +118,7 @@ class Find extends React.Component {
118
118
  });
119
119
  });
120
120
  _defineProperty(this, "handleMatchCaseClick", buttonRef => {
121
- if (this.props.allowMatchCase && this.props.onToggleMatchCase) {
121
+ if (this.props.onToggleMatchCase) {
122
122
  this.props.onToggleMatchCase();
123
123
  this.props.onFind(this.props.findText);
124
124
  }
@@ -192,7 +192,6 @@ class Find extends React.Component {
192
192
  const {
193
193
  findText,
194
194
  count,
195
- allowMatchCase,
196
195
  shouldMatchCase,
197
196
  intl: {
198
197
  formatMessage
@@ -210,12 +209,15 @@ class Find extends React.Component {
210
209
  }, findText && jsx("span", {
211
210
  "data-testid": "textfield-count",
212
211
  css: [countStyles, countStylesAlternateStyles]
213
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && jsx("div", {
212
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), jsx("div", {
214
213
  css: matchCaseSection
215
214
  }, jsx(FindReplaceTooltipButton, {
216
215
  title: this.matchCase,
217
216
  appearance: "default",
218
217
  icon: this.matchCaseIcon,
218
+ newIcon: MatchCaseIcon,
219
+ iconLabel: this.matchCase,
220
+ iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
219
221
  onClick: this.handleMatchCaseClick,
220
222
  isPressed: shouldMatchCase
221
223
  })));
@@ -262,26 +264,35 @@ class Find extends React.Component {
262
264
  }, findText && jsx("span", {
263
265
  "data-testid": "textfield-count",
264
266
  css: countStyles
265
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && jsx(FindReplaceTooltipButton, {
267
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), jsx(FindReplaceTooltipButton, {
266
268
  title: this.matchCase,
267
269
  icon: this.matchCaseIcon,
270
+ newIcon: MatchCaseIcon,
271
+ iconLabel: this.matchCase,
272
+ iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
268
273
  onClick: this.handleMatchCaseClick,
269
274
  isPressed: shouldMatchCase
270
275
  }), jsx(FindReplaceTooltipButton, {
271
276
  title: this.findNext,
272
277
  icon: this.findNextIcon,
278
+ newIcon: ChevronDownIcon,
279
+ iconLabel: this.findNext,
273
280
  keymapDescription: 'Enter',
274
281
  onClick: this.handleFindNextClick,
275
282
  disabled: count.total <= 1
276
283
  }), jsx(FindReplaceTooltipButton, {
277
284
  title: this.findPrevious,
278
285
  icon: this.findPrevIcon,
286
+ newIcon: ChevronUpIcon,
287
+ iconLabel: this.findPrevious,
279
288
  keymapDescription: 'Shift Enter',
280
289
  onClick: this.handleFindPrevClick,
281
290
  disabled: count.total <= 1
282
291
  }), jsx(FindReplaceTooltipButton, {
283
292
  title: this.closeFindReplaceDialog,
284
293
  icon: this.closeIcon,
294
+ newIcon: EditorCloseIcon,
295
+ iconLabel: this.closeFindReplaceDialog,
285
296
  keymapDescription: 'Escape',
286
297
  onClick: this.clearSearch
287
298
  }));
@@ -1,8 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React from 'react';
4
- import Button from '@atlaskit/button/standard-button';
4
+ import { IconButton } from '@atlaskit/button/new';
5
+ import LegacyButton from '@atlaskit/button/standard-button';
5
6
  import { findKeymapByDescription, ToolTipContent } from '@atlaskit/editor-common/keymaps';
7
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
8
  import Tooltip from '@atlaskit/tooltip';
7
9
  // eslint-disable-next-line @repo/internal/react/no-class-components
8
10
  export class FindReplaceTooltipButton extends React.PureComponent {
@@ -17,6 +19,8 @@ export class FindReplaceTooltipButton extends React.PureComponent {
17
19
  const {
18
20
  title,
19
21
  icon,
22
+ newIcon,
23
+ iconSize,
20
24
  keymapDescription,
21
25
  disabled,
22
26
  isPressed,
@@ -34,7 +38,18 @@ export class FindReplaceTooltipButton extends React.PureComponent {
34
38
  }),
35
39
  hideTooltipOnClick: true,
36
40
  position: 'top'
37
- }, /*#__PURE__*/React.createElement(Button, _extends({
41
+ }, getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? /*#__PURE__*/React.createElement(IconButton, _extends({
42
+ id: "afterInputSection",
43
+ label: title,
44
+ appearance: appearance,
45
+ testId: title,
46
+ ref: this.buttonRef,
47
+ icon: newIcon,
48
+ UNSAFE_size: iconSize,
49
+ isDisabled: disabled,
50
+ onClick: this.handleClick,
51
+ isSelected: isPressed
52
+ }, pressedProps)) : /*#__PURE__*/React.createElement(LegacyButton, _extends({
38
53
  id: "afterInputSection",
39
54
  label: title,
40
55
  appearance: appearance,
@@ -4,13 +4,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import React, { Fragment } from 'react';
5
5
  import { jsx } from '@emotion/react';
6
6
  import { injectIntl } from 'react-intl-next';
7
- import Button from '@atlaskit/button/standard-button';
7
+ import Button from '@atlaskit/button/new';
8
+ import LegacyButton from '@atlaskit/button/standard-button';
8
9
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
9
10
  import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
10
11
  import { Label, ValidMessage } from '@atlaskit/form';
11
12
  import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
12
13
  import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
13
14
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
+ import { Inline, xcss } from '@atlaskit/primitives';
14
16
  import Textfield from '@atlaskit/textfield';
15
17
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
16
18
  import { NextPreviousItem, orderOneStyles, orderZeroStyles, replaceSectionButtonStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
@@ -231,6 +233,8 @@ class Replace extends React.PureComponent {
231
233
  }, jsx(FindReplaceTooltipButton, {
232
234
  title: this.findNext,
233
235
  icon: this.findNextIcon,
236
+ newIcon: ChevronDownIcon,
237
+ iconLabel: this.findNext,
234
238
  keymapDescription: 'Enter',
235
239
  onClick: this.handleFindNextClick,
236
240
  disabled: count.total <= 1
@@ -239,25 +243,48 @@ class Replace extends React.PureComponent {
239
243
  }, jsx(FindReplaceTooltipButton, {
240
244
  title: this.findPrevious,
241
245
  icon: this.findPrevIcon,
246
+ newIcon: ChevronUpIcon,
247
+ iconLabel: this.findPrevious,
242
248
  keymapDescription: 'Shift Enter',
243
249
  onClick: this.handleFindPrevClick,
244
250
  disabled: count.total <= 1
245
- })), jsx(Button, {
246
- css: replaceSectionButtonStyles,
251
+ })), getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? jsx(Inline, {
252
+ space: "space.075",
253
+ xcss: xcss({
254
+ paddingInlineStart: 'space.050',
255
+ paddingInlineEnd: 'space.025'
256
+ })
257
+ }, jsx(Button, {
247
258
  testId: this.replace,
248
259
  id: "replace-button",
249
260
  onClick: this.handleReplaceClick,
250
261
  isDisabled: !canReplace
251
262
  }, this.replace), jsx(Button, {
263
+ appearance: "primary",
264
+ testId: this.replaceAll,
265
+ id: "replaceAll-button",
266
+ onClick: this.handleReplaceAllClick,
267
+ isDisabled: !canReplace
268
+ }, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
269
+ css: replaceSectionButtonStyles,
270
+ testId: this.replace,
271
+ id: "replace-button",
272
+ onClick: this.handleReplaceClick,
273
+ isDisabled: !canReplace
274
+ }, this.replace), jsx(LegacyButton, {
252
275
  css: replaceSectionButtonStyles,
253
276
  appearance: "primary",
254
277
  testId: this.replaceAll,
255
278
  id: "replaceAll-button",
256
279
  onClick: this.handleReplaceAllClick,
257
280
  isDisabled: !canReplace
258
- }, this.replaceAll)), jsx("div", {
281
+ }, this.replaceAll))), jsx("div", {
259
282
  css: orderZeroStyles
260
- }, jsx(Button, {
283
+ }, getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? jsx(Button, {
284
+ appearance: "subtle",
285
+ testId: this.closeFindReplaceDialog,
286
+ onClick: this.clearSearch
287
+ }, this.closeFindReplaceDialog) : jsx(LegacyButton, {
261
288
  css: replaceSectionButtonStyles,
262
289
  appearance: "subtle",
263
290
  testId: this.closeFindReplaceDialog,
@@ -275,17 +302,27 @@ class Replace extends React.PureComponent {
275
302
  onKeyDown: this.handleReplaceKeyDown,
276
303
  onCompositionStart: this.handleCompositionStart,
277
304
  onCompositionEnd: this.handleCompositionEnd
278
- }), jsx(Button, {
279
- css: replaceSectionButtonStyles,
305
+ }), getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? jsx(Inline, {
306
+ space: "space.050"
307
+ }, jsx(Button, {
280
308
  testId: this.replace,
281
309
  onClick: this.handleReplaceClick,
282
310
  isDisabled: !canReplace
283
311
  }, this.replace), jsx(Button, {
312
+ testId: this.replaceAll,
313
+ onClick: this.handleReplaceAllClick,
314
+ isDisabled: !canReplace
315
+ }, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
316
+ css: replaceSectionButtonStyles,
317
+ testId: this.replace,
318
+ onClick: this.handleReplaceClick,
319
+ isDisabled: !canReplace
320
+ }, this.replace), jsx(LegacyButton, {
284
321
  css: replaceSectionButtonStyles,
285
322
  testId: this.replaceAll,
286
323
  onClick: this.handleReplaceAllClick,
287
324
  isDisabled: !canReplace
288
- }, this.replaceAll));
325
+ }, this.replaceAll)));
289
326
  }
290
327
  }
291
328
  export default injectIntl(Replace);
@@ -107,7 +107,8 @@ export const countWrapperStyles = css({
107
107
  alignItems: 'center'
108
108
  });
109
109
  export const orderZeroStyles = css({
110
- order: '0'
110
+ order: '0',
111
+ marginInline: getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}` : 0
111
112
  });
112
113
  export const orderOneStyles = css({
113
114
  order: '1'
@@ -39,7 +39,6 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
39
39
  editorView = _ref2.editorView,
40
40
  containerElement = _ref2.containerElement,
41
41
  dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
42
- featureFlags = _ref2.featureFlags,
43
42
  takeFullWidth = _ref2.takeFullWidth,
44
43
  api = _ref2.api;
45
44
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
@@ -126,12 +125,10 @@ var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithSta
126
125
  var handleToggleMatchCase = function handleToggleMatchCase() {
127
126
  dispatchCommand(toggleMatchCase());
128
127
  };
129
- var findReplaceMatchCase = featureFlags.findReplaceMatchCase;
130
128
  if (!findReplaceState) {
131
129
  return null;
132
130
  }
133
131
  return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
134
- allowMatchCase: findReplaceMatchCase,
135
132
  shouldMatchCase: findReplaceState.shouldMatchCase,
136
133
  onToggleMatchCase: handleToggleMatchCase,
137
134
  isActive: findReplaceState.isActive,
@@ -4,10 +4,8 @@ import keymapPlugin from './pm-plugins/keymap';
4
4
  import { createPlugin } from './pm-plugins/main';
5
5
  import { findReplacePluginKey } from './pm-plugins/plugin-key';
6
6
  export var findReplacePlugin = function findReplacePlugin(_ref) {
7
- var _api$featureFlags;
8
7
  var props = _ref.config,
9
8
  api = _ref.api;
10
- var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
11
9
  return {
12
10
  name: 'findReplace',
13
11
  pmPlugins: function pmPlugins() {
@@ -46,12 +44,7 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
46
44
  popupsScrollableElement: popupsScrollableElement,
47
45
  editorView: editorView,
48
46
  containerElement: containerElement,
49
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
50
- // `allowMatchCase` comes through the preset, but not the feature flags
51
- // prop with the `ComposableEditor` - grab the FFs from the editor API
52
- // instead until we clean this up.
53
- ,
54
- featureFlags: featureFlags,
47
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
55
48
  isToolbarReducedSpacing: isToolbarReducedSpacing,
56
49
  api: api
57
50
  });
@@ -77,7 +70,6 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
77
70
  containerElement: containerElement,
78
71
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
79
72
  takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
80
- featureFlags: featureFlags,
81
73
  api: api
82
74
  });
83
75
  }
@@ -130,7 +130,7 @@ var Find = /*#__PURE__*/function (_React$Component) {
130
130
  });
131
131
  });
132
132
  _defineProperty(_assertThisInitialized(_this), "handleMatchCaseClick", function (buttonRef) {
133
- if (_this.props.allowMatchCase && _this.props.onToggleMatchCase) {
133
+ if (_this.props.onToggleMatchCase) {
134
134
  _this.props.onToggleMatchCase();
135
135
  _this.props.onFind(_this.props.findText);
136
136
  }
@@ -211,7 +211,6 @@ var Find = /*#__PURE__*/function (_React$Component) {
211
211
  var _this$props = this.props,
212
212
  findText = _this$props.findText,
213
213
  count = _this$props.count,
214
- allowMatchCase = _this$props.allowMatchCase,
215
214
  shouldMatchCase = _this$props.shouldMatchCase,
216
215
  formatMessage = _this$props.intl.formatMessage;
217
216
  var resultsCount = formatMessage(messages.resultsCount, {
@@ -226,12 +225,15 @@ var Find = /*#__PURE__*/function (_React$Component) {
226
225
  }, findText && jsx("span", {
227
226
  "data-testid": "textfield-count",
228
227
  css: [countStyles, countStylesAlternateStyles]
229
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && jsx("div", {
228
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), jsx("div", {
230
229
  css: matchCaseSection
231
230
  }, jsx(FindReplaceTooltipButton, {
232
231
  title: this.matchCase,
233
232
  appearance: "default",
234
233
  icon: this.matchCaseIcon,
234
+ newIcon: MatchCaseIcon,
235
+ iconLabel: this.matchCase,
236
+ iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
235
237
  onClick: this.handleMatchCaseClick,
236
238
  isPressed: shouldMatchCase
237
239
  })));
@@ -278,26 +280,35 @@ var Find = /*#__PURE__*/function (_React$Component) {
278
280
  }, findText && jsx("span", {
279
281
  "data-testid": "textfield-count",
280
282
  css: countStyles
281
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && jsx(FindReplaceTooltipButton, {
283
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), jsx(FindReplaceTooltipButton, {
282
284
  title: this.matchCase,
283
285
  icon: this.matchCaseIcon,
286
+ newIcon: MatchCaseIcon,
287
+ iconLabel: this.matchCase,
288
+ iconSize: getBooleanFF('platform.editor.a11y-find-replace') ? 'small' : undefined,
284
289
  onClick: this.handleMatchCaseClick,
285
290
  isPressed: shouldMatchCase
286
291
  }), jsx(FindReplaceTooltipButton, {
287
292
  title: this.findNext,
288
293
  icon: this.findNextIcon,
294
+ newIcon: ChevronDownIcon,
295
+ iconLabel: this.findNext,
289
296
  keymapDescription: 'Enter',
290
297
  onClick: this.handleFindNextClick,
291
298
  disabled: count.total <= 1
292
299
  }), jsx(FindReplaceTooltipButton, {
293
300
  title: this.findPrevious,
294
301
  icon: this.findPrevIcon,
302
+ newIcon: ChevronUpIcon,
303
+ iconLabel: this.findPrevious,
295
304
  keymapDescription: 'Shift Enter',
296
305
  onClick: this.handleFindPrevClick,
297
306
  disabled: count.total <= 1
298
307
  }), jsx(FindReplaceTooltipButton, {
299
308
  title: this.closeFindReplaceDialog,
300
309
  icon: this.closeIcon,
310
+ newIcon: EditorCloseIcon,
311
+ iconLabel: this.closeFindReplaceDialog,
301
312
  keymapDescription: 'Escape',
302
313
  onClick: this.clearSearch
303
314
  }));
@@ -11,8 +11,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
12
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
  import React from 'react';
14
- import Button from '@atlaskit/button/standard-button';
14
+ import { IconButton } from '@atlaskit/button/new';
15
+ import LegacyButton from '@atlaskit/button/standard-button';
15
16
  import { findKeymapByDescription, ToolTipContent } from '@atlaskit/editor-common/keymaps';
17
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
18
  import Tooltip from '@atlaskit/tooltip';
17
19
  // eslint-disable-next-line @repo/internal/react/no-class-components
18
20
  export var FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponent) {
@@ -37,6 +39,8 @@ export var FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponen
37
39
  var _this$props = this.props,
38
40
  title = _this$props.title,
39
41
  icon = _this$props.icon,
42
+ newIcon = _this$props.newIcon,
43
+ iconSize = _this$props.iconSize,
40
44
  keymapDescription = _this$props.keymapDescription,
41
45
  disabled = _this$props.disabled,
42
46
  isPressed = _this$props.isPressed,
@@ -51,7 +55,18 @@ export var FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponen
51
55
  }),
52
56
  hideTooltipOnClick: true,
53
57
  position: 'top'
54
- }, /*#__PURE__*/React.createElement(Button, _extends({
58
+ }, getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? /*#__PURE__*/React.createElement(IconButton, _extends({
59
+ id: "afterInputSection",
60
+ label: title,
61
+ appearance: appearance,
62
+ testId: title,
63
+ ref: this.buttonRef,
64
+ icon: newIcon,
65
+ UNSAFE_size: iconSize,
66
+ isDisabled: disabled,
67
+ onClick: this.handleClick,
68
+ isSelected: isPressed
69
+ }, pressedProps)) : /*#__PURE__*/React.createElement(LegacyButton, _extends({
55
70
  id: "afterInputSection",
56
71
  label: title,
57
72
  appearance: appearance,
@@ -12,13 +12,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
12
12
  import React, { Fragment } from 'react';
13
13
  import { jsx } from '@emotion/react';
14
14
  import { injectIntl } from 'react-intl-next';
15
- import Button from '@atlaskit/button/standard-button';
15
+ import Button from '@atlaskit/button/new';
16
+ import LegacyButton from '@atlaskit/button/standard-button';
16
17
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
17
18
  import { findReplaceMessages as messages } from '@atlaskit/editor-common/messages';
18
19
  import { Label, ValidMessage } from '@atlaskit/form';
19
20
  import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
20
21
  import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
21
22
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
23
+ import { Inline, xcss } from '@atlaskit/primitives';
22
24
  import Textfield from '@atlaskit/textfield';
23
25
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
24
26
  import { NextPreviousItem, orderOneStyles, orderZeroStyles, replaceSectionButtonStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
@@ -247,6 +249,8 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
247
249
  }, jsx(FindReplaceTooltipButton, {
248
250
  title: this.findNext,
249
251
  icon: this.findNextIcon,
252
+ newIcon: ChevronDownIcon,
253
+ iconLabel: this.findNext,
250
254
  keymapDescription: 'Enter',
251
255
  onClick: this.handleFindNextClick,
252
256
  disabled: count.total <= 1
@@ -255,25 +259,48 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
255
259
  }, jsx(FindReplaceTooltipButton, {
256
260
  title: this.findPrevious,
257
261
  icon: this.findPrevIcon,
262
+ newIcon: ChevronUpIcon,
263
+ iconLabel: this.findPrevious,
258
264
  keymapDescription: 'Shift Enter',
259
265
  onClick: this.handleFindPrevClick,
260
266
  disabled: count.total <= 1
261
- })), jsx(Button, {
262
- css: replaceSectionButtonStyles,
267
+ })), getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? jsx(Inline, {
268
+ space: "space.075",
269
+ xcss: xcss({
270
+ paddingInlineStart: 'space.050',
271
+ paddingInlineEnd: 'space.025'
272
+ })
273
+ }, jsx(Button, {
263
274
  testId: this.replace,
264
275
  id: "replace-button",
265
276
  onClick: this.handleReplaceClick,
266
277
  isDisabled: !canReplace
267
278
  }, this.replace), jsx(Button, {
279
+ appearance: "primary",
280
+ testId: this.replaceAll,
281
+ id: "replaceAll-button",
282
+ onClick: this.handleReplaceAllClick,
283
+ isDisabled: !canReplace
284
+ }, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
285
+ css: replaceSectionButtonStyles,
286
+ testId: this.replace,
287
+ id: "replace-button",
288
+ onClick: this.handleReplaceClick,
289
+ isDisabled: !canReplace
290
+ }, this.replace), jsx(LegacyButton, {
268
291
  css: replaceSectionButtonStyles,
269
292
  appearance: "primary",
270
293
  testId: this.replaceAll,
271
294
  id: "replaceAll-button",
272
295
  onClick: this.handleReplaceAllClick,
273
296
  isDisabled: !canReplace
274
- }, this.replaceAll)), jsx("div", {
297
+ }, this.replaceAll))), jsx("div", {
275
298
  css: orderZeroStyles
276
- }, jsx(Button, {
299
+ }, getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? jsx(Button, {
300
+ appearance: "subtle",
301
+ testId: this.closeFindReplaceDialog,
302
+ onClick: this.clearSearch
303
+ }, this.closeFindReplaceDialog) : jsx(LegacyButton, {
277
304
  css: replaceSectionButtonStyles,
278
305
  appearance: "subtle",
279
306
  testId: this.closeFindReplaceDialog,
@@ -291,17 +318,27 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
291
318
  onKeyDown: this.handleReplaceKeyDown,
292
319
  onCompositionStart: this.handleCompositionStart,
293
320
  onCompositionEnd: this.handleCompositionEnd
294
- }), jsx(Button, {
295
- css: replaceSectionButtonStyles,
321
+ }), getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? jsx(Inline, {
322
+ space: "space.050"
323
+ }, jsx(Button, {
296
324
  testId: this.replace,
297
325
  onClick: this.handleReplaceClick,
298
326
  isDisabled: !canReplace
299
327
  }, this.replace), jsx(Button, {
328
+ testId: this.replaceAll,
329
+ onClick: this.handleReplaceAllClick,
330
+ isDisabled: !canReplace
331
+ }, this.replaceAll)) : jsx(Fragment, null, jsx(LegacyButton, {
332
+ css: replaceSectionButtonStyles,
333
+ testId: this.replace,
334
+ onClick: this.handleReplaceClick,
335
+ isDisabled: !canReplace
336
+ }, this.replace), jsx(LegacyButton, {
300
337
  css: replaceSectionButtonStyles,
301
338
  testId: this.replaceAll,
302
339
  onClick: this.handleReplaceAllClick,
303
340
  isDisabled: !canReplace
304
- }, this.replaceAll));
341
+ }, this.replaceAll)));
305
342
  }
306
343
  }]);
307
344
  return Replace;
@@ -60,7 +60,8 @@ export var countWrapperStyles = css({
60
60
  alignItems: 'center'
61
61
  });
62
62
  export var orderZeroStyles = css({
63
- order: '0'
63
+ order: '0',
64
+ marginInline: getBooleanFF('platform.design-system-team.editor-new-button_jjjdo') ? "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)") : 0
64
65
  });
65
66
  export var orderOneStyles = css({
66
67
  order: '1'
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { FindReplaceToolbarButtonWithStateProps } from './types';
3
- declare const _default: React.MemoExoticComponent<({ popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, isToolbarReducedSpacing, editorView, containerElement, dispatchAnalyticsEvent, featureFlags, takeFullWidth, api, }: FindReplaceToolbarButtonWithStateProps) => JSX.Element | null>;
3
+ declare const _default: React.MemoExoticComponent<({ popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, isToolbarReducedSpacing, editorView, containerElement, dispatchAnalyticsEvent, takeFullWidth, api, }: FindReplaceToolbarButtonWithStateProps) => JSX.Element | null>;
4
4
  export default _default;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
- import type { ExtractInjectionAPI, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { ExtractInjectionAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
6
5
  import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
7
6
  export interface FindReplacePluginState {
8
7
  /** Whether find/replace is active, i.e. displayed */
@@ -34,10 +33,9 @@ export type FindReplaceToolbarButtonWithStateProps = {
34
33
  containerElement: HTMLElement | null;
35
34
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
36
35
  takeFullWidth?: boolean;
37
- featureFlags: FeatureFlags;
38
36
  api: ExtractInjectionAPI<FindReplacePlugin> | undefined;
39
37
  };
40
- export type FindReplaceToolbarButtonActionProps = Omit<FindReplaceToolbarButtonWithStateProps, 'featureFlags' | 'api'>;
38
+ export type FindReplaceToolbarButtonActionProps = Omit<FindReplaceToolbarButtonWithStateProps, 'api'>;
41
39
  type Config = {
42
40
  takeFullWidth: boolean;
43
41
  twoLineEditorToolbar: boolean;
@@ -45,10 +43,7 @@ type Config = {
45
43
  export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
46
44
  pluginConfiguration: Config;
47
45
  sharedState: FindReplacePluginState | undefined;
48
- dependencies: [
49
- OptionalPlugin<FeatureFlagsPlugin>,
50
- OptionalPlugin<AnalyticsPlugin>
51
- ];
46
+ dependencies: [OptionalPlugin<AnalyticsPlugin>];
52
47
  actions: {
53
48
  getToolbarButton: (params: FindReplaceToolbarButtonActionProps) => React.ReactNode;
54
49
  };
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
+ import type { IconProps } from '@atlaskit/icon/types';
2
3
  interface Props {
3
4
  title: string;
4
5
  icon: JSX.Element;
6
+ newIcon: React.ComponentType<IconProps>;
7
+ iconLabel: string;
8
+ iconSize?: 'small' | undefined;
5
9
  keymapDescription: string;
6
10
  onClick: (ref: React.RefObject<HTMLButtonElement>) => void;
7
11
  disabled?: boolean;
8
12
  isPressed?: boolean;
9
- appearance?: 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
13
+ appearance?: 'default' | 'primary' | 'subtle';
10
14
  }
11
15
  export declare class FindReplaceTooltipButton extends React.PureComponent<Props> {
12
16
  private buttonRef;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { FindReplaceToolbarButtonWithStateProps } from './types';
3
- declare const _default: React.MemoExoticComponent<({ popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, isToolbarReducedSpacing, editorView, containerElement, dispatchAnalyticsEvent, featureFlags, takeFullWidth, api, }: FindReplaceToolbarButtonWithStateProps) => JSX.Element | null>;
3
+ declare const _default: React.MemoExoticComponent<({ popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, isToolbarReducedSpacing, editorView, containerElement, dispatchAnalyticsEvent, takeFullWidth, api, }: FindReplaceToolbarButtonWithStateProps) => JSX.Element | null>;
4
4
  export default _default;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
- import type { ExtractInjectionAPI, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
+ import type { ExtractInjectionAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
6
5
  import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
7
6
  export interface FindReplacePluginState {
8
7
  /** Whether find/replace is active, i.e. displayed */
@@ -34,10 +33,9 @@ export type FindReplaceToolbarButtonWithStateProps = {
34
33
  containerElement: HTMLElement | null;
35
34
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
36
35
  takeFullWidth?: boolean;
37
- featureFlags: FeatureFlags;
38
36
  api: ExtractInjectionAPI<FindReplacePlugin> | undefined;
39
37
  };
40
- export type FindReplaceToolbarButtonActionProps = Omit<FindReplaceToolbarButtonWithStateProps, 'featureFlags' | 'api'>;
38
+ export type FindReplaceToolbarButtonActionProps = Omit<FindReplaceToolbarButtonWithStateProps, 'api'>;
41
39
  type Config = {
42
40
  takeFullWidth: boolean;
43
41
  twoLineEditorToolbar: boolean;
@@ -46,7 +44,6 @@ export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
46
44
  pluginConfiguration: Config;
47
45
  sharedState: FindReplacePluginState | undefined;
48
46
  dependencies: [
49
- OptionalPlugin<FeatureFlagsPlugin>,
50
47
  OptionalPlugin<AnalyticsPlugin>
51
48
  ];
52
49
  actions: {
@@ -1,12 +1,16 @@
1
1
  import React from 'react';
2
+ import type { IconProps } from '@atlaskit/icon/types';
2
3
  interface Props {
3
4
  title: string;
4
5
  icon: JSX.Element;
6
+ newIcon: React.ComponentType<IconProps>;
7
+ iconLabel: string;
8
+ iconSize?: 'small' | undefined;
5
9
  keymapDescription: string;
6
10
  onClick: (ref: React.RefObject<HTMLButtonElement>) => void;
7
11
  disabled?: boolean;
8
12
  isPressed?: boolean;
9
- appearance?: 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
13
+ appearance?: 'default' | 'primary' | 'subtle';
10
14
  }
11
15
  export declare class FindReplaceTooltipButton extends React.PureComponent<Props> {
12
16
  private buttonRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
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.3.0",
38
- "@atlaskit/editor-common": "^77.4.0",
37
+ "@atlaskit/button": "^17.4.0",
38
+ "@atlaskit/editor-common": "^78.0.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
40
- "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
41
40
  "@atlaskit/editor-prosemirror": "3.0.0",
42
41
  "@atlaskit/editor-shared-styles": "^2.9.0",
43
42
  "@atlaskit/form": "^9.0.5",
44
43
  "@atlaskit/icon": "^22.0.0",
45
44
  "@atlaskit/platform-feature-flags": "^0.2.0",
45
+ "@atlaskit/primitives": "^2.0.0",
46
46
  "@atlaskit/textfield": "^6.0.0",
47
47
  "@atlaskit/theme": "^12.6.0",
48
48
  "@atlaskit/tokens": "^1.37.0",
@@ -56,7 +56,6 @@
56
56
  "@af/visual-regression": "*",
57
57
  "@atlaskit/editor-plugin-block-type": "^3.0.0",
58
58
  "@atlaskit/editor-plugin-text-formatting": "^1.0.0",
59
- "@atlaskit/primitives": "^2.0.0",
60
59
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
61
60
  "@atlassian/feature-flags-test-utils": "^0.2.0",
62
61
  "@testing-library/react": "^12.1.5",
@@ -108,6 +107,9 @@
108
107
  "platform-feature-flags": {
109
108
  "platform.editor.a11y-find-replace": {
110
109
  "type": "boolean"
110
+ },
111
+ "platform.design-system-team.editor-new-button_jjjdo": {
112
+ "type": "boolean"
111
113
  }
112
114
  },
113
115
  "stricter": {