@atlaskit/editor-plugin-find-replace 1.0.2 → 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,36 @@
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
+
3
34
  ## 1.0.2
4
35
 
5
36
  ### 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,7 +230,7 @@ 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,
@@ -286,7 +285,7 @@ var Find = /*#__PURE__*/function (_React$Component) {
286
285
  }, findText && (0, _react2.jsx)("span", {
287
286
  "data-testid": "textfield-count",
288
287
  css: _styles.countStyles
289
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
288
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
290
289
  title: this.matchCase,
291
290
  icon: this.matchCaseIcon,
292
291
  newIcon: _keyboard.default,
@@ -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,7 +209,7 @@ 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,
@@ -265,7 +264,7 @@ class Find extends React.Component {
265
264
  }, findText && jsx("span", {
266
265
  "data-testid": "textfield-count",
267
266
  css: countStyles
268
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && jsx(FindReplaceTooltipButton, {
267
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), jsx(FindReplaceTooltipButton, {
269
268
  title: this.matchCase,
270
269
  icon: this.matchCaseIcon,
271
270
  newIcon: MatchCaseIcon,
@@ -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,7 +225,7 @@ 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,
@@ -281,7 +280,7 @@ var Find = /*#__PURE__*/function (_React$Component) {
281
280
  }, findText && jsx("span", {
282
281
  "data-testid": "textfield-count",
283
282
  css: countStyles
284
- }, count.total === 0 ? this.noResultsFound : resultsCount)), allowMatchCase && jsx(FindReplaceTooltipButton, {
283
+ }, count.total === 0 ? this.noResultsFound : resultsCount)), jsx(FindReplaceTooltipButton, {
285
284
  title: this.matchCase,
286
285
  icon: this.matchCaseIcon,
287
286
  newIcon: MatchCaseIcon,
@@ -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,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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "1.0.2",
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,10 +34,9 @@
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",