@atlaskit/editor-plugin-find-replace 8.0.2 → 8.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,22 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`0efca55740b36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0efca55740b36) -
8
+ [FFCLEANUP-71458] clean up experiment platform_editor_toggle_expand_on_match_found
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 8.0.3
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 8.0.2
4
21
 
5
22
  ### Patch Changes
@@ -8,7 +8,6 @@ exports.toggleMatchCase = exports.replaceAll = exports.replace = exports.removeD
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _view = require("@atlaskit/editor-prosemirror/view");
10
10
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
12
11
  var _actions = require("./actions");
13
12
  var _pluginFactory = require("./plugin-factory");
14
13
  var _utils = require("./utils");
@@ -88,15 +87,12 @@ var find = exports.find = function find(editorView, containerElement, keyword) {
88
87
  api: api
89
88
  }) : [];
90
89
  if (matches.length > 0) {
90
+ var _api$expand;
91
91
  var index = (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? (0, _utils.findClosestMatch)(selection.from, matches) : (0, _utils.findSearchIndex)(selection.from, matches);
92
92
  var newSelection = (0, _utils.getSelectionForMatch)(tr.selection, tr.doc, index, matches);
93
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
94
- var _api$expand;
95
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
96
- api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
97
- tr: tr
98
- });
99
- }
93
+ api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
94
+ tr: tr
95
+ });
100
96
  return tr.setSelection(newSelection);
101
97
  }
102
98
  return tr;
@@ -106,6 +102,7 @@ var findNext = exports.findNext = function findNext(editorView) {
106
102
  return (0, _commands.withScrollIntoView)((0, _pluginFactory.createCommand)(function (state) {
107
103
  return findInDirection(state, 'next');
108
104
  }, function (tr, state) {
105
+ var _api$expand2;
109
106
  var _getPluginState4 = (0, _pluginFactory.getPluginState)(state),
110
107
  matches = _getPluginState4.matches,
111
108
  index = _getPluginState4.index,
@@ -119,13 +116,9 @@ var findNext = exports.findNext = function findNext(editorView) {
119
116
  searchIndex = (0, _utils.nextIndex)(searchIndex, matches.length);
120
117
  }
121
118
  var newSelection = (0, _utils.getSelectionForMatch)(tr.selection, tr.doc, searchIndex, matches);
122
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
123
- var _api$expand2;
124
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
125
- api === null || api === void 0 || (_api$expand2 = api.expand) === null || _api$expand2 === void 0 || _api$expand2.commands.toggleExpandWithMatch(newSelection)({
126
- tr: tr
127
- });
128
- }
119
+ api === null || api === void 0 || (_api$expand2 = api.expand) === null || _api$expand2 === void 0 || _api$expand2.commands.toggleExpandWithMatch(newSelection)({
120
+ tr: tr
121
+ });
129
122
  return tr.setSelection(newSelection);
130
123
  }));
131
124
  };
@@ -133,6 +126,7 @@ var findPrevious = exports.findPrevious = function findPrevious(editorView) {
133
126
  return (0, _commands.withScrollIntoView)((0, _pluginFactory.createCommand)(function (state) {
134
127
  return findInDirection(state, 'previous');
135
128
  }, function (tr, state) {
129
+ var _api$expand3;
136
130
  var _getPluginState5 = (0, _pluginFactory.getPluginState)(state),
137
131
  matches = _getPluginState5.matches,
138
132
  api = _getPluginState5.api;
@@ -141,13 +135,9 @@ var findPrevious = exports.findPrevious = function findPrevious(editorView) {
141
135
  // from the current cursor position)
142
136
  var searchIndex = (0, _utils.findSearchIndex)(state.selection.from, matches, true);
143
137
  var newSelection = (0, _utils.getSelectionForMatch)(tr.selection, tr.doc, searchIndex, matches);
144
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
145
- var _api$expand3;
146
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
147
- api === null || api === void 0 || (_api$expand3 = api.expand) === null || _api$expand3 === void 0 || _api$expand3.commands.toggleExpandWithMatch(newSelection)({
148
- tr: tr
149
- });
150
- }
138
+ api === null || api === void 0 || (_api$expand3 = api.expand) === null || _api$expand3 === void 0 || _api$expand3.commands.toggleExpandWithMatch(newSelection)({
139
+ tr: tr
140
+ });
151
141
  return tr.setSelection(newSelection);
152
142
  }));
153
143
  };
@@ -8,7 +8,6 @@ exports.initialState = exports.createPlugin = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  var _view = require("@atlaskit/editor-prosemirror/view");
11
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
11
  var _pluginFactory = require("./plugin-factory");
13
12
  var _pluginKey = require("./plugin-key");
14
13
  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; }
@@ -27,10 +26,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
27
26
  return new _safePlugin.SafePlugin({
28
27
  key: _pluginKey.findReplacePluginKey,
29
28
  state: (0, _pluginFactory.createPluginState)(dispatch, function () {
30
- return (0, _expValEquals.expValEquals)('platform_editor_find_and_replace_improvements', 'isEnabled', true) || (0, _expValEquals.expValEquals)('platform_editor_toggle_expand_on_match_found', 'isEnabled', true) ? _objectSpread(_objectSpread({}, initialState), {}, {
29
+ return _objectSpread(_objectSpread({}, initialState), {}, {
31
30
  getIntl: getIntl,
32
31
  api: api
33
- }) : _objectSpread({}, initialState);
32
+ });
34
33
  }),
35
34
  props: {
36
35
  decorations: function decorations(state) {
@@ -10,7 +10,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
10
10
  var _utils = require("@atlaskit/editor-common/utils");
11
11
  var _view = require("@atlaskit/editor-prosemirror/view");
12
12
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
14
13
  var _main = require("./main");
15
14
  var _pluginKey = require("./plugin-key");
16
15
  var _reducer = _interopRequireDefault(require("./reducer"));
@@ -18,6 +17,7 @@ var _utils2 = require("./utils");
18
17
  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; }
19
18
  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; }
20
19
  var handleDocChanged = function handleDocChanged(tr, pluginState) {
20
+ var _api$expand;
21
21
  var isActive = pluginState.isActive,
22
22
  findText = pluginState.findText;
23
23
  if (!isActive || !findText) {
@@ -107,14 +107,10 @@ var handleDocChanged = function handleDocChanged(tr, pluginState) {
107
107
  if (newSelectedMatch) {
108
108
  decorationSet = decorationSet.add(tr.doc, (0, _utils2.createDecorations)(0, [newSelectedMatch]));
109
109
  }
110
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
111
- var _api$expand;
112
- var newSelection = (0, _utils2.getSelectionForMatch)(tr.selection, tr.doc, newIndex, newMatches);
113
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
114
- api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
115
- tr: tr
116
- });
117
- }
110
+ var newSelection = (0, _utils2.getSelectionForMatch)(tr.selection, tr.doc, newIndex, newMatches);
111
+ api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
112
+ tr: tr
113
+ });
118
114
  return _objectSpread(_objectSpread({}, pluginState), {}, {
119
115
  matches: newMatches,
120
116
  index: newIndex,
@@ -1,7 +1,6 @@
1
1
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
3
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
5
4
  import { FindReplaceActionTypes } from './actions';
6
5
  import { createCommand, getPluginState } from './plugin-factory';
7
6
  import { createDecoration, findClosestMatch, findDecorationFromMatch, findMatches, findSearchIndex, getSelectedText, getSelectionForMatch, nextIndex, prevIndex, removeDecorationsFromSet, removeMatchesFromSet } from './utils';
@@ -83,20 +82,18 @@ export const find = (editorView, containerElement, keyword) => withScrollIntoVie
83
82
  api
84
83
  }) : [];
85
84
  if (matches.length > 0) {
85
+ var _api$expand;
86
86
  const index = expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? findClosestMatch(selection.from, matches) : findSearchIndex(selection.from, matches);
87
87
  const newSelection = getSelectionForMatch(tr.selection, tr.doc, index, matches);
88
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
89
- var _api$expand;
90
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
91
- api === null || api === void 0 ? void 0 : (_api$expand = api.expand) === null || _api$expand === void 0 ? void 0 : _api$expand.commands.toggleExpandWithMatch(newSelection)({
92
- tr
93
- });
94
- }
88
+ api === null || api === void 0 ? void 0 : (_api$expand = api.expand) === null || _api$expand === void 0 ? void 0 : _api$expand.commands.toggleExpandWithMatch(newSelection)({
89
+ tr
90
+ });
95
91
  return tr.setSelection(newSelection);
96
92
  }
97
93
  return tr;
98
94
  }));
99
95
  export const findNext = editorView => withScrollIntoView(createCommand(state => findInDirection(state, 'next'), (tr, state) => {
96
+ var _api$expand2;
100
97
  const {
101
98
  matches,
102
99
  index,
@@ -111,16 +108,13 @@ export const findNext = editorView => withScrollIntoView(createCommand(state =>
111
108
  searchIndex = nextIndex(searchIndex, matches.length);
112
109
  }
113
110
  const newSelection = getSelectionForMatch(tr.selection, tr.doc, searchIndex, matches);
114
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
115
- var _api$expand2;
116
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
117
- api === null || api === void 0 ? void 0 : (_api$expand2 = api.expand) === null || _api$expand2 === void 0 ? void 0 : _api$expand2.commands.toggleExpandWithMatch(newSelection)({
118
- tr
119
- });
120
- }
111
+ api === null || api === void 0 ? void 0 : (_api$expand2 = api.expand) === null || _api$expand2 === void 0 ? void 0 : _api$expand2.commands.toggleExpandWithMatch(newSelection)({
112
+ tr
113
+ });
121
114
  return tr.setSelection(newSelection);
122
115
  }));
123
116
  export const findPrevious = editorView => withScrollIntoView(createCommand(state => findInDirection(state, 'previous'), (tr, state) => {
117
+ var _api$expand3;
124
118
  const {
125
119
  matches,
126
120
  api
@@ -130,13 +124,9 @@ export const findPrevious = editorView => withScrollIntoView(createCommand(state
130
124
  // from the current cursor position)
131
125
  const searchIndex = findSearchIndex(state.selection.from, matches, true);
132
126
  const newSelection = getSelectionForMatch(tr.selection, tr.doc, searchIndex, matches);
133
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
134
- var _api$expand3;
135
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
136
- api === null || api === void 0 ? void 0 : (_api$expand3 = api.expand) === null || _api$expand3 === void 0 ? void 0 : _api$expand3.commands.toggleExpandWithMatch(newSelection)({
137
- tr
138
- });
139
- }
127
+ api === null || api === void 0 ? void 0 : (_api$expand3 = api.expand) === null || _api$expand3 === void 0 ? void 0 : _api$expand3.commands.toggleExpandWithMatch(newSelection)({
128
+ tr
129
+ });
140
130
  return tr.setSelection(newSelection);
141
131
  }));
142
132
  const findInDirection = (state, dir) => {
@@ -1,6 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
3
  import { createPluginState, getPluginState } from './plugin-factory';
5
4
  import { findReplacePluginKey } from './plugin-key';
6
5
  export const initialState = {
@@ -16,13 +15,11 @@ export const initialState = {
16
15
  export const createPlugin = (dispatch, getIntl, api) => {
17
16
  return new SafePlugin({
18
17
  key: findReplacePluginKey,
19
- state: createPluginState(dispatch, () => expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) || expValEquals('platform_editor_toggle_expand_on_match_found', 'isEnabled', true) ? {
18
+ state: createPluginState(dispatch, () => ({
20
19
  ...initialState,
21
20
  getIntl,
22
21
  api
23
- } : {
24
- ...initialState
25
- }),
22
+ })),
26
23
  props: {
27
24
  decorations(state) {
28
25
  const {
@@ -1,12 +1,12 @@
1
1
  import { pluginFactory, stepHasSlice } from '@atlaskit/editor-common/utils';
2
2
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
3
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
5
4
  import { initialState } from './main';
6
5
  import { findReplacePluginKey } from './plugin-key';
7
6
  import reducer from './reducer';
8
7
  import { createDecorations, findClosestMatch, findDecorationFromMatch, findMatches, findSearchIndex, findUniqueItemsIn, getSelectionForMatch, isMatchAffectedByStep, removeDecorationsFromSet, removeMatchesFromSet } from './utils';
9
8
  const handleDocChanged = (tr, pluginState) => {
9
+ var _api$expand;
10
10
  const {
11
11
  isActive,
12
12
  findText
@@ -88,14 +88,10 @@ const handleDocChanged = (tr, pluginState) => {
88
88
  if (newSelectedMatch) {
89
89
  decorationSet = decorationSet.add(tr.doc, createDecorations(0, [newSelectedMatch]));
90
90
  }
91
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
92
- var _api$expand;
93
- const newSelection = getSelectionForMatch(tr.selection, tr.doc, newIndex, newMatches);
94
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
95
- api === null || api === void 0 ? void 0 : (_api$expand = api.expand) === null || _api$expand === void 0 ? void 0 : _api$expand.commands.toggleExpandWithMatch(newSelection)({
96
- tr: tr
97
- });
98
- }
91
+ const newSelection = getSelectionForMatch(tr.selection, tr.doc, newIndex, newMatches);
92
+ api === null || api === void 0 ? void 0 : (_api$expand = api.expand) === null || _api$expand === void 0 ? void 0 : _api$expand.commands.toggleExpandWithMatch(newSelection)({
93
+ tr: tr
94
+ });
99
95
  return {
100
96
  ...pluginState,
101
97
  matches: newMatches,
@@ -1,7 +1,6 @@
1
1
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
3
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
5
4
  import { FindReplaceActionTypes } from './actions';
6
5
  import { createCommand, getPluginState } from './plugin-factory';
7
6
  import { createDecoration, findClosestMatch, findDecorationFromMatch, findMatches, findSearchIndex, getSelectedText, getSelectionForMatch, nextIndex, prevIndex, removeDecorationsFromSet, removeMatchesFromSet } from './utils';
@@ -81,15 +80,12 @@ export var find = function find(editorView, containerElement, keyword) {
81
80
  api: api
82
81
  }) : [];
83
82
  if (matches.length > 0) {
83
+ var _api$expand;
84
84
  var index = expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) ? findClosestMatch(selection.from, matches) : findSearchIndex(selection.from, matches);
85
85
  var newSelection = getSelectionForMatch(tr.selection, tr.doc, index, matches);
86
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
87
- var _api$expand;
88
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
89
- api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
90
- tr: tr
91
- });
92
- }
86
+ api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
87
+ tr: tr
88
+ });
93
89
  return tr.setSelection(newSelection);
94
90
  }
95
91
  return tr;
@@ -99,6 +95,7 @@ export var findNext = function findNext(editorView) {
99
95
  return withScrollIntoView(createCommand(function (state) {
100
96
  return findInDirection(state, 'next');
101
97
  }, function (tr, state) {
98
+ var _api$expand2;
102
99
  var _getPluginState4 = getPluginState(state),
103
100
  matches = _getPluginState4.matches,
104
101
  index = _getPluginState4.index,
@@ -112,13 +109,9 @@ export var findNext = function findNext(editorView) {
112
109
  searchIndex = nextIndex(searchIndex, matches.length);
113
110
  }
114
111
  var newSelection = getSelectionForMatch(tr.selection, tr.doc, searchIndex, matches);
115
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
116
- var _api$expand2;
117
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
118
- api === null || api === void 0 || (_api$expand2 = api.expand) === null || _api$expand2 === void 0 || _api$expand2.commands.toggleExpandWithMatch(newSelection)({
119
- tr: tr
120
- });
121
- }
112
+ api === null || api === void 0 || (_api$expand2 = api.expand) === null || _api$expand2 === void 0 || _api$expand2.commands.toggleExpandWithMatch(newSelection)({
113
+ tr: tr
114
+ });
122
115
  return tr.setSelection(newSelection);
123
116
  }));
124
117
  };
@@ -126,6 +119,7 @@ export var findPrevious = function findPrevious(editorView) {
126
119
  return withScrollIntoView(createCommand(function (state) {
127
120
  return findInDirection(state, 'previous');
128
121
  }, function (tr, state) {
122
+ var _api$expand3;
129
123
  var _getPluginState5 = getPluginState(state),
130
124
  matches = _getPluginState5.matches,
131
125
  api = _getPluginState5.api;
@@ -134,13 +128,9 @@ export var findPrevious = function findPrevious(editorView) {
134
128
  // from the current cursor position)
135
129
  var searchIndex = findSearchIndex(state.selection.from, matches, true);
136
130
  var newSelection = getSelectionForMatch(tr.selection, tr.doc, searchIndex, matches);
137
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
138
- var _api$expand3;
139
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
140
- api === null || api === void 0 || (_api$expand3 = api.expand) === null || _api$expand3 === void 0 || _api$expand3.commands.toggleExpandWithMatch(newSelection)({
141
- tr: tr
142
- });
143
- }
131
+ api === null || api === void 0 || (_api$expand3 = api.expand) === null || _api$expand3 === void 0 || _api$expand3.commands.toggleExpandWithMatch(newSelection)({
132
+ tr: tr
133
+ });
144
134
  return tr.setSelection(newSelection);
145
135
  }));
146
136
  };
@@ -3,7 +3,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { createPluginState, getPluginState } from './plugin-factory';
8
7
  import { findReplacePluginKey } from './plugin-key';
9
8
  export var initialState = {
@@ -20,10 +19,10 @@ export var createPlugin = function createPlugin(dispatch, getIntl, api) {
20
19
  return new SafePlugin({
21
20
  key: findReplacePluginKey,
22
21
  state: createPluginState(dispatch, function () {
23
- return expValEquals('platform_editor_find_and_replace_improvements', 'isEnabled', true) || expValEquals('platform_editor_toggle_expand_on_match_found', 'isEnabled', true) ? _objectSpread(_objectSpread({}, initialState), {}, {
22
+ return _objectSpread(_objectSpread({}, initialState), {}, {
24
23
  getIntl: getIntl,
25
24
  api: api
26
- }) : _objectSpread({}, initialState);
25
+ });
27
26
  }),
28
27
  props: {
29
28
  decorations: function decorations(state) {
@@ -5,12 +5,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { pluginFactory, stepHasSlice } from '@atlaskit/editor-common/utils';
6
6
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
8
  import { initialState } from './main';
10
9
  import { findReplacePluginKey } from './plugin-key';
11
10
  import reducer from './reducer';
12
11
  import { createDecorations, findClosestMatch, findDecorationFromMatch, findMatches, findSearchIndex, findUniqueItemsIn, getSelectionForMatch, isMatchAffectedByStep, removeDecorationsFromSet, removeMatchesFromSet } from './utils';
13
12
  var handleDocChanged = function handleDocChanged(tr, pluginState) {
13
+ var _api$expand;
14
14
  var isActive = pluginState.isActive,
15
15
  findText = pluginState.findText;
16
16
  if (!isActive || !findText) {
@@ -100,14 +100,10 @@ var handleDocChanged = function handleDocChanged(tr, pluginState) {
100
100
  if (newSelectedMatch) {
101
101
  decorationSet = decorationSet.add(tr.doc, createDecorations(0, [newSelectedMatch]));
102
102
  }
103
- if (expValEqualsNoExposure('platform_editor_toggle_expand_on_match_found', 'isEnabled', true)) {
104
- var _api$expand;
105
- var newSelection = getSelectionForMatch(tr.selection, tr.doc, newIndex, newMatches);
106
- // the exposure is fired inside toggleExpandWithMatch when user is exposed to the experiment
107
- api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
108
- tr: tr
109
- });
110
- }
103
+ var newSelection = getSelectionForMatch(tr.selection, tr.doc, newIndex, newMatches);
104
+ api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.commands.toggleExpandWithMatch(newSelection)({
105
+ tr: tr
106
+ });
111
107
  return _objectSpread(_objectSpread({}, pluginState), {}, {
112
108
  matches: newMatches,
113
109
  index: newIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "8.0.2",
3
+ "version": "8.1.0",
4
4
  "description": "find replace plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,20 +31,20 @@
31
31
  "@atlaskit/button": "^23.10.0",
32
32
  "@atlaskit/editor-plugin-analytics": "^8.0.0",
33
33
  "@atlaskit/editor-plugin-card": "^13.0.0",
34
- "@atlaskit/editor-plugin-expand": "^9.0.0",
34
+ "@atlaskit/editor-plugin-expand": "^9.1.0",
35
35
  "@atlaskit/editor-plugin-mentions": "^10.0.0",
36
36
  "@atlaskit/editor-plugin-primary-toolbar": "^9.0.0",
37
37
  "@atlaskit/editor-prosemirror": "^7.3.0",
38
38
  "@atlaskit/editor-shared-styles": "^3.10.0",
39
39
  "@atlaskit/form": "^15.4.0",
40
- "@atlaskit/icon": "^32.0.0",
41
- "@atlaskit/icon-lab": "^5.17.0",
40
+ "@atlaskit/icon": "^32.1.0",
41
+ "@atlaskit/icon-lab": "^5.18.0",
42
42
  "@atlaskit/mention": "^24.5.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/primitives": "^18.0.0",
45
45
  "@atlaskit/textfield": "^8.2.0",
46
46
  "@atlaskit/theme": "^22.0.0",
47
- "@atlaskit/tmp-editor-statsig": "^37.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^39.0.0",
48
48
  "@atlaskit/tokens": "^11.1.0",
49
49
  "@atlaskit/tooltip": "^20.14.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -61,7 +61,7 @@
61
61
  "react-dom": "^18.2.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@atlaskit/editor-common": "^112.2.0",
64
+ "@atlaskit/editor-common": "^112.3.0",
65
65
  "react": "^18.2.0",
66
66
  "react-intl-next": "npm:react-intl@^5.18.1"
67
67
  },