@atlaskit/editor-plugin-find-replace 1.1.3 → 1.1.5

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,17 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 1.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#81374](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81374) [`3e7990b6d1a3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e7990b6d1a3) - React 18 types for editor-plugin-find-replace
8
+
9
+ ## 1.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#78913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78913) [`b244d468a298`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b244d468a298) - fix incorrect usage of a platform ff in find and replace plugin
14
+
3
15
  ## 1.1.3
4
16
 
5
17
  ### Patch Changes
@@ -12,8 +12,8 @@ var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _commands = require("./commands");
13
13
  var _commandsWithAnalytics = require("./commands-with-analytics");
14
14
  var _FindReplaceToolbarButton = _interopRequireDefault(require("./ui/FindReplaceToolbarButton"));
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  // light implementation of useSharedPluginState(). This is due to findreplace
18
18
  // being the only plugin that previously used WithPluginState with
19
19
  // debounce=false. That was implemented because of text sync issues
@@ -29,7 +29,7 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
29
29
  var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
30
30
  var _styles = require("./styles");
31
31
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
32
- 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; } } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */
32
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */
33
33
  var FIND_DEBOUNCE_MS = exports.FIND_DEBOUNCE_MS = 100;
34
34
  // eslint-disable-next-line @repo/internal/react/no-class-components
35
35
  var Find = /*#__PURE__*/function (_React$Component) {
@@ -19,7 +19,7 @@ var _Find = _interopRequireDefault(require("./Find"));
19
19
  var _Replace = _interopRequireDefault(require("./Replace"));
20
20
  var _styles = require("./styles");
21
21
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
22
- 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; } } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */
22
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */
23
23
  // eslint-disable-next-line @repo/internal/react/no-class-components
24
24
  var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
25
25
  (0, _inherits2.default)(FindReplace, _React$PureComponent);
@@ -29,7 +29,7 @@ var _templateObject, _templateObject2, _templateObject3;
29
29
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
30
30
  /** @jsx jsx */
31
31
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
32
- 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; } }
32
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
33
33
  var toolbarButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1 1 auto;\n flex-grow: 0;\n justify-content: flex-end;\n align-items: center;\n padding: 0 ", ";\n @media (max-width: ", "px) {\n justify-content: center;\n padding: 0;\n }\n"])), "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorMobileMaxWidth);
34
34
  var toolbarButtonWrapperFullWith = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
35
35
  var wrapper = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n"])));
@@ -22,7 +22,7 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
22
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; }
23
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; }
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
- 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; } }
25
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
26
26
  // eslint-disable-next-line @repo/internal/react/no-class-components
27
27
  var FindReplaceTooltipButton = exports.FindReplaceTooltipButton = /*#__PURE__*/function (_React$PureComponent) {
28
28
  (0, _inherits2.default)(FindReplaceTooltipButton, _React$PureComponent);
@@ -28,10 +28,10 @@ var _primitives = require("@atlaskit/primitives");
28
28
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
29
29
  var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
30
30
  var _styles = require("./styles");
31
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
32
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
33
33
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
34
- 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; } } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */
34
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /** @jsx jsx */
35
35
  // eslint-disable-next-line @repo/internal/react/no-class-components
