@atlaskit/editor-plugin-find-replace 30.0.14 → 30.0.16

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,19 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 30.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [`dd3768b8944a6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd3768b8944a6) -
8
+ Delete unreachable source files and unused dependencies
9
+ - Updated dependencies
10
+
11
+ ## 30.0.15
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 30.0.14
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "30.0.14",
3
+ "version": "30.0.16",
4
4
  "description": "find replace plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "@atlaskit/editor-plugin-primary-toolbar": "^31.0.0",
31
31
  "@atlaskit/editor-plugin-synced-block": "^28.0.0",
32
32
  "@atlaskit/editor-prosemirror": "^9.0.0",
33
- "@atlaskit/editor-shared-styles": "^5.0.0",
33
+ "@atlaskit/editor-shared-styles": "^5.1.0",
34
34
  "@atlaskit/form": "^18.3.0",
35
35
  "@atlaskit/icon": "^38.0.0",
36
36
  "@atlaskit/icon-lab": "^7.11.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/platform-feature-flags-react": "^1.2.0",
40
40
  "@atlaskit/primitives": "^22.6.0",
41
41
  "@atlaskit/textfield": "^10.3.0",
42
- "@atlaskit/tmp-editor-statsig": "^257.0.0",
42
+ "@atlaskit/tmp-editor-statsig": "^258.0.0",
43
43
  "@atlaskit/tokens": "^20.9.0",
44
44
  "@atlaskit/tooltip": "^24.4.0",
45
45
  "@babel/runtime": "^7.0.0",
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.useFindReplacePluginStateSelector = useFindReplacePluginStateSelector;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _react = require("react");
10
- var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
11
- // custom non-debounced hook for the find-replace plugin shared state
12
- function useFindReplacePluginStateSelector(api, key) {
13
- var _useState = (0, _react.useState)(function () {
14
- var currentState = api === null || api === void 0 ? void 0 : api.findReplace.sharedState.currentState();
15
- return currentState === null || currentState === void 0 ? void 0 : currentState[key];
16
- }),
17
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
18
- selectedState = _useState2[0],
19
- setSelectedState = _useState2[1];
20
- var previousStateRef = (0, _react.useRef)(selectedState);
21
- (0, _react.useEffect)(function () {
22
- var unsub = api === null || api === void 0 ? void 0 : api.findReplace.sharedState.onChange(function (_ref) {
23
- var nextSharedState = _ref.nextSharedState;
24
- var newState = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState[key];
25
- if (!(0, _isEqual.default)(previousStateRef.current, newState)) {
26
- previousStateRef.current = newState;
27
- setSelectedState(newState);
28
- }
29
- });
30
- return function () {
31
- unsub === null || unsub === void 0 || unsub();
32
- };
33
- }, [api, key]);
34
- return selectedState;
35
- }
@@ -1,25 +0,0 @@
1
- import { useState, useEffect, useRef } from 'react';
2
- import isEqual from 'lodash/isEqual';
3
- // custom non-debounced hook for the find-replace plugin shared state
4
- export function useFindReplacePluginStateSelector(api, key) {
5
- const [selectedState, setSelectedState] = useState(() => {
6
- const currentState = api === null || api === void 0 ? void 0 : api.findReplace.sharedState.currentState();
7
- return currentState === null || currentState === void 0 ? void 0 : currentState[key];
8
- });
9
- const previousStateRef = useRef(selectedState);
10
- useEffect(() => {
11
- const unsub = api === null || api === void 0 ? void 0 : api.findReplace.sharedState.onChange(({
12
- nextSharedState
13
- }) => {
14
- const newState = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState[key];
15
- if (!isEqual(previousStateRef.current, newState)) {
16
- previousStateRef.current = newState;
17
- setSelectedState(newState);
18
- }
19
- });
20
- return () => {
21
- unsub === null || unsub === void 0 ? void 0 : unsub();
22
- };
23
- }, [api, key]);
24
- return selectedState;
25
- }
@@ -1,28 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import { useState, useEffect, useRef } from 'react';
3
- import isEqual from 'lodash/isEqual';
4
- // custom non-debounced hook for the find-replace plugin shared state
5
- export function useFindReplacePluginStateSelector(api, key) {
6
- var _useState = useState(function () {
7
- var currentState = api === null || api === void 0 ? void 0 : api.findReplace.sharedState.currentState();
8
- return currentState === null || currentState === void 0 ? void 0 : currentState[key];
9
- }),
10
- _useState2 = _slicedToArray(_useState, 2),
11
- selectedState = _useState2[0],
12
- setSelectedState = _useState2[1];
13
- var previousStateRef = useRef(selectedState);
14
- useEffect(function () {
15
- var unsub = api === null || api === void 0 ? void 0 : api.findReplace.sharedState.onChange(function (_ref) {
16
- var nextSharedState = _ref.nextSharedState;
17
- var newState = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState[key];
18
- if (!isEqual(previousStateRef.current, newState)) {
19
- previousStateRef.current = newState;
20
- setSelectedState(newState);
21
- }
22
- });
23
- return function () {
24
- unsub === null || unsub === void 0 || unsub();
25
- };
26
- }, [api, key]);
27
- return selectedState;
28
- }
@@ -1,4 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
2
- import type { FindReplacePlugin } from '../../findReplacePluginType';
3
- import type { FindReplacePluginState } from '../../types';
4
- export declare function useFindReplacePluginStateSelector<Key extends keyof FindReplacePluginState>(api: ExtractInjectionAPI<FindReplacePlugin> | null | undefined, key: Key): FindReplacePluginState[Key] | undefined;