@atlaskit/editor-plugin-find-replace 15.0.1 → 15.0.3

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,35 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 15.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 15.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`76e9f6152bf16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76e9f6152bf16) -
14
+ Enable launched synced block integrations and remove obsolete experiment scaffolding.
15
+
16
+ BREAKING: `@atlaskit/tmp-editor-statsig` no longer defines the `platform_synced_block` editor
17
+ experiment. Consumers that use `editorExperiment('platform_synced_block', ...)` to conditionally
18
+ enable synced-block integrations will no longer be able to look up that experiment; synced-block
19
+ integrations are now enabled by default. Remove each lookup and its conditional branch:
20
+
21
+ ```ts
22
+ // Before
23
+ if (editorExperiment('platform_synced_block', true)) {
24
+ enableSyncedBlocks();
25
+ }
26
+
27
+ // After
28
+ enableSyncedBlocks();
29
+ ```
30
+
31
+ - Updated dependencies
32
+
3
33
  ## 15.0.1
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 || '') || nodeType === 'syncBlock' && (0, _experiments.editorExperiment)('platform_synced_block', true);
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
- if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
270
- var _api$syncedBlock, _instance$data;
271
- 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;
272
- var instance = syncBlockStore === null || syncBlockStore === void 0 ? void 0 : syncBlockStore.referenceManager.getFromCache(node.attrs.resourceId);
273
- var adfContent = instance === null || instance === void 0 || (_instance$data = instance.data) === null || _instance$data === void 0 ? void 0 : _instance$data.content;
274
- if (adfContent && adfContent.length > 0) {
275
- var _text = extractTextFromADFContent(adfContent);
276
- if (_text) {
277
- collectNodeMatch({
278
- text: _text,
279
- pos: pos
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 || '') || nodeType === 'syncBlock' && editorExperiment('platform_synced_block', true);
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
- if (editorExperiment('platform_synced_block', true)) {
254
- var _api$syncedBlock, _api$syncedBlock$shar, _instance$data;
255
- 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;
256
- const instance = syncBlockStore === null || syncBlockStore === void 0 ? void 0 : syncBlockStore.referenceManager.getFromCache(node.attrs.resourceId);
257
- const adfContent = instance === null || instance === void 0 ? void 0 : (_instance$data = instance.data) === null || _instance$data === void 0 ? void 0 : _instance$data.content;
258
- if (adfContent && adfContent.length > 0) {
259
- const text = extractTextFromADFContent(adfContent);
260
- if (text) {
261
- collectNodeMatch({
262
- text,
263
- pos
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 || '') || nodeType === 'syncBlock' && editorExperiment('platform_synced_block', true);
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
- if (editorExperiment('platform_synced_block', true)) {
256
- var _api$syncedBlock, _instance$data;
257
- 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;
258
- var instance = syncBlockStore === null || syncBlockStore === void 0 ? void 0 : syncBlockStore.referenceManager.getFromCache(node.attrs.resourceId);
259
- var adfContent = instance === null || instance === void 0 || (_instance$data = instance.data) === null || _instance$data === void 0 ? void 0 : _instance$data.content;
260
- if (adfContent && adfContent.length > 0) {
261
- var _text = extractTextFromADFContent(adfContent);
262
- if (_text) {
263
- collectNodeMatch({
264
- text: _text,
265
- pos: pos
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.1",
3
+ "version": "15.0.3",
4
4
  "description": "find replace plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "atlaskit:src": "src/index.ts",
22
22
  "dependencies": {
23
- "@atlaskit/button": "^25.0.0",
23
+ "@atlaskit/button": "^25.1.0",
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",
@@ -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.17.0",
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": "^148.0.0",
39
+ "@atlaskit/tmp-editor-statsig": "^150.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.5.0",
58
+ "@atlaskit/editor-common": "^119.9.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
  },