36
36
  var Replace = /*#__PURE__*/function (_React$PureComponent) {
37
37
  (0, _inherits2.default)(Replace, _React$PureComponent);
@@ -222,6 +222,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
222
222
  var resultsReplace = formatMessage(_messages.findReplaceMessages.replaceSuccess, {
223
223
  numberOfMatches: replaceCount
224
224
  });
225
+ var replaceSectionButtonStyles = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? _styles.replaceSectionButtonNewStyles : _styles.replaceSectionButtonOldStyles;
225
226
  return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", {
226
227
  css: [_styles.sectionWrapperStyles, _styles.sectionWrapperStylesAlternate]
227
228
  }, (0, _react2.jsx)("div", {
@@ -292,13 +293,13 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
292
293
  onClick: this.handleReplaceAllClick,
293
294
  isDisabled: !canReplace
294
295
  }, this.replaceAll)) : (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_standardButton.default, {
295
- css: _styles.replaceSectionButtonStyles,
296
+ css: replaceSectionButtonStyles,
296
297
  testId: this.replace,
297
298
  id: "replace-button",
298
299
  onClick: this.handleReplaceClick,
299
300
  isDisabled: !canReplace
300
301
  }, this.replace), (0, _react2.jsx)(_standardButton.default, {
301
- css: _styles.replaceSectionButtonStyles,
302
+ css: replaceSectionButtonStyles,
302
303
  appearance: "primary",
303
304
  testId: this.replaceAll,
304
305
  id: "replaceAll-button",
@@ -311,7 +312,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
311
312
  testId: this.closeFindReplaceDialog,
312
313
  onClick: this.clearSearch
313
314
  }, this.closeFindReplaceDialog) : (0, _react2.jsx)(_standardButton.default, {
314
- css: _styles.replaceSectionButtonStyles,
315
+ css: replaceSectionButtonStyles,
315
316
  appearance: "subtle",
316
317
  testId: this.closeFindReplaceDialog,
317
318
  onClick: this.clearSearch
@@ -339,12 +340,12 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
339
340
  onClick: this.handleReplaceAllClick,
340
341
  isDisabled: !canReplace
341
342
  }, this.replaceAll)) : (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_standardButton.default, {
342
- css: _styles.replaceSectionButtonStyles,
343
+ css: replaceSectionButtonStyles,
343
344
  testId: this.replace,
344
345
  onClick: this.handleReplaceClick,
345
346
  isDisabled: !canReplace
346
347
  }, this.replace), (0, _react2.jsx)(_standardButton.default, {
347
- css: _styles.replaceSectionButtonStyles,
348
+ css: replaceSectionButtonStyles,
348
349
  testId: this.replaceAll,
349
350
  onClick: this.handleReplaceAllClick,
350
351
  isDisabled: !canReplace
@@ -4,11 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.wrapperStyles = exports.wrapperPaddingStyles = exports.textFieldWrapper = exports.sectionWrapperStylesAlternate = exports.sectionWrapperStyles = exports.sectionWrapperJustified = exports.ruleStyles = exports.replaceSectionButtonStyles = exports.orderZeroStyles = exports.orderZeroDeprecatedStyles = exports.orderOneStyles = exports.nextPreviousItemStyles = exports.matchCaseSection = exports.countWrapperStyles = exports.countStylesAlternateStyles = exports.countStyles = exports.afterInputSection = void 0;
7
+ exports.wrapperStyles = exports.wrapperPaddingStyles = exports.textFieldWrapper = exports.sectionWrapperStylesAlternate = exports.sectionWrapperStyles = exports.sectionWrapperJustified = exports.ruleStyles = exports.replaceSectionButtonOldStyles = exports.replaceSectionButtonNewStyles = exports.orderZeroStyles = exports.orderZeroDeprecatedStyles = exports.orderOneStyles = exports.nextPreviousItemStyles = exports.matchCaseSection = exports.countWrapperStyles = exports.countStylesAlternateStyles = exports.countStyles = exports.afterInputSection = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _colors = require("@atlaskit/theme/colors");
13
12
  var _constants = require("@atlaskit/theme/constants");
14
13
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
@@ -17,10 +16,11 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
17
16
  /** @jsx jsx */
18
17
  var fontSize = (0, _constants.fontSize)();
19
18
  var gridSize = (0, _constants.gridSize)();
20
- var replaceSectionButtonStyles = exports.replaceSectionButtonStyles = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-find-replace') ? (0, _react.css)({
19
+ var replaceSectionButtonNewStyles = exports.replaceSectionButtonNewStyles = (0, _react.css)({
21
20
  marginLeft: "var(--ds-space-050, 4px)",
22
21
  marginRight: "var(--ds-space-050, 2px)"
23
- }) : (0, _react.css)({
22
+ });
23
+ var replaceSectionButtonOldStyles = exports.replaceSectionButtonOldStyles = (0, _react.css)({
24
24
  marginLeft: "var(--ds-space-050, 4px)"
25
25
  });
26
26
  var ruleStyles = exports.ruleStyles = (0, _react.css)({
@@ -36,7 +36,7 @@ var BatchDecorations = /*#__PURE__*/function () {
36
36
  */
37
37
  }, {
38
38
  key: "applyAllSearchDecorations",
39
- value: function () {
39
+ value: (function () {
40
40
  var _applyAllSearchDecorations = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(editorView, containerElement, addDecorations, removeDecorations) {
41
41
  var pmElement, positions, startPos, endPos, viewportStartPos, viewportEndPos, dir, before, after, diff;
42
42
  return _regenerator.default.wrap(function _callee$(_context) {
@@ -98,7 +98,7 @@ var BatchDecorations = /*#__PURE__*/function () {
98
98
  return _applyAllSearchDecorations.apply(this, arguments);
99
99
  }
100
100
  return applyAllSearchDecorations;
101
- }()
101
+ }())
102
102
  }, {
103
103
  key: "updateDecorationsBetween",
104
104
  value: function () {
@@ -100,7 +100,6 @@ function findSearchIndex(selectionPos, matches) {
100
100
  if (matchIndex < 0) {
101
101
  matchIndex = matches.length - 1; // wrap around from the end
102
102
  }
103
-
104
103
  return matchIndex;
105
104
  }
106
105
  return Math.max(matches.findIndex(function (match) {
@@ -15,7 +15,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
15
  import { Inline, xcss } from '@atlaskit/primitives';
16
16
  import Textfield from '@atlaskit/textfield';
17
17
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
18
- import { nextPreviousItemStyles, orderOneStyles, orderZeroDeprecatedStyles, orderZeroStyles, replaceSectionButtonStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
18
+ import { nextPreviousItemStyles, orderOneStyles, orderZeroDeprecatedStyles, orderZeroStyles, replaceSectionButtonNewStyles, replaceSectionButtonOldStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
19
19
  // eslint-disable-next-line @repo/internal/react/no-class-components
20
20
  class Replace extends React.PureComponent {
21
21
  constructor(props) {
@@ -198,6 +198,7 @@ class Replace extends React.PureComponent {
198
198
  const resultsReplace = formatMessage(messages.replaceSuccess, {
199
199
  numberOfMatches: replaceCount
200
200
  });
201
+ const replaceSectionButtonStyles = getBooleanFF('platform.editor.a11y-find-replace') ? replaceSectionButtonNewStyles : replaceSectionButtonOldStyles;
201
202
  return getBooleanFF('platform.editor.a11y-find-replace') ? jsx(Fragment, null, jsx("div", {
202
203
  css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
203
204
  }, jsx("div", {
@@ -3,17 +3,17 @@
3
3
  /** @jsx jsx */
4
4
  import { css } from '@emotion/react';
5
5
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
6
  import { N30A } from '@atlaskit/theme/colors';
8
7
  import { fontSize as getFontSize,
9
8
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
10
9
  gridSize as getGridSize } from '@atlaskit/theme/constants';
11
10
  const fontSize = getFontSize();
12
11
  const gridSize = getGridSize();
13
- export const replaceSectionButtonStyles = getBooleanFF('platform.editor.a11y-find-replace') ? css({
12
+ export const replaceSectionButtonNewStyles = css({
14
13
  marginLeft: "var(--ds-space-050, 4px)",
15
14
  marginRight: "var(--ds-space-050, 2px)"
16
- }) : css({
15
+ });
16
+ export const replaceSectionButtonOldStyles = css({
17
17
  marginLeft: "var(--ds-space-050, 4px)"
18
18
  });
19
19
  export const ruleStyles = css({
@@ -85,7 +85,6 @@ export function findSearchIndex(selectionPos, matches, backward = false) {
85
85
  if (matchIndex < 0) {
86
86
  matchIndex = matches.length - 1; // wrap around from the end
87
87
  }
88
-
89
88
  return matchIndex;
90
89
  }
91
90
  return Math.max(matches.findIndex(match => match.start >= selectionPos), 0);
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  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); }; }
9
- 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; } }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
11
11
  /** @jsx jsx */
12
12
  import React from 'react';
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  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); }; }
9
- 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; } }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
11
11
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
12
12
  /** @jsx jsx */
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
10
10
  var _templateObject, _templateObject2, _templateObject3;
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
- 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; } }
12
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
14
14
  /** @jsx jsx */
15
15
  import React from 'react';
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  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; }
10
10
  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) { _defineProperty(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; }
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
- 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; } }
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
15
  import LegacyButton from '@atlaskit/button/standard-button';
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  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); }; }
9
- 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; } }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
11
11
  /** @jsx jsx */
12
12
  import React, { Fragment } from 'react';
@@ -23,7 +23,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
23
23
  import { Inline, xcss } from '@atlaskit/primitives';
24
24
  import Textfield from '@atlaskit/textfield';
25
25
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
26
- import { nextPreviousItemStyles, orderOneStyles, orderZeroDeprecatedStyles, orderZeroStyles, replaceSectionButtonStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
26
+ import { nextPreviousItemStyles, orderOneStyles, orderZeroDeprecatedStyles, orderZeroStyles, replaceSectionButtonNewStyles, replaceSectionButtonOldStyles, sectionWrapperJustified, sectionWrapperStyles, sectionWrapperStylesAlternate, textFieldWrapper } from './styles';
27
27
  // eslint-disable-next-line @repo/internal/react/no-class-components
28
28
  var Replace = /*#__PURE__*/function (_React$PureComponent) {
29
29
  _inherits(Replace, _React$PureComponent);
@@ -214,6 +214,7 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
214
214
  var resultsReplace = formatMessage(messages.replaceSuccess, {
215
215
  numberOfMatches: replaceCount
216
216
  });
217
+ var replaceSectionButtonStyles = getBooleanFF('platform.editor.a11y-find-replace') ? replaceSectionButtonNewStyles : replaceSectionButtonOldStyles;
217
218
  return getBooleanFF('platform.editor.a11y-find-replace') ? jsx(Fragment, null, jsx("div", {
218
219
  css: [sectionWrapperStyles, sectionWrapperStylesAlternate]
219
220
  }, jsx("div", {
@@ -5,17 +5,17 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
5
5
  /** @jsx jsx */
6
6
  import { css } from '@emotion/react';
7
7
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
8
  import { N30A } from '@atlaskit/theme/colors';
10
9
  import { fontSize as getFontSize,
11
10
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
12
11
  gridSize as getGridSize } from '@atlaskit/theme/constants';
13
12
  var fontSize = getFontSize();
14
13
  var gridSize = getGridSize();
15
- export var replaceSectionButtonStyles = getBooleanFF('platform.editor.a11y-find-replace') ? css({
14
+ export var replaceSectionButtonNewStyles = css({
16
15
  marginLeft: "var(--ds-space-050, 4px)",
17
16
  marginRight: "var(--ds-space-050, 2px)"
18
- }) : css({
17
+ });
18
+ export var replaceSectionButtonOldStyles = css({
19
19
  marginLeft: "var(--ds-space-050, 4px)"
20
20
  });
21
21
  export var ruleStyles = css({
@@ -30,7 +30,7 @@ var BatchDecorations = /*#__PURE__*/function () {
30
30
  */
31
31
  }, {
32
32
  key: "applyAllSearchDecorations",
33
- value: function () {
33
+ value: (function () {
34
34
  var _applyAllSearchDecorations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(editorView, containerElement, addDecorations, removeDecorations) {
35
35
  var pmElement, positions, startPos, endPos, viewportStartPos, viewportEndPos, dir, before, after, diff;
36
36
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -92,7 +92,7 @@ var BatchDecorations = /*#__PURE__*/function () {
92
92
  return _applyAllSearchDecorations.apply(this, arguments);
93
93
  }
94
94
  return applyAllSearchDecorations;
95
- }()
95
+ }())
96
96
  }, {
97
97
  key: "updateDecorationsBetween",
98
98
  value: function () {
@@ -90,7 +90,6 @@ export function findSearchIndex(selectionPos, matches) {
90
90
  if (matchIndex < 0) {
91
91
  matchIndex = matches.length - 1; // wrap around from the end
92
92
  }
93
-
94
93
  return matchIndex;
95
94
  }
96
95
  return Math.max(matches.findIndex(function (match) {
@@ -3,7 +3,7 @@ import type { IconProps } from '@atlaskit/icon/types';
3
3
  interface Props {
4
4
  title: string;
5
5
  icon: JSX.Element;
6
- newIcon: React.ComponentType<IconProps>;
6
+ newIcon: React.ComponentType<React.PropsWithChildren<IconProps>>;
7
7
  iconLabel: string;
8
8
  iconSize?: 'small' | undefined;
9
9
  keymapDescription: string;
@@ -1,4 +1,5 @@
1
- export declare const replaceSectionButtonStyles: import("@emotion/react").SerializedStyles;
1
+ export declare const replaceSectionButtonNewStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const replaceSectionButtonOldStyles: import("@emotion/react").SerializedStyles;
2
3
  export declare const ruleStyles: import("@emotion/react").SerializedStyles;
3
4
  export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
4
5
  export declare const wrapperPaddingStyles: import("@emotion/react").SerializedStyles;
@@ -3,7 +3,7 @@ import type { IconProps } from '@atlaskit/icon/types';
3
3
  interface Props {
4
4
  title: string;
5
5
  icon: JSX.Element;
6
- newIcon: React.ComponentType<IconProps>;
6
+ newIcon: React.ComponentType<React.PropsWithChildren<IconProps>>;
7
7
  iconLabel: string;
8
8
  iconSize?: 'small' | undefined;
9
9
  keymapDescription: string;
@@ -1,4 +1,5 @@
1
- export declare const replaceSectionButtonStyles: import("@emotion/react").SerializedStyles;
1
+ export declare const replaceSectionButtonNewStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const replaceSectionButtonOldStyles: import("@emotion/react").SerializedStyles;
2
3
  export declare const ruleStyles: import("@emotion/react").SerializedStyles;
3
4
  export declare const wrapperStyles: import("@emotion/react").SerializedStyles;
4
5
  export declare const wrapperPaddingStyles: 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.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "find replace plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,18 +34,18 @@
34
34
  "./styles": "./src/styles.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@atlaskit/button": "^17.6.0",
38
- "@atlaskit/editor-common": "^78.9.0",
37
+ "@atlaskit/button": "^17.7.0",
38
+ "@atlaskit/editor-common": "^78.14.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.0.0",
40
40
  "@atlaskit/editor-prosemirror": "3.0.0",
41
41
  "@atlaskit/editor-shared-styles": "^2.9.0",
42
42
  "@atlaskit/form": "^9.0.5",
43
43
  "@atlaskit/icon": "^22.1.0",
44
44
  "@atlaskit/platform-feature-flags": "^0.2.0",
45
- "@atlaskit/primitives": "^4.0.0",
46
- "@atlaskit/textfield": "^6.0.0",
45
+ "@atlaskit/primitives": "^4.1.0",
46
+ "@atlaskit/textfield": "^6.1.0",
47
47
  "@atlaskit/theme": "^12.6.0",
48
- "@atlaskit/tokens": "^1.39.0",
48
+ "@atlaskit/tokens": "^1.41.0",
49
49
  "@atlaskit/tooltip": "^18.1.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",