@atlaskit/editor-plugin-find-replace 1.7.22 → 1.8.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 +20 -0
- package/dist/cjs/pm-plugins/utils/batch-decorations.js +0 -2
- package/dist/cjs/pm-plugins/utils/index.js +0 -3
- package/dist/cjs/ui/ui-styles.js +4 -6
- package/dist/es2019/pm-plugins/utils/batch-decorations.js +0 -2
- package/dist/es2019/pm-plugins/utils/index.js +1 -7
- package/dist/es2019/ui/ui-styles.js +4 -8
- package/dist/esm/pm-plugins/utils/batch-decorations.js +0 -2
- package/dist/esm/pm-plugins/utils/index.js +0 -3
- package/dist/esm/ui/ui-styles.js +4 -8
- package/dist/types/findReplacePluginType.d.ts +5 -1
- package/dist/types-ts4.5/findReplacePluginType.d.ts +5 -4
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-find-replace
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
|
|
8
|
+
[`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
|
|
9
|
+
Update `React` from v16 to v18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.7.23
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#102547](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102547)
|
|
20
|
+
[`b76cc60ba170b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76cc60ba170b) -
|
|
21
|
+
Internal changes to remove deprecated typography imports.
|
|
22
|
+
|
|
3
23
|
## 1.7.22
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -34,8 +34,6 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
34
34
|
* Applies the decorations needed for the current search results
|
|
35
35
|
* It does so async, splitting them up into batches to help with performance
|
|
36
36
|
*/
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
37
|
}, {
|
|
40
38
|
key: "applyAllSearchDecorations",
|
|
41
39
|
value: (function () {
|
|
@@ -35,9 +35,6 @@ var createDecoration = exports.createDecoration = function createDecoration(star
|
|
|
35
35
|
class: className
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
// Ignored via go/ees005
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
41
38
|
function findMatches(content, searchText, shouldMatchCase) {
|
|
42
39
|
var contentIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
43
40
|
var matches = [];
|
package/dist/cjs/ui/ui-styles.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.wrapperStyles = exports.wrapperPaddingStyles = exports.textFieldWrapper
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
9
|
var _colors = require("@atlaskit/theme/colors");
|
|
10
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
11
10
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
12
11
|
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
13
12
|
/**
|
|
@@ -16,8 +15,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
16
15
|
*/
|
|
17
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
17
|
|
|
19
|
-
var fontSize =
|
|
20
|
-
var gridSize = (0, _constants.gridSize)();
|
|
18
|
+
var fontSize = 14;
|
|
21
19
|
|
|
22
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
23
21
|
var ruleStyles = exports.ruleStyles = (0, _react.css)({
|
|
@@ -84,14 +82,14 @@ var textFieldWrapper = exports.textFieldWrapper = (0, _react.css)({
|
|
|
84
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
85
83
|
'#find-text-field, #replace-text-field': {
|
|
86
84
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
87
|
-
height: "".concat(
|
|
85
|
+
height: "".concat(36 / fontSize, "em")
|
|
88
86
|
},
|
|
89
87
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
90
88
|
label: {
|
|
91
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
92
90
|
fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(14),
|
|
93
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
94
|
-
lineHeight:
|
|
92
|
+
lineHeight: '16px'
|
|
95
93
|
}
|
|
96
94
|
});
|
|
97
95
|
|
|
@@ -120,7 +118,7 @@ var nextPreviousItemStyles = exports.nextPreviousItemStyles = (0, _react.css)({
|
|
|
120
118
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
121
119
|
var countStyles = exports.countStyles = (0, _react.css)({
|
|
122
120
|
color: "var(--ds-text-subtlest, #626F86)",
|
|
123
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
124
122
|
fontSize: "".concat((0, _editorSharedStyles.relativeFontSizeToBase16)(12)),
|
|
125
123
|
flex: '0 0 auto',
|
|
126
124
|
justifyContent: 'center',
|
|
@@ -19,8 +19,6 @@ class BatchDecorations {
|
|
|
19
19
|
* Applies the decorations needed for the current search results
|
|
20
20
|
* It does so async, splitting them up into batches to help with performance
|
|
21
21
|
*/
|
|
22
|
-
// Ignored via go/ees005
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
22
|
async applyAllSearchDecorations(editorView, containerElement, addDecorations, removeDecorations) {
|
|
25
23
|
this.stop();
|
|
26
24
|
this.addDecorations = addDecorations;
|
|
@@ -22,9 +22,6 @@ export const createDecoration = (start, end, isSelected) => {
|
|
|
22
22
|
class: className
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
// Ignored via go/ees005
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
25
|
export function findMatches(content, searchText, shouldMatchCase, contentIndex = 0) {
|
|
29
26
|
const matches = [];
|
|
30
27
|
const searchTextLength = searchText.length;
|
|
@@ -96,10 +93,7 @@ export function findSearchIndex(selectionPos, matches, backward = false) {
|
|
|
96
93
|
}
|
|
97
94
|
export const nextIndex = (currentIndex, total) => (currentIndex + 1) % total;
|
|
98
95
|
export const prevIndex = (currentIndex, total) => (currentIndex - 1 + total) % total;
|
|
99
|
-
export const getSelectionForMatch = (selection, doc, index, matches, offset = 0
|
|
100
|
-
// Ignored via go/ees005
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
102
|
-
) => {
|
|
96
|
+
export const getSelectionForMatch = (selection, doc, index, matches, offset = 0) => {
|
|
103
97
|
if (matches[index]) {
|
|
104
98
|
return TextSelection.create(doc, matches[index].start + offset);
|
|
105
99
|
}
|
|
@@ -8,11 +8,7 @@
|
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { N30A } from '@atlaskit/theme/colors';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
13
|
-
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
14
|
-
const fontSize = getFontSize();
|
|
15
|
-
const gridSize = getGridSize();
|
|
11
|
+
const fontSize = 14;
|
|
16
12
|
|
|
17
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
18
14
|
export const ruleStyles = css({
|
|
@@ -79,14 +75,14 @@ export const textFieldWrapper = css({
|
|
|
79
75
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
80
76
|
'#find-text-field, #replace-text-field': {
|
|
81
77
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
82
|
-
height: `${
|
|
78
|
+
height: `${36 / fontSize}em`
|
|
83
79
|
},
|
|
84
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
85
81
|
label: {
|
|
86
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
87
83
|
fontSize: relativeFontSizeToBase16(14),
|
|
88
84
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
89
|
-
lineHeight:
|
|
85
|
+
lineHeight: '16px'
|
|
90
86
|
}
|
|
91
87
|
});
|
|
92
88
|
|
|
@@ -115,7 +111,7 @@ export const nextPreviousItemStyles = css({
|
|
|
115
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
116
112
|
export const countStyles = css({
|
|
117
113
|
color: `${"var(--ds-text-subtlest, #626F86)"}`,
|
|
118
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
114
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
119
115
|
fontSize: `${relativeFontSizeToBase16(12)}`,
|
|
120
116
|
flex: '0 0 auto',
|
|
121
117
|
justifyContent: 'center',
|
|
@@ -28,8 +28,6 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
28
28
|
* Applies the decorations needed for the current search results
|
|
29
29
|
* It does so async, splitting them up into batches to help with performance
|
|
30
30
|
*/
|
|
31
|
-
// Ignored via go/ees005
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
33
31
|
}, {
|
|
34
32
|
key: "applyAllSearchDecorations",
|
|
35
33
|
value: (function () {
|
|
@@ -25,9 +25,6 @@ export var createDecoration = function createDecoration(start, end, isSelected)
|
|
|
25
25
|
class: className
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
// Ignored via go/ees005
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
31
28
|
export function findMatches(content, searchText, shouldMatchCase) {
|
|
32
29
|
var contentIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
33
30
|
var matches = [];
|
package/dist/esm/ui/ui-styles.js
CHANGED
|
@@ -8,11 +8,7 @@
|
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { N30A } from '@atlaskit/theme/colors';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
13
|
-
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
14
|
-
var fontSize = getFontSize();
|
|
15
|
-
var gridSize = getGridSize();
|
|
11
|
+
var fontSize = 14;
|
|
16
12
|
|
|
17
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
18
14
|
export var ruleStyles = css({
|
|
@@ -79,14 +75,14 @@ export var textFieldWrapper = css({
|
|
|
79
75
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
80
76
|
'#find-text-field, #replace-text-field': {
|
|
81
77
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
82
|
-
height: "".concat(
|
|
78
|
+
height: "".concat(36 / fontSize, "em")
|
|
83
79
|
},
|
|
84
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
85
81
|
label: {
|
|
86
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
87
83
|
fontSize: relativeFontSizeToBase16(14),
|
|
88
84
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
89
|
-
lineHeight:
|
|
85
|
+
lineHeight: '16px'
|
|
90
86
|
}
|
|
91
87
|
});
|
|
92
88
|
|
|
@@ -115,7 +111,7 @@ export var nextPreviousItemStyles = css({
|
|
|
115
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
116
112
|
export var countStyles = css({
|
|
117
113
|
color: "var(--ds-text-subtlest, #626F86)",
|
|
118
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
114
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
119
115
|
fontSize: "".concat(relativeFontSizeToBase16(12)),
|
|
120
116
|
flex: '0 0 auto',
|
|
121
117
|
justifyContent: 'center',
|
|
@@ -7,10 +7,14 @@ type Config = {
|
|
|
7
7
|
takeFullWidth: boolean;
|
|
8
8
|
twoLineEditorToolbar: boolean;
|
|
9
9
|
};
|
|
10
|
+
export type FindReplacePluginDependencies = [
|
|
11
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
12
|
+
OptionalPlugin<PrimaryToolbarPlugin>
|
|
13
|
+
];
|
|
10
14
|
export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
|
|
11
15
|
pluginConfiguration: Config;
|
|
12
16
|
sharedState: FindReplacePluginState | undefined;
|
|
13
|
-
dependencies:
|
|
17
|
+
dependencies: FindReplacePluginDependencies;
|
|
14
18
|
actions: {
|
|
15
19
|
getToolbarButton: (params: FindReplaceToolbarButtonActionProps) => React.ReactNode;
|
|
16
20
|
};
|
|
@@ -7,13 +7,14 @@ type Config = {
|
|
|
7
7
|
takeFullWidth: boolean;
|
|
8
8
|
twoLineEditorToolbar: boolean;
|
|
9
9
|
};
|
|
10
|
+
export type FindReplacePluginDependencies = [
|
|
11
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
12
|
+
OptionalPlugin<PrimaryToolbarPlugin>
|
|
13
|
+
];
|
|
10
14
|
export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
|
|
11
15
|
pluginConfiguration: Config;
|
|
12
16
|
sharedState: FindReplacePluginState | undefined;
|
|
13
|
-
dependencies:
|
|
14
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
15
|
-
OptionalPlugin<PrimaryToolbarPlugin>
|
|
16
|
-
];
|
|
17
|
+
dependencies: FindReplacePluginDependencies;
|
|
17
18
|
actions: {
|
|
18
19
|
getToolbarButton: (params: FindReplaceToolbarButtonActionProps) => React.ReactNode;
|
|
19
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"./styles": "./src/ui/styles.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/button": "^20.
|
|
36
|
-
"@atlaskit/editor-common": "^99.
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
35
|
+
"@atlaskit/button": "^20.4.0",
|
|
36
|
+
"@atlaskit/editor-common": "^99.6.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^1.11.0",
|
|
38
38
|
"@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
40
40
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
41
|
-
"@atlaskit/form": "^11.
|
|
42
|
-
"@atlaskit/icon": "^23.
|
|
41
|
+
"@atlaskit/form": "^11.1.0",
|
|
42
|
+
"@atlaskit/icon": "^23.5.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
44
|
-
"@atlaskit/primitives": "^13.
|
|
45
|
-
"@atlaskit/textfield": "^6.
|
|
46
|
-
"@atlaskit/theme": "^14.
|
|
47
|
-
"@atlaskit/tokens": "^3.
|
|
48
|
-
"@atlaskit/tooltip": "^19.
|
|
44
|
+
"@atlaskit/primitives": "^13.4.0",
|
|
45
|
+
"@atlaskit/textfield": "^6.8.0",
|
|
46
|
+
"@atlaskit/theme": "^14.1.0",
|
|
47
|
+
"@atlaskit/tokens": "^3.3.0",
|
|
48
|
+
"@atlaskit/tooltip": "^19.1.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@af/visual-regression": "*",
|
|
56
|
-
"@atlaskit/editor-plugin-block-type": "^4.
|
|
57
|
-
"@atlaskit/editor-plugin-text-formatting": "^1.
|
|
58
|
-
"@testing-library/react": "^
|
|
56
|
+
"@atlaskit/editor-plugin-block-type": "^4.2.0",
|
|
57
|
+
"@atlaskit/editor-plugin-text-formatting": "^1.17.0",
|
|
58
|
+
"@testing-library/react": "^13.4.0",
|
|
59
59
|
"@testing-library/user-event": "^14.4.3",
|
|
60
60
|
"mockdate": "^3.0.5",
|
|
61
61
|
"raf-stub": "^2.0.1",
|
|
62
|
-
"react-dom": "^
|
|
62
|
+
"react-dom": "^18.2.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"react": "^16.8.0 || ^17.0.0 || ~18.2.0",
|