@atlaskit/editor-plugin-find-replace 15.0.1 → 15.0.2
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,29 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-find-replace
|
|
2
2
|
|
|
3
|
+
## 15.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`76e9f6152bf16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76e9f6152bf16) -
|
|
8
|
+
Enable launched synced block integrations and remove obsolete experiment scaffolding.
|
|
9
|
+
|
|
10
|
+
BREAKING: `@atlaskit/tmp-editor-statsig` no longer defines the `platform_synced_block` editor
|
|
11
|
+
experiment. Consumers that use `editorExperiment('platform_synced_block', ...)` to conditionally
|
|
12
|
+
enable synced-block integrations will no longer be able to look up that experiment; synced-block
|
|
13
|
+
integrations are now enabled by default. Remove each lookup and its conditional branch:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// Before
|
|
17
|
+
if (editorExperiment('platform_synced_block', true)) {
|
|
18
|
+
enableSyncedBlocks();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// After
|
|
22
|
+
enableSyncedBlocks();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 15.0.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -20,7 +20,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
20
20
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
21
21
|
var _resource = require("@atlaskit/mention/resource");
|
|
22
22
|
var _types = require("@atlaskit/mention/types");
|
|
23
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
24
23
|
var _getGlobalTheme2 = require("@atlaskit/tokens/get-global-theme");
|
|
25
24
|
var _styles = require("../../ui/styles");
|
|
26
25
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
@@ -83,7 +82,7 @@ var createDecorations = exports.createDecorations = function createDecorations(s
|
|
|
83
82
|
});
|
|
84
83
|
};
|
|
85
84
|
var isElement = function isElement(nodeType) {
|
|
86
|
-
return ['blockCard', 'embedCard', 'inlineCard', 'status', 'mention', 'date'].includes(nodeType || '')
|
|
85
|
+
return ['blockCard', 'embedCard', 'inlineCard', 'status', 'mention', 'date', 'syncBlock'].includes(nodeType || '');
|
|
87
86
|
};
|
|
88
87
|
var isExpandTitle = function isExpandTitle(match) {
|
|
89
88
|
return ['expand', 'nestedExpand'].includes(match.nodeType || '') && !match.canReplace;
|
|
@@ -266,19 +265,17 @@ function findMatches(_ref2) {
|
|
|
266
265
|
break;
|
|
267
266
|
case 'syncBlock':
|
|
268
267
|
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}, node);
|
|
281
|
-
}
|
|
268
|
+
var _api$syncedBlock, _instance$data;
|
|
269
|
+
var syncBlockStore = api === null || api === void 0 || (_api$syncedBlock = api.syncedBlock) === null || _api$syncedBlock === void 0 || (_api$syncedBlock = _api$syncedBlock.sharedState.currentState()) === null || _api$syncedBlock === void 0 ? void 0 : _api$syncedBlock.syncBlockStore;
|
|
270
|
+
var instance = syncBlockStore === null || syncBlockStore === void 0 ? void 0 : syncBlockStore.referenceManager.getFromCache(node.attrs.resourceId);
|
|
271
|
+
var adfContent = instance === null || instance === void 0 || (_instance$data = instance.data) === null || _instance$data === void 0 ? void 0 : _instance$data.content;
|
|
272
|
+
if (adfContent && adfContent.length > 0) {
|
|
273
|
+
var _text = extractTextFromADFContent(adfContent);
|
|
274
|
+
if (_text) {
|
|
275
|
+
collectNodeMatch({
|
|
276
|
+
text: _text,
|
|
277
|
+
pos: pos
|
|
278
|
+
}, node);
|
|
282
279
|
}
|
|
283
280
|
}
|
|
284
281
|
break;
|
|
@@ -4,7 +4,6 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
4
4
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
|
|
6
6
|
import { isPromise, MentionNameStatus } from '@atlaskit/mention/types';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { getGlobalTheme } from '@atlaskit/tokens/get-global-theme';
|
|
9
8
|
import { selectedSearchMatchClass, blockSearchMatchClass, darkModeSearchMatchClass, selectedBlockSearchMatchClass, searchMatchExpandTitleClass, searchMatchTextClass } from '../../ui/styles';
|
|
10
9
|
|
|
@@ -52,7 +51,7 @@ export const createDecorations = (selectedIndex, matches) => matches.map(({
|
|
|
52
51
|
canReplace,
|
|
53
52
|
nodeType
|
|
54
53
|
}, i === selectedIndex));
|
|
55
|
-
const isElement = nodeType => ['blockCard', 'embedCard', 'inlineCard', 'status', 'mention', 'date'].includes(nodeType || '')
|
|
54
|
+
const isElement = nodeType => ['blockCard', 'embedCard', 'inlineCard', 'status', 'mention', 'date', 'syncBlock'].includes(nodeType || '');
|
|
56
55
|
const isExpandTitle = match => ['expand', 'nestedExpand'].includes(match.nodeType || '') && !match.canReplace;
|
|
57
56
|
export const createDecoration = (match, isSelected) => {
|
|
58
57
|
const {
|
|
@@ -250,19 +249,17 @@ export function findMatches({
|
|
|
250
249
|
break;
|
|
251
250
|
case 'syncBlock':
|
|
252
251
|
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}, node);
|
|
265
|
-
}
|
|
252
|
+
var _api$syncedBlock, _api$syncedBlock$shar, _instance$data;
|
|
253
|
+
const syncBlockStore = api === null || api === void 0 ? void 0 : (_api$syncedBlock = api.syncedBlock) === null || _api$syncedBlock === void 0 ? void 0 : (_api$syncedBlock$shar = _api$syncedBlock.sharedState.currentState()) === null || _api$syncedBlock$shar === void 0 ? void 0 : _api$syncedBlock$shar.syncBlockStore;
|
|
254
|
+
const instance = syncBlockStore === null || syncBlockStore === void 0 ? void 0 : syncBlockStore.referenceManager.getFromCache(node.attrs.resourceId);
|
|
255
|
+
const adfContent = instance === null || instance === void 0 ? void 0 : (_instance$data = instance.data) === null || _instance$data === void 0 ? void 0 : _instance$data.content;
|
|
256
|
+
if (adfContent && adfContent.length > 0) {
|
|
257
|
+
const text = extractTextFromADFContent(adfContent);
|
|
258
|
+
if (text) {
|
|
259
|
+
collectNodeMatch({
|
|
260
|
+
text,
|
|
261
|
+
pos
|
|
262
|
+
}, node);
|
|
266
263
|
}
|
|
267
264
|
}
|
|
268
265
|
break;
|
|
@@ -8,7 +8,6 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
8
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
|
|
10
10
|
import { isPromise, MentionNameStatus } from '@atlaskit/mention/types';
|
|
11
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
11
|
import { getGlobalTheme } from '@atlaskit/tokens/get-global-theme';
|
|
13
12
|
import { selectedSearchMatchClass, blockSearchMatchClass, darkModeSearchMatchClass, selectedBlockSearchMatchClass, searchMatchExpandTitleClass, searchMatchTextClass } from '../../ui/styles';
|
|
14
13
|
|
|
@@ -69,7 +68,7 @@ export var createDecorations = function createDecorations(selectedIndex, matches
|
|
|
69
68
|
});
|
|
70
69
|
};
|
|
71
70
|
var isElement = function isElement(nodeType) {
|
|
72
|
-
return ['blockCard', 'embedCard', 'inlineCard', 'status', 'mention', 'date'].includes(nodeType || '')
|
|
71
|
+
return ['blockCard', 'embedCard', 'inlineCard', 'status', 'mention', 'date', 'syncBlock'].includes(nodeType || '');
|
|
73
72
|
};
|
|
74
73
|
var isExpandTitle = function isExpandTitle(match) {
|
|
75
74
|
return ['expand', 'nestedExpand'].includes(match.nodeType || '') && !match.canReplace;
|
|
@@ -252,19 +251,17 @@ export function findMatches(_ref2) {
|
|
|
252
251
|
break;
|
|
253
252
|
case 'syncBlock':
|
|
254
253
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}, node);
|
|
267
|
-
}
|
|
254
|
+
var _api$syncedBlock, _instance$data;
|
|
255
|
+
var syncBlockStore = api === null || api === void 0 || (_api$syncedBlock = api.syncedBlock) === null || _api$syncedBlock === void 0 || (_api$syncedBlock = _api$syncedBlock.sharedState.currentState()) === null || _api$syncedBlock === void 0 ? void 0 : _api$syncedBlock.syncBlockStore;
|
|
256
|
+
var instance = syncBlockStore === null || syncBlockStore === void 0 ? void 0 : syncBlockStore.referenceManager.getFromCache(node.attrs.resourceId);
|
|
257
|
+
var adfContent = instance === null || instance === void 0 || (_instance$data = instance.data) === null || _instance$data === void 0 ? void 0 : _instance$data.content;
|
|
258
|
+
if (adfContent && adfContent.length > 0) {
|
|
259
|
+
var _text = extractTextFromADFContent(adfContent);
|
|
260
|
+
if (_text) {
|
|
261
|
+
collectNodeMatch({
|
|
262
|
+
text: _text,
|
|
263
|
+
pos: pos
|
|
264
|
+
}, node);
|
|
268
265
|
}
|
|
269
266
|
}
|
|
270
267
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@atlaskit/form": "^17.0.0",
|
|
33
33
|
"@atlaskit/icon": "^37.3.0",
|
|
34
34
|
"@atlaskit/icon-lab": "^7.5.0",
|
|
35
|
-
"@atlaskit/mention": "^27.
|
|
35
|
+
"@atlaskit/mention": "^27.18.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
37
37
|
"@atlaskit/primitives": "^22.2.0",
|
|
38
38
|
"@atlaskit/textfield": "^10.0.0",
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^149.0.0",
|
|
40
40
|
"@atlaskit/tokens": "^16.7.0",
|
|
41
41
|
"@atlaskit/tooltip": "^24.0.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react-intl": "^7.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^119.
|
|
58
|
+
"@atlaskit/editor-common": "^119.7.0",
|
|
59
59
|
"react": "^18.2.0 || ^19.2.0",
|
|
60
60
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
61
61
|
},
|