@atlaskit/editor-plugin-find-replace 10.2.7 → 10.2.9
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
|
@@ -40,56 +40,56 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
40
40
|
value: (function () {
|
|
41
41
|
var _applyAllSearchDecorations = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(editorView, containerElement, addDecorations, removeDecorations) {
|
|
42
42
|
var pmElement, positions, startPos, endPos, viewportStartPos, viewportEndPos, dir, before, after, diff;
|
|
43
|
-
return _regenerator.default.wrap(function
|
|
43
|
+
return _regenerator.default.wrap(function (_context) {
|
|
44
44
|
while (1) switch (_context.prev = _context.next) {
|
|
45
45
|
case 0:
|
|
46
46
|
this.stop();
|
|
47
47
|
this.addDecorations = addDecorations;
|
|
48
48
|
this.removeDecorations = removeDecorations;
|
|
49
49
|
if (containerElement) {
|
|
50
|
-
_context.next =
|
|
50
|
+
_context.next = 1;
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
return _context.abrupt("return");
|
|
54
|
-
case
|
|
54
|
+
case 1:
|
|
55
55
|
pmElement = containerElement.querySelector('.ProseMirror');
|
|
56
56
|
if (pmElement) {
|
|
57
|
-
_context.next =
|
|
57
|
+
_context.next = 2;
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
return _context.abrupt("return");
|
|
61
|
-
case
|
|
61
|
+
case 2:
|
|
62
62
|
positions = this.calcDecorationPositions(editorView, containerElement, pmElement);
|
|
63
63
|
startPos = positions.startPos, endPos = positions.endPos, viewportStartPos = positions.viewportStartPos, viewportEndPos = positions.viewportEndPos;
|
|
64
64
|
dir = 0;
|
|
65
65
|
before = viewportStartPos;
|
|
66
66
|
after = viewportEndPos - posIncrement;
|
|
67
|
-
_context.next =
|
|
67
|
+
_context.next = 3;
|
|
68
68
|
return this.updateDecorationsBetween(editorView, viewportStartPos, viewportEndPos);
|
|
69
|
-
case
|
|
69
|
+
case 3:
|
|
70
70
|
if (!(before > startPos || after < endPos)) {
|
|
71
|
-
_context.next =
|
|
71
|
+
_context.next = 7;
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
if (!(dir++ % 2 === 0 && before > startPos || after >= endPos)) {
|
|
75
|
-
_context.next =
|
|
75
|
+
_context.next = 5;
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
diff = before - startPos;
|
|
79
79
|
before = Math.max(before - posIncrement, startPos);
|
|
80
|
-
_context.next =
|
|
80
|
+
_context.next = 4;
|
|
81
81
|
return this.updateDecorationsBetween(editorView, before, before + Math.min(diff, posIncrement));
|
|
82
|
-
case
|
|
83
|
-
_context.next =
|
|
82
|
+
case 4:
|
|
83
|
+
_context.next = 6;
|
|
84
84
|
break;
|
|
85
|
-
case
|
|
85
|
+
case 5:
|
|
86
86
|
after = Math.min(after + posIncrement, endPos);
|
|
87
|
-
_context.next =
|
|
87
|
+
_context.next = 6;
|
|
88
88
|
return this.updateDecorationsBetween(editorView, after, Math.min(after + posIncrement, endPos));
|
|
89
|
-
case
|
|
90
|
-
_context.next =
|
|
89
|
+
case 6:
|
|
90
|
+
_context.next = 3;
|
|
91
91
|
break;
|
|
92
|
-
case
|
|
92
|
+
case 7:
|
|
93
93
|
case "end":
|
|
94
94
|
return _context.stop();
|
|
95
95
|
}
|
|
@@ -104,15 +104,15 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
104
104
|
key: "updateDecorationsBetween",
|
|
105
105
|
value: function () {
|
|
106
106
|
var _updateDecorationsBetween = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(editorView, startPos, endPos) {
|
|
107
|
-
return _regenerator.default.wrap(function
|
|
107
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
108
108
|
while (1) switch (_context2.prev = _context2.next) {
|
|
109
109
|
case 0:
|
|
110
|
-
_context2.next =
|
|
110
|
+
_context2.next = 1;
|
|
111
111
|
return this.removeDecorationsBetween(editorView, startPos, endPos);
|
|
112
|
-
case
|
|
113
|
-
_context2.next =
|
|
112
|
+
case 1:
|
|
113
|
+
_context2.next = 2;
|
|
114
114
|
return this.addDecorationsBetween(editorView, startPos, endPos);
|
|
115
|
-
case
|
|
115
|
+
case 2:
|
|
116
116
|
case "end":
|
|
117
117
|
return _context2.stop();
|
|
118
118
|
}
|
|
@@ -129,17 +129,17 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
129
129
|
var _addDecorationsBetween = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(editorView, startPos, endPos) {
|
|
130
130
|
var _this = this;
|
|
131
131
|
var selection, _getPluginState, matches, decorationSet, matchesBetween, selectionMatch, selectionIndex;
|
|
132
|
-
return _regenerator.default.wrap(function
|
|
132
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
133
133
|
while (1) switch (_context3.prev = _context3.next) {
|
|
134
134
|
case 0:
|
|
135
135
|
selection = editorView.state.selection;
|
|
136
136
|
_getPluginState = (0, _pluginFactory.getPluginState)(editorView.state), matches = _getPluginState.matches, decorationSet = _getPluginState.decorationSet;
|
|
137
137
|
if (!(matches.length === 0)) {
|
|
138
|
-
_context3.next =
|
|
138
|
+
_context3.next = 1;
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
141
|
return _context3.abrupt("return");
|
|
142
|
-
case
|
|
142
|
+
case 1:
|
|
143
143
|
matchesBetween = matches.filter(function (m) {
|
|
144
144
|
return m.start >= startPos && (endPos === undefined || m.start < endPos);
|
|
145
145
|
});
|
|
@@ -149,7 +149,7 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
149
149
|
selectionIndex = matchesBetween.findIndex(function (match) {
|
|
150
150
|
return match === selectionMatch;
|
|
151
151
|
});
|
|
152
|
-
_context3.next =
|
|
152
|
+
_context3.next = 2;
|
|
153
153
|
return this.batchRequests(function (counter) {
|
|
154
154
|
var matchesToDecorate = matchesBetween.slice(counter, counter + batchIncrement);
|
|
155
155
|
if (matchesToDecorate.length === 0) {
|
|
@@ -170,9 +170,9 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
170
170
|
increment: batchIncrement,
|
|
171
171
|
until: matchesBetween.length
|
|
172
172
|
});
|
|
173
|
-
case
|
|
173
|
+
case 2:
|
|
174
174
|
return _context3.abrupt("return", _context3.sent);
|
|
175
|
-
case
|
|
175
|
+
case 3:
|
|
176
176
|
case "end":
|
|
177
177
|
return _context3.stop();
|
|
178
178
|
}
|
|
@@ -189,18 +189,18 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
189
189
|
var _removeDecorationsBetween = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(editorView, startPos, endPos) {
|
|
190
190
|
var _this2 = this;
|
|
191
191
|
var _getPluginState2, decorationSet, decorations;
|
|
192
|
-
return _regenerator.default.wrap(function
|
|
192
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
193
193
|
while (1) switch (_context4.prev = _context4.next) {
|
|
194
194
|
case 0:
|
|
195
195
|
_getPluginState2 = (0, _pluginFactory.getPluginState)(editorView.state), decorationSet = _getPluginState2.decorationSet;
|
|
196
196
|
decorations = decorationSet.find(startPos, endPos);
|
|
197
197
|
if (!(decorations.length === 0)) {
|
|
198
|
-
_context4.next =
|
|
198
|
+
_context4.next = 1;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
return _context4.abrupt("return");
|
|
202
|
-
case
|
|
203
|
-
_context4.next =
|
|
202
|
+
case 1:
|
|
203
|
+
_context4.next = 2;
|
|
204
204
|
return this.batchRequests(function (counter) {
|
|
205
205
|
var decorationsToRemove = decorations.slice(counter, counter + batchIncrement);
|
|
206
206
|
if (decorationsToRemove.length === 0) {
|
|
@@ -220,9 +220,9 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
220
220
|
increment: batchIncrement,
|
|
221
221
|
until: decorations.length
|
|
222
222
|
});
|
|
223
|
-
case
|
|
223
|
+
case 2:
|
|
224
224
|
return _context4.abrupt("return", _context4.sent);
|
|
225
|
-
case
|
|
225
|
+
case 3:
|
|
226
226
|
case "end":
|
|
227
227
|
return _context4.stop();
|
|
228
228
|
}
|
|
@@ -34,56 +34,56 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
34
34
|
value: (function () {
|
|
35
35
|
var _applyAllSearchDecorations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(editorView, containerElement, addDecorations, removeDecorations) {
|
|
36
36
|
var pmElement, positions, startPos, endPos, viewportStartPos, viewportEndPos, dir, before, after, diff;
|
|
37
|
-
return _regeneratorRuntime.wrap(function
|
|
37
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
38
38
|
while (1) switch (_context.prev = _context.next) {
|
|
39
39
|
case 0:
|
|
40
40
|
this.stop();
|
|
41
41
|
this.addDecorations = addDecorations;
|
|
42
42
|
this.removeDecorations = removeDecorations;
|
|
43
43
|
if (containerElement) {
|
|
44
|
-
_context.next =
|
|
44
|
+
_context.next = 1;
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
47
|
return _context.abrupt("return");
|
|
48
|
-
case
|
|
48
|
+
case 1:
|
|
49
49
|
pmElement = containerElement.querySelector('.ProseMirror');
|
|
50
50
|
if (pmElement) {
|
|
51
|
-
_context.next =
|
|
51
|
+
_context.next = 2;
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
return _context.abrupt("return");
|
|
55
|
-
case
|
|
55
|
+
case 2:
|
|
56
56
|
positions = this.calcDecorationPositions(editorView, containerElement, pmElement);
|
|
57
57
|
startPos = positions.startPos, endPos = positions.endPos, viewportStartPos = positions.viewportStartPos, viewportEndPos = positions.viewportEndPos;
|
|
58
58
|
dir = 0;
|
|
59
59
|
before = viewportStartPos;
|
|
60
60
|
after = viewportEndPos - posIncrement;
|
|
61
|
-
_context.next =
|
|
61
|
+
_context.next = 3;
|
|
62
62
|
return this.updateDecorationsBetween(editorView, viewportStartPos, viewportEndPos);
|
|
63
|
-
case
|
|
63
|
+
case 3:
|
|
64
64
|
if (!(before > startPos || after < endPos)) {
|
|
65
|
-
_context.next =
|
|
65
|
+
_context.next = 7;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
if (!(dir++ % 2 === 0 && before > startPos || after >= endPos)) {
|
|
69
|
-
_context.next =
|
|
69
|
+
_context.next = 5;
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
diff = before - startPos;
|
|
73
73
|
before = Math.max(before - posIncrement, startPos);
|
|
74
|
-
_context.next =
|
|
74
|
+
_context.next = 4;
|
|
75
75
|
return this.updateDecorationsBetween(editorView, before, before + Math.min(diff, posIncrement));
|
|
76
|
-
case
|
|
77
|
-
_context.next =
|
|
76
|
+
case 4:
|
|
77
|
+
_context.next = 6;
|
|
78
78
|
break;
|
|
79
|
-
case
|
|
79
|
+
case 5:
|
|
80
80
|
after = Math.min(after + posIncrement, endPos);
|
|
81
|
-
_context.next =
|
|
81
|
+
_context.next = 6;
|
|
82
82
|
return this.updateDecorationsBetween(editorView, after, Math.min(after + posIncrement, endPos));
|
|
83
|
-
case
|
|
84
|
-
_context.next =
|
|
83
|
+
case 6:
|
|
84
|
+
_context.next = 3;
|
|
85
85
|
break;
|
|
86
|
-
case
|
|
86
|
+
case 7:
|
|
87
87
|
case "end":
|
|
88
88
|
return _context.stop();
|
|
89
89
|
}
|
|
@@ -98,15 +98,15 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
98
98
|
key: "updateDecorationsBetween",
|
|
99
99
|
value: function () {
|
|
100
100
|
var _updateDecorationsBetween = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(editorView, startPos, endPos) {
|
|
101
|
-
return _regeneratorRuntime.wrap(function
|
|
101
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
102
102
|
while (1) switch (_context2.prev = _context2.next) {
|
|
103
103
|
case 0:
|
|
104
|
-
_context2.next =
|
|
104
|
+
_context2.next = 1;
|
|
105
105
|
return this.removeDecorationsBetween(editorView, startPos, endPos);
|
|
106
|
-
case
|
|
107
|
-
_context2.next =
|
|
106
|
+
case 1:
|
|
107
|
+
_context2.next = 2;
|
|
108
108
|
return this.addDecorationsBetween(editorView, startPos, endPos);
|
|
109
|
-
case
|
|
109
|
+
case 2:
|
|
110
110
|
case "end":
|
|
111
111
|
return _context2.stop();
|
|
112
112
|
}
|
|
@@ -123,17 +123,17 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
123
123
|
var _addDecorationsBetween = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(editorView, startPos, endPos) {
|
|
124
124
|
var _this = this;
|
|
125
125
|
var selection, _getPluginState, matches, decorationSet, matchesBetween, selectionMatch, selectionIndex;
|
|
126
|
-
return _regeneratorRuntime.wrap(function
|
|
126
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
127
127
|
while (1) switch (_context3.prev = _context3.next) {
|
|
128
128
|
case 0:
|
|
129
129
|
selection = editorView.state.selection;
|
|
130
130
|
_getPluginState = getPluginState(editorView.state), matches = _getPluginState.matches, decorationSet = _getPluginState.decorationSet;
|
|
131
131
|
if (!(matches.length === 0)) {
|
|
132
|
-
_context3.next =
|
|
132
|
+
_context3.next = 1;
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
135
|
return _context3.abrupt("return");
|
|
136
|
-
case
|
|
136
|
+
case 1:
|
|
137
137
|
matchesBetween = matches.filter(function (m) {
|
|
138
138
|
return m.start >= startPos && (endPos === undefined || m.start < endPos);
|
|
139
139
|
});
|
|
@@ -143,7 +143,7 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
143
143
|
selectionIndex = matchesBetween.findIndex(function (match) {
|
|
144
144
|
return match === selectionMatch;
|
|
145
145
|
});
|
|
146
|
-
_context3.next =
|
|
146
|
+
_context3.next = 2;
|
|
147
147
|
return this.batchRequests(function (counter) {
|
|
148
148
|
var matchesToDecorate = matchesBetween.slice(counter, counter + batchIncrement);
|
|
149
149
|
if (matchesToDecorate.length === 0) {
|
|
@@ -164,9 +164,9 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
164
164
|
increment: batchIncrement,
|
|
165
165
|
until: matchesBetween.length
|
|
166
166
|
});
|
|
167
|
-
case
|
|
167
|
+
case 2:
|
|
168
168
|
return _context3.abrupt("return", _context3.sent);
|
|
169
|
-
case
|
|
169
|
+
case 3:
|
|
170
170
|
case "end":
|
|
171
171
|
return _context3.stop();
|
|
172
172
|
}
|
|
@@ -183,18 +183,18 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
183
183
|
var _removeDecorationsBetween = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(editorView, startPos, endPos) {
|
|
184
184
|
var _this2 = this;
|
|
185
185
|
var _getPluginState2, decorationSet, decorations;
|
|
186
|
-
return _regeneratorRuntime.wrap(function
|
|
186
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
187
187
|
while (1) switch (_context4.prev = _context4.next) {
|
|
188
188
|
case 0:
|
|
189
189
|
_getPluginState2 = getPluginState(editorView.state), decorationSet = _getPluginState2.decorationSet;
|
|
190
190
|
decorations = decorationSet.find(startPos, endPos);
|
|
191
191
|
if (!(decorations.length === 0)) {
|
|
192
|
-
_context4.next =
|
|
192
|
+
_context4.next = 1;
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
return _context4.abrupt("return");
|
|
196
|
-
case
|
|
197
|
-
_context4.next =
|
|
196
|
+
case 1:
|
|
197
|
+
_context4.next = 2;
|
|
198
198
|
return this.batchRequests(function (counter) {
|
|
199
199
|
var decorationsToRemove = decorations.slice(counter, counter + batchIncrement);
|
|
200
200
|
if (decorationsToRemove.length === 0) {
|
|
@@ -214,9 +214,9 @@ var BatchDecorations = /*#__PURE__*/function () {
|
|
|
214
214
|
increment: batchIncrement,
|
|
215
215
|
until: decorations.length
|
|
216
216
|
});
|
|
217
|
-
case
|
|
217
|
+
case 2:
|
|
218
218
|
return _context4.abrupt("return", _context4.sent);
|
|
219
|
-
case
|
|
219
|
+
case 3:
|
|
220
220
|
case "end":
|
|
221
221
|
return _context4.stop();
|
|
222
222
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.9",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/button": "^23.11.0",
|
|
32
32
|
"@atlaskit/editor-plugin-analytics": "^10.1.0",
|
|
33
|
-
"@atlaskit/editor-plugin-card": "^16.
|
|
33
|
+
"@atlaskit/editor-plugin-card": "^16.11.0",
|
|
34
34
|
"@atlaskit/editor-plugin-expand": "^11.2.0",
|
|
35
|
-
"@atlaskit/editor-plugin-mentions": "^12.
|
|
35
|
+
"@atlaskit/editor-plugin-mentions": "^12.3.0",
|
|
36
36
|
"@atlaskit/editor-plugin-primary-toolbar": "^11.1.0",
|
|
37
|
-
"@atlaskit/editor-plugin-synced-block": "^8.
|
|
37
|
+
"@atlaskit/editor-plugin-synced-block": "^8.5.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^3.11.0",
|
|
40
40
|
"@atlaskit/form": "^15.5.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/primitives": "^19.0.0",
|
|
46
46
|
"@atlaskit/textfield": "^8.3.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
48
|
-
"@atlaskit/tokens": "^13.
|
|
49
|
-
"@atlaskit/tooltip": "^22.
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^86.0.0",
|
|
48
|
+
"@atlaskit/tokens": "^13.1.0",
|
|
49
|
+
"@atlaskit/tooltip": "^22.5.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1",
|
|
52
52
|
"classnames": "^2.2.5",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-intl": "^6.6.2"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@atlaskit/editor-common": "^114.
|
|
66
|
+
"@atlaskit/editor-common": "^114.54.0",
|
|
67
67
|
"react": "^18.2.0",
|
|
68
68
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
69
69
|
},
|