@atlaskit/editor-plugin-find-replace 3.1.4 → 3.2.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 +21 -0
- package/dist/cjs/pm-plugins/utils/index.js +7 -4
- package/dist/cjs/ui/FindReplaceDropdown.js +2 -0
- package/dist/cjs/ui/Replace.js +1 -0
- package/dist/cjs/ui/ReplaceNext.js +2 -0
- package/dist/es2019/pm-plugins/utils/index.js +6 -3
- package/dist/es2019/ui/FindReplaceDropdown.js +1 -0
- package/dist/es2019/ui/Replace.js +1 -0
- package/dist/es2019/ui/ReplaceNext.js +1 -0
- package/dist/esm/pm-plugins/utils/index.js +7 -4
- package/dist/esm/ui/FindReplaceDropdown.js +1 -0
- package/dist/esm/ui/Replace.js +1 -0
- package/dist/esm/ui/ReplaceNext.js +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-find-replace
|
|
2
2
|
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#189314](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/189314)
|
|
8
|
+
[`22c6251496010`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22c6251496010) -
|
|
9
|
+
Exported missing types that were already being inferred from existing exports
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 3.1.5
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#186324](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/186324)
|
|
20
|
+
[`71cfee4b93d26`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/71cfee4b93d26) -
|
|
21
|
+
ED-28529 fix scroll to closest match if there are no forward matches for find and replace
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 3.1.4
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -250,15 +250,18 @@ function findMatches(_ref2) {
|
|
|
250
250
|
return matches;
|
|
251
251
|
}
|
|
252
252
|
function findClosestMatch(selectionPos, matches) {
|
|
253
|
-
var forwardMatchIndex =
|
|
253
|
+
var forwardMatchIndex = matches.findIndex(function (match) {
|
|
254
254
|
return match.start >= selectionPos;
|
|
255
|
-
})
|
|
256
|
-
if (forwardMatchIndex ===
|
|
255
|
+
});
|
|
256
|
+
if (forwardMatchIndex === -1) {
|
|
257
|
+
// if there are no forward matches, it must be the last match
|
|
258
|
+
return matches.length > 0 ? matches.length - 1 : 0;
|
|
259
|
+
} else if (forwardMatchIndex === 0) {
|
|
257
260
|
return forwardMatchIndex;
|
|
258
261
|
}
|
|
259
262
|
var backwardMatchIndex = forwardMatchIndex - 1;
|
|
260
263
|
var forwardMatchPos = matches[forwardMatchIndex].start;
|
|
261
|
-
var backwardMatchPos = matches[backwardMatchIndex].
|
|
264
|
+
var backwardMatchPos = matches[backwardMatchIndex].start;
|
|
262
265
|
if (forwardMatchPos - selectionPos < selectionPos - backwardMatchPos) {
|
|
263
266
|
return forwardMatchIndex;
|
|
264
267
|
} else {
|
|
@@ -13,6 +13,8 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _primitives = require("@atlaskit/primitives");
|
|
15
15
|
var _FindReplace = _interopRequireDefault(require("./FindReplace"));
|
|
16
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
17
|
+
|
|
16
18
|
var findReplaceWrapperStyles = (0, _primitives.xcss)({
|
|
17
19
|
display: 'flex',
|
|
18
20
|
flexDirection: 'column'
|
package/dist/cjs/ui/Replace.js
CHANGED
|
@@ -34,6 +34,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
34
34
|
* @jsxRuntime classic
|
|
35
35
|
* @jsx jsx
|
|
36
36
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
37
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
37
38
|
var sectionWrapperStyles = (0, _react2.css)({
|
|
38
39
|
display: 'flex',
|
|
39
40
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -21,6 +21,8 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
|
21
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
22
|
var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
|
|
23
23
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
25
|
+
|
|
24
26
|
var replaceContainerStyles = (0, _primitives.xcss)({
|
|
25
27
|
padding: 'space.100'
|
|
26
28
|
});
|
|
@@ -247,13 +247,16 @@ export function findMatches({
|
|
|
247
247
|
return matches;
|
|
248
248
|
}
|
|
249
249
|
export function findClosestMatch(selectionPos, matches) {
|
|
250
|
-
const forwardMatchIndex =
|
|
251
|
-
if (forwardMatchIndex ===
|
|
250
|
+
const forwardMatchIndex = matches.findIndex(match => match.start >= selectionPos);
|
|
251
|
+
if (forwardMatchIndex === -1) {
|
|
252
|
+
// if there are no forward matches, it must be the last match
|
|
253
|
+
return matches.length > 0 ? matches.length - 1 : 0;
|
|
254
|
+
} else if (forwardMatchIndex === 0) {
|
|
252
255
|
return forwardMatchIndex;
|
|
253
256
|
}
|
|
254
257
|
const backwardMatchIndex = forwardMatchIndex - 1;
|
|
255
258
|
const forwardMatchPos = matches[forwardMatchIndex].start;
|
|
256
|
-
const backwardMatchPos = matches[backwardMatchIndex].
|
|
259
|
+
const backwardMatchPos = matches[backwardMatchIndex].start;
|
|
257
260
|
if (forwardMatchPos - selectionPos < selectionPos - backwardMatchPos) {
|
|
258
261
|
return forwardMatchIndex;
|
|
259
262
|
} else {
|
|
@@ -4,6 +4,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { ArrowKeyNavigationType, Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
7
8
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
9
|
import FindReplace from './FindReplace';
|
|
9
10
|
const findReplaceWrapperStyles = xcss({
|
|
@@ -17,6 +17,7 @@ import { Label, ValidMessage } from '@atlaskit/form';
|
|
|
17
17
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
18
18
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
19
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
20
21
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
21
22
|
import Textfield from '@atlaskit/textfield';
|
|
22
23
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -7,6 +7,7 @@ import { ValidMessage } from '@atlaskit/form';
|
|
|
7
7
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
8
8
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
10
11
|
import { Box, Inline, Text, xcss } from '@atlaskit/primitives';
|
|
11
12
|
import Textfield from '@atlaskit/textfield';
|
|
12
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -237,15 +237,18 @@ export function findMatches(_ref2) {
|
|
|
237
237
|
return matches;
|
|
238
238
|
}
|
|
239
239
|
export function findClosestMatch(selectionPos, matches) {
|
|
240
|
-
var forwardMatchIndex =
|
|
240
|
+
var forwardMatchIndex = matches.findIndex(function (match) {
|
|
241
241
|
return match.start >= selectionPos;
|
|
242
|
-
})
|
|
243
|
-
if (forwardMatchIndex ===
|
|
242
|
+
});
|
|
243
|
+
if (forwardMatchIndex === -1) {
|
|
244
|
+
// if there are no forward matches, it must be the last match
|
|
245
|
+
return matches.length > 0 ? matches.length - 1 : 0;
|
|
246
|
+
} else if (forwardMatchIndex === 0) {
|
|
244
247
|
return forwardMatchIndex;
|
|
245
248
|
}
|
|
246
249
|
var backwardMatchIndex = forwardMatchIndex - 1;
|
|
247
250
|
var forwardMatchPos = matches[forwardMatchIndex].start;
|
|
248
|
-
var backwardMatchPos = matches[backwardMatchIndex].
|
|
251
|
+
var backwardMatchPos = matches[backwardMatchIndex].start;
|
|
249
252
|
if (forwardMatchPos - selectionPos < selectionPos - backwardMatchPos) {
|
|
250
253
|
return forwardMatchIndex;
|
|
251
254
|
} else {
|
|
@@ -4,6 +4,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { ArrowKeyNavigationType, Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
7
8
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
9
|
import FindReplace from './FindReplace';
|
|
9
10
|
var findReplaceWrapperStyles = xcss({
|
package/dist/esm/ui/Replace.js
CHANGED
|
@@ -24,6 +24,7 @@ import { Label, ValidMessage } from '@atlaskit/form';
|
|
|
24
24
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
25
25
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
26
26
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
27
28
|
import { Inline, xcss } from '@atlaskit/primitives';
|
|
28
29
|
import Textfield from '@atlaskit/textfield';
|
|
29
30
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -8,6 +8,7 @@ import { ValidMessage } from '@atlaskit/form';
|
|
|
8
8
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down--hipchat-chevron-down';
|
|
9
9
|
import ChevronUpIcon from '@atlaskit/icon/core/migration/chevron-up--hipchat-chevron-up';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
11
12
|
import { Box, Inline, Text, xcss } from '@atlaskit/primitives';
|
|
12
13
|
import Textfield from '@atlaskit/textfield';
|
|
13
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { FindReplaceToolbarButtonActionProps, FindReplaceOptions, FindReplacePluginState, } from './types';
|
|
2
2
|
export { findReplacePlugin } from './findReplacePlugin';
|
|
3
|
-
export type { FindReplacePlugin, FindReplacePluginOptions } from './findReplacePluginType';
|
|
3
|
+
export type { FindReplacePlugin, FindReplacePluginOptions, FindReplacePluginDependencies, } from './findReplacePluginType';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { FindReplaceToolbarButtonActionProps, FindReplaceOptions, FindReplacePluginState, } from './types';
|
|
2
2
|
export { findReplacePlugin } from './findReplacePlugin';
|
|
3
|
-
export type { FindReplacePlugin, FindReplacePluginOptions } from './findReplacePluginType';
|
|
3
|
+
export type { FindReplacePlugin, FindReplacePluginOptions, FindReplacePluginDependencies, } from './findReplacePluginType';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/button": "^23.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
37
|
-
"@atlaskit/editor-plugin-card": "^7.
|
|
38
|
-
"@atlaskit/editor-plugin-expand": "^4.
|
|
39
|
-
"@atlaskit/editor-plugin-mentions": "^5.
|
|
40
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^4.
|
|
37
|
+
"@atlaskit/editor-plugin-card": "^7.1.0",
|
|
38
|
+
"@atlaskit/editor-plugin-expand": "^4.2.0",
|
|
39
|
+
"@atlaskit/editor-plugin-mentions": "^5.2.0",
|
|
40
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
42
|
+
"@atlaskit/editor-shared-styles": "^3.5.0",
|
|
43
43
|
"@atlaskit/form": "^12.0.0",
|
|
44
|
-
"@atlaskit/icon": "^27.
|
|
45
|
-
"@atlaskit/icon-lab": "^5.
|
|
44
|
+
"@atlaskit/icon": "^27.5.0",
|
|
45
|
+
"@atlaskit/icon-lab": "^5.2.0",
|
|
46
46
|
"@atlaskit/mention": "^24.2.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^14.10.0",
|
|
49
49
|
"@atlaskit/textfield": "^8.0.0",
|
|
50
50
|
"@atlaskit/theme": "^19.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
52
|
-
"@atlaskit/tokens": "^5.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^9.9.0",
|
|
52
|
+
"@atlaskit/tokens": "^5.6.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.3.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@af/visual-regression": "workspace:^",
|
|
62
|
-
"@atlaskit/editor-plugin-block-type": "^6.
|
|
62
|
+
"@atlaskit/editor-plugin-block-type": "^6.1.0",
|
|
63
63
|
"@atlaskit/editor-plugin-text-formatting": "^3.0.0",
|
|
64
64
|
"@testing-library/react": "^13.4.0",
|
|
65
65
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"react-dom": "^18.2.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@atlaskit/editor-common": "^107.
|
|
71
|
+
"@atlaskit/editor-common": "^107.9.0",
|
|
72
72
|
"react": "^18.2.0",
|
|
73
73
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
74
74
|
},
|