@atlaskit/editor-plugin-find-replace 2.10.3 → 2.10.4

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,16 @@
1
1
  # @atlaskit/editor-plugin-find-replace
2
2
 
3
+ ## 2.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#178241](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/178241)
8
+ [`fcdd6e779f749`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fcdd6e779f749) -
9
+ [ux] [ED-28381] use node selection for matches in the expand title to prevent bugs with findNext
10
+ and findPrevious and fix scrolling to matches in the platform_editor_find_and_replace_improvements
11
+ experience
12
+ - Updated dependencies
13
+
3
14
  ## 2.10.3
4
15
 
5
16
  ### Patch Changes
@@ -277,8 +277,7 @@ var getSelectionForMatch = exports.getSelectionForMatch = function getSelectionF
277
277
  var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
278
278
  if (matches[index]) {
279
279
  if (isExpandTitle(matches[index])) {
280
- // create a text selection at the first position inside the expand body
281
- return _state.TextSelection.create(doc, matches[index].start + offset - 2);
280
+ return _state.NodeSelection.create(doc, matches[index].start);
282
281
  }
283
282
  return _state.TextSelection.create(doc, matches[index].start + offset);
284
283
  }
@@ -36,18 +36,22 @@ var findReplaceStyles = exports.findReplaceStyles = (0, _react.css)((0, _defineP
36
36
  var findReplaceStylesNew = exports.findReplaceStylesNew = (0, _react.css)((_css2 = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_css2, ".".concat(searchMatchTextClass), {
37
37
  borderRadius: "var(--ds-space-050, 4px)",
38
38
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-subtler-pressed, #E2B203)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-subtler, #F8E6A0)", "\n\t\t"),
39
- backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
39
+ // TODO: ED-28376 - clean up !important later
40
+ backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)".concat(" !important"),
40
41
  color: "var(--ds-text, #172B4D)"
41
42
  }), ".".concat(searchMatchTextClass, ".").concat(selectedSearchMatchClass), {
42
43
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-subtler-pressed, #E2B203)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)", "\n\t\t"),
43
- backgroundColor: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)"
44
+ // TODO: ED-28376 - clean up !important later
45
+ backgroundColor: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)".concat(" !important")
44
46
  }), ".".concat(searchMatchTextClass, ".").concat(darkModeSearchMatchClass), {
45
47
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-bolder, #946F00)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-bolder-pressed, #533F04)", "\n\t\t"),
46
- backgroundColor: "var(--ds-background-accent-yellow-bolder-pressed, #533F04)",
48
+ // TODO: ED-28376 - clean up !important later
49
+ backgroundColor: "var(--ds-background-accent-yellow-bolder-pressed, #533F04)".concat(" !important"),
47
50
  color: "var(--ds-text-inverse, #FFFFFF)"
48
51
  }), ".".concat(searchMatchTextClass, ".").concat(selectedSearchMatchClass, ".").concat(darkModeSearchMatchClass), {
49
52
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-bolder, #946F00)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)", "\n\t\t"),
50
- backgroundColor: "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)"
53
+ // TODO: ED-28376 - clean up !important later
54
+ backgroundColor: "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)".concat(" !important")
51
55
  }), ".".concat(blockSearchMatchClass), (0, _defineProperty2.default)({
52
56
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
53
57
  '[data-smart-link-container="true"], .loader-wrapper>div::after': {
@@ -1,6 +1,6 @@
1
1
  import classnames from 'classnames';
2
2
  import { timestampToString } from '@atlaskit/editor-common/utils';
3
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
3
+ 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';
@@ -266,8 +266,7 @@ export const prevIndex = (currentIndex, total) => (currentIndex - 1 + total) % t
266
266
  export const getSelectionForMatch = (selection, doc, index, matches, offset = 0) => {
267
267
  if (matches[index]) {
268
268
  if (isExpandTitle(matches[index])) {
269
- // create a text selection at the first position inside the expand body
270
- return TextSelection.create(doc, matches[index].start + offset - 2);
269
+ return NodeSelection.create(doc, matches[index].start);
271
270
  }
272
271
  return TextSelection.create(doc, matches[index].start + offset);
273
272
  }
@@ -41,7 +41,8 @@ export const findReplaceStylesNew = css({
41
41
  inset 0 0 0 1px ${"var(--ds-background-accent-yellow-subtler-pressed, #E2B203)"},
42
42
  inset 0 0 0 5px ${"var(--ds-background-accent-yellow-subtler, #F8E6A0)"}
43
43
  `,
44
- backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
44
+ // TODO: ED-28376 - clean up !important later
45
+ backgroundColor: `${"var(--ds-background-accent-yellow-subtler, #F8E6A0)"} !important`,
45
46
  color: "var(--ds-text, #172B4D)"
46
47
  },
47
48
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
@@ -50,7 +51,8 @@ export const findReplaceStylesNew = css({
50
51
  inset 0 0 0 1px ${"var(--ds-background-accent-yellow-subtler-pressed, #E2B203)"},
51
52
  inset 0 0 0 5px ${"var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)"}
52
53
  `,
53
- backgroundColor: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)"
54
+ // TODO: ED-28376 - clean up !important later
55
+ backgroundColor: `${"var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)"} !important`
54
56
  },
55
57
  /** Dark mode */
56
58
 
@@ -60,7 +62,8 @@ export const findReplaceStylesNew = css({
60
62
  inset 0 0 0 1px ${"var(--ds-background-accent-yellow-bolder, #946F00)"},
61
63
  inset 0 0 0 5px ${"var(--ds-background-accent-yellow-bolder-pressed, #533F04)"}
62
64
  `,
63
- backgroundColor: "var(--ds-background-accent-yellow-bolder-pressed, #533F04)",
65
+ // TODO: ED-28376 - clean up !important later
66
+ backgroundColor: `${"var(--ds-background-accent-yellow-bolder-pressed, #533F04)"} !important`,
64
67
  color: "var(--ds-text-inverse, #FFFFFF)"
65
68
  },
66
69
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
@@ -69,7 +72,8 @@ export const findReplaceStylesNew = css({
69
72
  inset 0 0 0 1px ${"var(--ds-background-accent-yellow-bolder, #946F00)"},
70
73
  inset 0 0 0 5px ${"var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)"}
71
74
  `,
72
- backgroundColor: "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)"
75
+ // TODO: ED-28376 - clean up !important later
76
+ backgroundColor: `${"var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)"} !important`
73
77
  },
74
78
  /** Block match styles */
75
79
 
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import classnames from 'classnames';
3
3
  import { timestampToString } from '@atlaskit/editor-common/utils';
4
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
4
+ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
6
  import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
7
7
  import { isPromise, MentionNameStatus } from '@atlaskit/mention/types';
@@ -266,8 +266,7 @@ export var getSelectionForMatch = function getSelectionForMatch(selection, doc,
266
266
  var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
267
267
  if (matches[index]) {
268
268
  if (isExpandTitle(matches[index])) {
269
- // create a text selection at the first position inside the expand body
270
- return TextSelection.create(doc, matches[index].start + offset - 2);
269
+ return NodeSelection.create(doc, matches[index].start);
271
270
  }
272
271
  return TextSelection.create(doc, matches[index].start + offset);
273
272
  }
@@ -31,18 +31,22 @@ export var findReplaceStyles = css(_defineProperty(_defineProperty({}, ".".conca
31
31
  export var findReplaceStylesNew = css((_css2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_css2, ".".concat(searchMatchTextClass), {
32
32
  borderRadius: "var(--ds-space-050, 4px)",
33
33
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-subtler-pressed, #E2B203)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-subtler, #F8E6A0)", "\n\t\t"),
34
- backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
34
+ // TODO: ED-28376 - clean up !important later
35
+ backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)".concat(" !important"),
35
36
  color: "var(--ds-text, #172B4D)"
36
37
  }), ".".concat(searchMatchTextClass, ".").concat(selectedSearchMatchClass), {
37
38
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-subtler-pressed, #E2B203)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)", "\n\t\t"),
38
- backgroundColor: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)"
39
+ // TODO: ED-28376 - clean up !important later
40
+ backgroundColor: "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)".concat(" !important")
39
41
  }), ".".concat(searchMatchTextClass, ".").concat(darkModeSearchMatchClass), {
40
42
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-bolder, #946F00)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-bolder-pressed, #533F04)", "\n\t\t"),
41
- backgroundColor: "var(--ds-background-accent-yellow-bolder-pressed, #533F04)",
43
+ // TODO: ED-28376 - clean up !important later
44
+ backgroundColor: "var(--ds-background-accent-yellow-bolder-pressed, #533F04)".concat(" !important"),
42
45
  color: "var(--ds-text-inverse, #FFFFFF)"
43
46
  }), ".".concat(searchMatchTextClass, ".").concat(selectedSearchMatchClass, ".").concat(darkModeSearchMatchClass), {
44
47
  boxShadow: "\n\t\tinset 0 0 0 1px ".concat("var(--ds-background-accent-yellow-bolder, #946F00)", ",\n\t\tinset 0 0 0 5px ", "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)", "\n\t\t"),
45
- backgroundColor: "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)"
48
+ // TODO: ED-28376 - clean up !important later
49
+ backgroundColor: "var(--ds-background-accent-yellow-bolder-hovered, #7F5F01)".concat(" !important")
46
50
  }), ".".concat(blockSearchMatchClass), _defineProperty({
47
51
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
48
52
  '[data-smart-link-container="true"], .loader-wrapper>div::after': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-find-replace",
3
- "version": "2.10.3",
3
+ "version": "2.10.4",
4
4
  "description": "find replace plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/primitives": "^14.10.0",
48
48
  "@atlaskit/textfield": "^8.0.0",
49
49
  "@atlaskit/theme": "^18.0.0",
50
- "@atlaskit/tmp-editor-statsig": "^8.4.0",
50
+ "@atlaskit/tmp-editor-statsig": "^8.5.0",
51
51
  "@atlaskit/tokens": "^5.4.0",
52
52
  "@atlaskit/tooltip": "^20.3.0",
53
53
  "@babel/runtime": "^7.0.0",