@atlaskit/editor-plugin-find-replace 15.0.0 → 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 +30 -0
- package/dist/cjs/pm-plugins/utils/index.js +12 -15
- package/dist/cjs/ui/Replace.js +1 -4
- package/dist/es2019/pm-plugins/utils/index.js +12 -15
- package/dist/es2019/ui/Replace.js +1 -5
- package/dist/esm/pm-plugins/utils/index.js +12 -15
- package/dist/esm/ui/Replace.js +1 -5
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
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
|
+
|
|
27
|
+
## 15.0.1
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 15.0.0
|
|
4
34
|
|
|
5
35
|
### 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;
|
package/dist/cjs/ui/Replace.js
CHANGED
|
@@ -21,7 +21,6 @@ var _FindReplaceTooltipButton = require("./FindReplaceTooltipButton");
|
|
|
21
21
|
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); }
|
|
22
22
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
23
23
|
|
|
24
|
-
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
25
24
|
var SPACE_REGEX = / /;
|
|
26
25
|
var replaceContainerStyles = (0, _primitives.xcss)({
|
|
27
26
|
padding: 'space.100'
|
|
@@ -218,9 +217,7 @@ var Replace = function Replace(_ref) {
|
|
|
218
217
|
ref: successReplacementMessageRef
|
|
219
218
|
}, /*#__PURE__*/_react.default.createElement(_form.ValidMessage, {
|
|
220
219
|
testId: "message-success-replacement"
|
|
221
|
-
}, fakeSuccessReplacementMessageUpdate ?
|
|
222
|
-
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
223
|
-
resultsReplace.replace(SPACE_REGEX, "\xA0") : resultsReplace)), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
220
|
+
}, fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(SPACE_REGEX, "\xA0") : resultsReplace)), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
224
221
|
xcss: actionButtonContainerStyles
|
|
225
222
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
226
223
|
xcss: actionButtonParentInlineStyles
|
|
@@ -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;
|
|
@@ -10,8 +10,6 @@ import ChevronUpIcon from '@atlaskit/icon/core/chevron-up';
|
|
|
10
10
|
import { Box, Inline, Text, xcss } from '@atlaskit/primitives';
|
|
11
11
|
import Textfield from '@atlaskit/textfield';
|
|
12
12
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
13
|
-
|
|
14
|
-
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
15
13
|
const SPACE_REGEX = / /u;
|
|
16
14
|
const replaceContainerStyles = xcss({
|
|
17
15
|
padding: 'space.100'
|
|
@@ -188,9 +186,7 @@ const Replace = ({
|
|
|
188
186
|
ref: successReplacementMessageRef
|
|
189
187
|
}, /*#__PURE__*/React.createElement(ValidMessage, {
|
|
190
188
|
testId: "message-success-replacement"
|
|
191
|
-
}, fakeSuccessReplacementMessageUpdate ?
|
|
192
|
-
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
193
|
-
resultsReplace.replace(SPACE_REGEX, '\u00a0') : resultsReplace)), /*#__PURE__*/React.createElement(Box, {
|
|
189
|
+
}, fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(SPACE_REGEX, '\u00a0') : resultsReplace)), /*#__PURE__*/React.createElement(Box, {
|
|
194
190
|
xcss: actionButtonContainerStyles
|
|
195
191
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
196
192
|
xcss: actionButtonParentInlineStyles
|
|
@@ -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/dist/esm/ui/Replace.js
CHANGED
|
@@ -11,8 +11,6 @@ import ChevronUpIcon from '@atlaskit/icon/core/chevron-up';
|
|
|
11
11
|
import { Box, Inline, Text, xcss } from '@atlaskit/primitives';
|
|
12
12
|
import Textfield from '@atlaskit/textfield';
|
|
13
13
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
14
|
-
|
|
15
|
-
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
16
14
|
var SPACE_REGEX = / /;
|
|
17
15
|
var replaceContainerStyles = xcss({
|
|
18
16
|
padding: 'space.100'
|
|
@@ -209,9 +207,7 @@ var Replace = function Replace(_ref) {
|
|
|
209
207
|
ref: successReplacementMessageRef
|
|
210
208
|
}, /*#__PURE__*/React.createElement(ValidMessage, {
|
|
211
209
|
testId: "message-success-replacement"
|
|
212
|
-
}, fakeSuccessReplacementMessageUpdate ?
|
|
213
|
-
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
214
|
-
resultsReplace.replace(SPACE_REGEX, "\xA0") : resultsReplace)), /*#__PURE__*/React.createElement(Box, {
|
|
210
|
+
}, fakeSuccessReplacementMessageUpdate ? resultsReplace.replace(SPACE_REGEX, "\xA0") : resultsReplace)), /*#__PURE__*/React.createElement(Box, {
|
|
215
211
|
xcss: actionButtonContainerStyles
|
|
216
212
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
217
213
|
xcss: actionButtonParentInlineStyles
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@atlaskit/editor-plugin-analytics": "^15.0.0",
|
|
25
25
|
"@atlaskit/editor-plugin-card": "^21.0.0",
|
|
26
26
|
"@atlaskit/editor-plugin-expand": "^16.0.0",
|
|
27
|
-
"@atlaskit/editor-plugin-mentions": "^17.
|
|
27
|
+
"@atlaskit/editor-plugin-mentions": "^17.1.0",
|
|
28
28
|
"@atlaskit/editor-plugin-primary-toolbar": "^16.0.0",
|
|
29
29
|
"@atlaskit/editor-plugin-synced-block": "^13.0.0",
|
|
30
30
|
"@atlaskit/editor-prosemirror": "^8.0.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
|
},
|