@atlaskit/editor-plugin-selection-marker 6.2.4 → 6.2.6

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,21 @@
1
1
  # @atlaskit/editor-plugin-selection-marker
2
2
 
3
+ ## 6.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1d6a18c8a712e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1d6a18c8a712e) -
8
+ Cleanup fg platform_editor_inline_selection_marker_cursor
9
+ - Updated dependencies
10
+
11
+ ## 6.2.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [`14bcefe1ca8ed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/14bcefe1ca8ed) -
16
+ upgrade use of browser util
17
+ - Updated dependencies
18
+
3
19
  ## 6.2.4
4
20
 
5
21
  ### Patch Changes
@@ -14,6 +14,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
15
  var _state = require("@atlaskit/editor-prosemirror/state");
16
16
  var _view = require("@atlaskit/editor-prosemirror/view");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
18
  var _selectionDecoration = require("../ui/selection-decoration");
18
19
  var _widgetDecoration = require("../ui/widget-decoration");
19
20
  var key = exports.key = new _state.PluginKey('selectionMarker');
@@ -78,7 +79,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
78
79
  },
79
80
  props: {
80
81
  decorations: function decorations(state) {
81
- if (_browser.browser.ie) {
82
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
83
+ if (browser.ie) {
82
84
  return debouncedDecorations(state);
83
85
  } else {
84
86
  var _key$getState2;
@@ -8,7 +8,6 @@ exports.createWidgetDecoration = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _view = require("@atlaskit/editor-prosemirror/view");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _colors = require("@atlaskit/theme/colors");
13
12
  /**
14
13
  * @jsxRuntime classic
@@ -75,7 +74,7 @@ var Widget = function Widget(_ref) {
75
74
  isHighlight = _ref.isHighlight,
76
75
  isInWord = _ref.isInWord;
77
76
  var span = document.createElement('span');
78
- var selectionMarkerCursorStyles = isInWord && (0, _platformFeatureFlags.fg)('platform_editor_inline_selection_marker_cursor') ? selectionMarkerInlineCursorStyles : selectionMarkerBlockCursorStyles;
77
+ var selectionMarkerCursorStyles = isInWord ? selectionMarkerInlineCursorStyles : selectionMarkerBlockCursorStyles;
79
78
  var styles = isHighlight ? selectionMarkerHighlightStyles : selectionMarkerCursorStyles;
80
79
  for (var _i = 0, _Object$entries = Object.entries(styles); _i < _Object$entries.length; _i++) {
81
80
  var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
@@ -104,29 +103,27 @@ var containsText = function containsText(resolvedPos) {
104
103
  return (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isInline) || (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isInline);
105
104
  };
106
105
  var createWidgetDecoration = exports.createWidgetDecoration = function createWidgetDecoration(resolvedPos, type, selection, isHighlight) {
106
+ var _nodeBefore$textConte, _nodeAfter$textConten;
107
107
  // We don't want the cursor to show if it's not text selection
108
108
  // ie. if it's on media selection
109
109
  if (!(selection instanceof _state.TextSelection) || containsText(resolvedPos) === false || !selection.empty) {
110
110
  return [];
111
111
  }
112
- var isInWord = false;
113
- if ((0, _platformFeatureFlags.fg)('platform_editor_inline_selection_marker_cursor')) {
114
- var _nodeBefore$textConte, _nodeAfter$textConten;
115
- // We're inside a word if the parent, before, and after nodes are all text nodes
116
- // and the before/after nodes are appended/prepended with non-whitespace characters
117
- // Also if we're making a selection and not just a cursor, this isn't relevant
118
- var nodeBefore = resolvedPos.nodeBefore,
119
- nodeAfter = resolvedPos.nodeAfter,
120
- parent = resolvedPos.parent;
121
- // Check if the parent is a text node and the before/after nodes are also text nodes
122
- var areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
123
- var lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 || (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
124
- var firstCharacterOfAfterNode = nodeAfter === null || nodeAfter === void 0 || (_nodeAfter$textConten = nodeAfter.textContent) === null || _nodeAfter$textConten === void 0 ? void 0 : _nodeAfter$textConten.slice(0, 1);
125
- var areAdjacentCharactersNonWhitespace =
126
- // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
127
- /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(lastCharacterOfBeforeNode || '') && /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(firstCharacterOfAfterNode || '');
128
- isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
129
- }
112
+
113
+ // We're inside a word if the parent, before, and after nodes are all text nodes
114
+ // and the before/after nodes are appended/prepended with non-whitespace characters
115
+ // Also if we're making a selection and not just a cursor, this isn't relevant
116
+ var nodeBefore = resolvedPos.nodeBefore,
117
+ nodeAfter = resolvedPos.nodeAfter,
118
+ parent = resolvedPos.parent;
119
+ // Check if the parent is a text node and the before/after nodes are also text nodes
120
+ var areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
121
+ var lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 || (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
122
+ var firstCharacterOfAfterNode = nodeAfter === null || nodeAfter === void 0 || (_nodeAfter$textConten = nodeAfter.textContent) === null || _nodeAfter$textConten === void 0 ? void 0 : _nodeAfter$textConten.slice(0, 1);
123
+ var areAdjacentCharactersNonWhitespace =
124
+ // @ts-ignore - TS1501 Older versions of TypeScript don't play nice with the u flag. With the current AFM TypeScript version, this *should* be fine, but the pipeline type check fails, hence why a ts-ignore is needed (over a ts-expect-error)
125
+ /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(lastCharacterOfBeforeNode || '') && /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(firstCharacterOfAfterNode || '');
126
+ var isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
130
127
  return [_view.Decoration.widget(resolvedPos.pos, toDOM(type, isHighlight, isInWord), {
131
128
  side: -1,
132
129
  key: "".concat(type, "WidgetDecoration"),
@@ -1,9 +1,10 @@
1
1
  import debounce from 'lodash/debounce';
2
- import { browser } from '@atlaskit/editor-common/browser';
2
+ import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import { isEmptyDocument } from '@atlaskit/editor-common/utils';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { selectionDecoration } from '../ui/selection-decoration';
8
9
  import { createWidgetDecoration } from '../ui/widget-decoration';
9
10
  export const key = new PluginKey('selectionMarker');
@@ -70,6 +71,7 @@ export const createPlugin = api => {
70
71
  },
71
72
  props: {
72
73
  decorations: state => {
74
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
73
75
  if (browser.ie) {
74
76
  return debouncedDecorations(state);
75
77
  } else {
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { N500 } from '@atlaskit/theme/colors';
10
9
  const selectionMarkerHighlightStyles = {
11
10
  content: "''",
@@ -66,7 +65,7 @@ const Widget = ({
66
65
  isInWord
67
66
  }) => {
68
67
  const span = document.createElement('span');
69
- const selectionMarkerCursorStyles = isInWord && fg('platform_editor_inline_selection_marker_cursor') ? selectionMarkerInlineCursorStyles : selectionMarkerBlockCursorStyles;
68
+ const selectionMarkerCursorStyles = isInWord ? selectionMarkerInlineCursorStyles : selectionMarkerBlockCursorStyles;
70
69
  const styles = isHighlight ? selectionMarkerHighlightStyles : selectionMarkerCursorStyles;
71
70
  for (const [rule, value] of Object.entries(styles)) {
72
71
  span.style.setProperty(hyphenate(rule), value);
@@ -94,31 +93,29 @@ const containsText = resolvedPos => {
94
93
  return (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isInline) || (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isInline);
95
94
  };
96
95
  export const createWidgetDecoration = (resolvedPos, type, selection, isHighlight) => {
96
+ var _nodeBefore$textConte, _nodeAfter$textConten;
97
97
  // We don't want the cursor to show if it's not text selection
98
98
  // ie. if it's on media selection
99
99
  if (!(selection instanceof TextSelection) || containsText(resolvedPos) === false || !selection.empty) {
100
100
  return [];
101
101
  }
102
- let isInWord = false;
103
- if (fg('platform_editor_inline_selection_marker_cursor')) {
104
- var _nodeBefore$textConte, _nodeAfter$textConten;
105
- // We're inside a word if the parent, before, and after nodes are all text nodes
106
- // and the before/after nodes are appended/prepended with non-whitespace characters
107
- // Also if we're making a selection and not just a cursor, this isn't relevant
108
- const {
109
- nodeBefore,
110
- nodeAfter,
111
- parent
112
- } = resolvedPos;
113
- // Check if the parent is a text node and the before/after nodes are also text nodes
114
- const areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
115
- const lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 ? void 0 : (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
116
- const firstCharacterOfAfterNode = nodeAfter === null || nodeAfter === void 0 ? void 0 : (_nodeAfter$textConten = nodeAfter.textContent) === null || _nodeAfter$textConten === void 0 ? void 0 : _nodeAfter$textConten.slice(0, 1);
117
- const areAdjacentCharactersNonWhitespace =
118
- // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
119
- /\S/u.test(lastCharacterOfBeforeNode || '') && /\S/u.test(firstCharacterOfAfterNode || '');
120
- isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
121
- }
102
+
103
+ // We're inside a word if the parent, before, and after nodes are all text nodes
104
+ // and the before/after nodes are appended/prepended with non-whitespace characters
105
+ // Also if we're making a selection and not just a cursor, this isn't relevant
106
+ const {
107
+ nodeBefore,
108
+ nodeAfter,
109
+ parent
110
+ } = resolvedPos;
111
+ // Check if the parent is a text node and the before/after nodes are also text nodes
112
+ const areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
113
+ const lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 ? void 0 : (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
114
+ const firstCharacterOfAfterNode = nodeAfter === null || nodeAfter === void 0 ? void 0 : (_nodeAfter$textConten = nodeAfter.textContent) === null || _nodeAfter$textConten === void 0 ? void 0 : _nodeAfter$textConten.slice(0, 1);
115
+ const areAdjacentCharactersNonWhitespace =
116
+ // @ts-ignore - TS1501 Older versions of TypeScript don't play nice with the u flag. With the current AFM TypeScript version, this *should* be fine, but the pipeline type check fails, hence why a ts-ignore is needed (over a ts-expect-error)
117
+ /\S/u.test(lastCharacterOfBeforeNode || '') && /\S/u.test(firstCharacterOfAfterNode || '');
118
+ const isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
122
119
  return [Decoration.widget(resolvedPos.pos, toDOM(type, isHighlight, isInWord), {
123
120
  side: -1,
124
121
  key: `${type}WidgetDecoration`,
@@ -1,10 +1,11 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import debounce from 'lodash/debounce';
3
- import { browser } from '@atlaskit/editor-common/browser';
3
+ import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { isEmptyDocument } from '@atlaskit/editor-common/utils';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
7
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  import { selectionDecoration } from '../ui/selection-decoration';
9
10
  import { createWidgetDecoration } from '../ui/widget-decoration';
10
11
  export var key = new PluginKey('selectionMarker');
@@ -69,6 +70,7 @@ export var createPlugin = function createPlugin(api) {
69
70
  },
70
71
  props: {
71
72
  decorations: function decorations(state) {
73
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
72
74
  if (browser.ie) {
73
75
  return debouncedDecorations(state);
74
76
  } else {
@@ -6,7 +6,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
6
6
 
7
7
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { N500 } from '@atlaskit/theme/colors';
11
10
  var selectionMarkerHighlightStyles = {
12
11
  content: "''",
@@ -68,7 +67,7 @@ var Widget = function Widget(_ref) {
68
67
  isHighlight = _ref.isHighlight,
69
68
  isInWord = _ref.isInWord;
70
69
  var span = document.createElement('span');
71
- var selectionMarkerCursorStyles = isInWord && fg('platform_editor_inline_selection_marker_cursor') ? selectionMarkerInlineCursorStyles : selectionMarkerBlockCursorStyles;
70
+ var selectionMarkerCursorStyles = isInWord ? selectionMarkerInlineCursorStyles : selectionMarkerBlockCursorStyles;
72
71
  var styles = isHighlight ? selectionMarkerHighlightStyles : selectionMarkerCursorStyles;
73
72
  for (var _i = 0, _Object$entries = Object.entries(styles); _i < _Object$entries.length; _i++) {
74
73
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
@@ -97,29 +96,27 @@ var containsText = function containsText(resolvedPos) {
97
96
  return (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isInline) || (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isInline);
98
97
  };
99
98
  export var createWidgetDecoration = function createWidgetDecoration(resolvedPos, type, selection, isHighlight) {
99
+ var _nodeBefore$textConte, _nodeAfter$textConten;
100
100
  // We don't want the cursor to show if it's not text selection
101
101
  // ie. if it's on media selection
102
102
  if (!(selection instanceof TextSelection) || containsText(resolvedPos) === false || !selection.empty) {
103
103
  return [];
104
104
  }
105
- var isInWord = false;
106
- if (fg('platform_editor_inline_selection_marker_cursor')) {
107
- var _nodeBefore$textConte, _nodeAfter$textConten;
108
- // We're inside a word if the parent, before, and after nodes are all text nodes
109
- // and the before/after nodes are appended/prepended with non-whitespace characters
110
- // Also if we're making a selection and not just a cursor, this isn't relevant
111
- var nodeBefore = resolvedPos.nodeBefore,
112
- nodeAfter = resolvedPos.nodeAfter,
113
- parent = resolvedPos.parent;
114
- // Check if the parent is a text node and the before/after nodes are also text nodes
115
- var areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
116
- var lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 || (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
117
- var firstCharacterOfAfterNode = nodeAfter === null || nodeAfter === void 0 || (_nodeAfter$textConten = nodeAfter.textContent) === null || _nodeAfter$textConten === void 0 ? void 0 : _nodeAfter$textConten.slice(0, 1);
118
- var areAdjacentCharactersNonWhitespace =
119
- // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
120
- /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(lastCharacterOfBeforeNode || '') && /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(firstCharacterOfAfterNode || '');
121
- isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
122
- }
105
+
106
+ // We're inside a word if the parent, before, and after nodes are all text nodes
107
+ // and the before/after nodes are appended/prepended with non-whitespace characters
108
+ // Also if we're making a selection and not just a cursor, this isn't relevant
109
+ var nodeBefore = resolvedPos.nodeBefore,
110
+ nodeAfter = resolvedPos.nodeAfter,
111
+ parent = resolvedPos.parent;
112
+ // Check if the parent is a text node and the before/after nodes are also text nodes
113
+ var areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
114
+ var lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 || (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
115
+ var firstCharacterOfAfterNode = nodeAfter === null || nodeAfter === void 0 || (_nodeAfter$textConten = nodeAfter.textContent) === null || _nodeAfter$textConten === void 0 ? void 0 : _nodeAfter$textConten.slice(0, 1);
116
+ var areAdjacentCharactersNonWhitespace =
117
+ // @ts-ignore - TS1501 Older versions of TypeScript don't play nice with the u flag. With the current AFM TypeScript version, this *should* be fine, but the pipeline type check fails, hence why a ts-ignore is needed (over a ts-expect-error)
118
+ /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(lastCharacterOfBeforeNode || '') && /(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(firstCharacterOfAfterNode || '');
119
+ var isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
123
120
  return [Decoration.widget(resolvedPos.pos, toDOM(type, isHighlight, isInWord), {
124
121
  side: -1,
125
122
  key: "".concat(type, "WidgetDecoration"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-marker",
3
- "version": "6.2.4",
3
+ "version": "6.2.6",
4
4
  "description": "Selection marker plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,21 +31,21 @@
31
31
  "@atlaskit/editor-plugin-decorations": "^6.1.0",
32
32
  "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
33
33
  "@atlaskit/editor-plugin-focus": "^5.0.0",
34
- "@atlaskit/editor-plugin-toolbar": "^3.3.0",
34
+ "@atlaskit/editor-plugin-toolbar": "^3.4.0",
35
35
  "@atlaskit/editor-plugin-type-ahead": "^6.5.0",
36
36
  "@atlaskit/editor-prosemirror": "7.0.0",
37
37
  "@atlaskit/link": "^3.2.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/primitives": "^16.0.0",
40
40
  "@atlaskit/theme": "^21.0.0",
41
- "@atlaskit/tmp-editor-statsig": "^13.13.0",
41
+ "@atlaskit/tmp-editor-statsig": "^13.19.0",
42
42
  "@atlaskit/tokens": "^7.0.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1",
45
45
  "lodash": "^4.17.21"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^110.14.0",
48
+ "@atlaskit/editor-common": "^110.18.0",
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0"
51
51
  },
@@ -95,9 +95,6 @@
95
95
  "platform-feature-flags": {
96
96
  "dst-a11y__replace-anchor-with-link__editor-lego": {
97
97
  "type": "boolean"
98
- },
99
- "platform_editor_inline_selection_marker_cursor": {
100
- "type": "boolean"
101
98
  }
102
99
  }
103
100
  }