@atlaskit/editor-plugin-find-replace 29.0.2 → 29.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,15 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 29.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f268dee2526f7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f268dee2526f7) -
8
+ Migrate Smart Card registration and removal from transactions to editor actions behind
9
+ `platform_editor_reduce_forced_layout_2`. Remove unused card overlay registration behind
10
+ `platform_editor_reduce_forced_layout_2`.
11
+ - Updated dependencies
12
+
3
13
  ## 29.0.2
4
14
 
5
15
  ### Patch Changes
@@ -21,6 +21,7 @@ var _view = require("@atlaskit/editor-prosemirror/view");
21
21
  var _isPromise = require("@atlaskit/mention/is-promise");
22
22
  var _isResolvingMentionProvider = require("@atlaskit/mention/is-resolving-mention-provider");
23
23
  var _types = require("@atlaskit/mention/types");
24
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
24
25
  var _getGlobalTheme2 = require("@atlaskit/tokens/get-global-theme");
25
26
  var _styles = require("../../ui/styles");
26
27
  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; } } }; }
@@ -170,8 +171,10 @@ function findMatches(_ref2) {
170
171
  }
171
172
  };
172
173
  var collectCardTitleMatch = function collectCardTitleMatch(node, pos) {
173
- var _api$card;
174
- var cards = api === null || api === void 0 || (_api$card = api.card) === null || _api$card === void 0 || (_api$card = _api$card.sharedState.currentState()) === null || _api$card === void 0 ? void 0 : _api$card.cards;
174
+ var _api$card$actions$get, _api$card, _api$card$getCardRegi, _api$card2;
175
+ var cards = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_forced_layout_2') ? Object.values((_api$card$actions$get = api === null || api === void 0 || (_api$card = api.card) === null || _api$card === void 0 || (_api$card = _api$card.actions) === null || _api$card === void 0 || (_api$card$getCardRegi = _api$card.getCardRegistrations) === null || _api$card$getCardRegi === void 0 ? void 0 : _api$card$getCardRegi.call(_api$card)) !== null && _api$card$actions$get !== void 0 ? _api$card$actions$get : {}).filter(function (card) {
176
+ return card.getPos() !== undefined;
177
+ }) : api === null || api === void 0 || (_api$card2 = api.card) === null || _api$card2 === void 0 || (_api$card2 = _api$card2.sharedState.currentState()) === null || _api$card2 === void 0 ? void 0 : _api$card2.cards;
175
178
  if (cards) {
176
179
  var relevantCard = cards.find(function (card) {
177
180
  return card.url === node.attrs.url;
@@ -5,6 +5,7 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
5
  import { isPromise } from '@atlaskit/mention/is-promise';
6
6
  import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
7
7
  import { MentionNameStatus } from '@atlaskit/mention/types';
8
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
9
  import { getGlobalTheme } from '@atlaskit/tokens/get-global-theme';
9
10
  import { selectedSearchMatchClass, blockSearchMatchClass, darkModeSearchMatchClass, selectedBlockSearchMatchClass, searchMatchExpandTitleClass, searchMatchTextClass } from '../../ui/styles';
10
11
 
@@ -156,8 +157,8 @@ export function findMatches({
156
157
  }
157
158
  };
158
159
  const collectCardTitleMatch = (node, pos) => {
159
- var _api$card, _api$card$sharedState;
160
- const cards = api === null || api === void 0 ? void 0 : (_api$card = api.card) === null || _api$card === void 0 ? void 0 : (_api$card$sharedState = _api$card.sharedState.currentState()) === null || _api$card$sharedState === void 0 ? void 0 : _api$card$sharedState.cards;
160
+ var _api$card$actions$get, _api$card, _api$card$actions, _api$card$actions$get2, _api$card2, _api$card2$sharedStat;
161
+ const cards = isExperimentEnabled('platform_editor_reduce_forced_layout_2') ? Object.values((_api$card$actions$get = api === null || api === void 0 ? void 0 : (_api$card = api.card) === null || _api$card === void 0 ? void 0 : (_api$card$actions = _api$card.actions) === null || _api$card$actions === void 0 ? void 0 : (_api$card$actions$get2 = _api$card$actions.getCardRegistrations) === null || _api$card$actions$get2 === void 0 ? void 0 : _api$card$actions$get2.call(_api$card$actions)) !== null && _api$card$actions$get !== void 0 ? _api$card$actions$get : {}).filter(card => card.getPos() !== undefined) : api === null || api === void 0 ? void 0 : (_api$card2 = api.card) === null || _api$card2 === void 0 ? void 0 : (_api$card2$sharedStat = _api$card2.sharedState.currentState()) === null || _api$card2$sharedStat === void 0 ? void 0 : _api$card2$sharedStat.cards;
161
162
  if (cards) {
162
163
  const relevantCard = cards.find(card => card.url === node.attrs.url);
163
164
  const title = relevantCard === null || relevantCard === void 0 ? void 0 : relevantCard.title;
@@ -9,6 +9,7 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
9
9
  import { isPromise } from '@atlaskit/mention/is-promise';
10
10
  import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
11
11
  import { MentionNameStatus } from '@atlaskit/mention/types';
12
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
12
13
  import { getGlobalTheme } from '@atlaskit/tokens/get-global-theme';
13
14
  import { selectedSearchMatchClass, blockSearchMatchClass, darkModeSearchMatchClass, selectedBlockSearchMatchClass, searchMatchExpandTitleClass, searchMatchTextClass } from '../../ui/styles';
14
15
 
@@ -156,8 +157,10 @@ export function findMatches(_ref2) {
156
157
  }
157
158
  };
158
159
  var collectCardTitleMatch = function collectCardTitleMatch(node, pos) {
159
- var _api$card;
160
- var cards = api === null || api === void 0 || (_api$card = api.card) === null || _api$card === void 0 || (_api$card = _api$card.sharedState.currentState()) === null || _api$card === void 0 ? void 0 : _api$card.cards;
160
+ var _api$card$actions$get, _api$card, _api$card$getCardRegi, _api$card2;
161
+ var cards = isExperimentEnabled('platform_editor_reduce_forced_layout_2') ? Object.values((_api$card$actions$get = api === null || api === void 0 || (_api$card = api.card) === null || _api$card === void 0 || (_api$card = _api$card.actions) === null || _api$card === void 0 || (_api$card$getCardRegi = _api$card.getCardRegistrations) === null || _api$card$getCardRegi === void 0 ? void 0 : _api$card$getCardRegi.call(_api$card)) !== null && _api$card$actions$get !== void 0 ? _api$card$actions$get : {}).filter(function (card) {
162
+ return card.getPos() !== undefined;
163
+ }) : api === null || api === void 0 || (_api$card2 = api.card) === null || _api$card2 === void 0 || (_api$card2 = _api$card2.sharedState.currentState()) === null || _api$card2 === void 0 ? void 0 : _api$card2.cards;
161
164
  if (cards) {
162
165
  var relevantCard = cards.find(function (card) {
163
166
  return card.url === node.attrs.url;
@@ -23,7 +23,7 @@ type SimpleADFNode = {
23
23
  export declare function extractTextFromADFContent(nodes: SimpleADFNode[]): string;
24
24
  export declare function getSelectedText(selection: TextSelection): string;
25
25
  export declare const createDecorations: (selectedIndex: number, matches: Match[]) => Decoration[];
26
- export declare const createDecoration: (match: Match, isSelected?: Boolean) => Decoration;
26
+ export declare const createDecoration: (match: Match, isSelected?: boolean) => Decoration;
27
27
  type FindMatchesType = {
28
28
  api?: ExtractInjectionAPI<FindReplacePlugin>;
29
29
  content: PmNode | Fragment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "29.0.2",
3
+ "version": "29.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,17 +20,17 @@
20
20
  ],
21
21
  "atlaskit:src": "src/index.ts",
22
22
  "dependencies": {
23
- "@atlaskit/button": "^25.5.0",
23
+ "@atlaskit/button": "^25.6.0",
24
24
  "@atlaskit/editor-plugin-analytics": "^29.0.0",
25
25
  "@atlaskit/editor-plugin-block-collapse": "^15.0.0",
26
- "@atlaskit/editor-plugin-card": "^35.0.0",
26
+ "@atlaskit/editor-plugin-card": "^35.1.0",
27
27
  "@atlaskit/editor-plugin-editor-viewmode": "^31.0.0",
28
28
  "@atlaskit/editor-plugin-expand": "^30.0.0",
29
29
  "@atlaskit/editor-plugin-mentions": "^31.0.0",
30
30
  "@atlaskit/editor-plugin-primary-toolbar": "^30.0.0",
31
31
  "@atlaskit/editor-plugin-synced-block": "^27.0.0",
32
32
  "@atlaskit/editor-prosemirror": "^9.0.0",
33
- "@atlaskit/editor-shared-styles": "^4.5.0",
33
+ "@atlaskit/editor-shared-styles": "^4.6.0",
34
34
  "@atlaskit/form": "^18.2.0",
35
35
  "@atlaskit/icon": "^38.0.0",
36
36
  "@atlaskit/icon-lab": "^7.11.0",
@@ -60,7 +60,7 @@
60
60
  "react-intl": "^7.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^133.1.0",
63
+ "@atlaskit/editor-common": "^133.4.0",
64
64
  "react": "^18.2.0 || ^19.2.0",
65
65
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
66
66
  }