@atlaskit/editor-plugin-selection-marker 3.0.2 → 3.0.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 +14 -0
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/cjs/ui/widget-decoration.js +3 -1
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/es2019/ui/widget-decoration.js +3 -1
- package/dist/esm/pm-plugins/main.js +1 -2
- package/dist/esm/ui/widget-decoration.js +3 -1
- package/package.json +6 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-marker
|
|
2
2
|
|
|
3
|
+
## 3.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5f7f868ae7ce5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f7f868ae7ce5) -
|
|
8
|
+
ED-28969 remove platform_editor_plugin_selection_marker_bugfix
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 3.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 3.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@ 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 _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _selectionDecoration = require("../ui/selection-decoration");
|
|
19
18
|
var _widgetDecoration = require("../ui/widget-decoration");
|
|
20
19
|
var key = exports.key = new _state.PluginKey('selectionMarker');
|
|
@@ -79,7 +78,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
79
78
|
},
|
|
80
79
|
props: {
|
|
81
80
|
decorations: function decorations(state) {
|
|
82
|
-
if (_browser.browser.ie
|
|
81
|
+
if (_browser.browser.ie) {
|
|
83
82
|
return debouncedDecorations(state);
|
|
84
83
|
} else {
|
|
85
84
|
var _key$getState2;
|
|
@@ -122,7 +122,9 @@ var createWidgetDecoration = exports.createWidgetDecoration = function createWid
|
|
|
122
122
|
var areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
|
|
123
123
|
var lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 || (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
|
|
124
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 =
|
|
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 || '');
|
|
126
128
|
isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
|
|
127
129
|
}
|
|
128
130
|
return [_view.Decoration.widget(resolvedPos.pos, toDOM(type, isHighlight, isInWord), {
|
|
@@ -4,7 +4,6 @@ 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 { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { selectionDecoration } from '../ui/selection-decoration';
|
|
9
8
|
import { createWidgetDecoration } from '../ui/widget-decoration';
|
|
10
9
|
export const key = new PluginKey('selectionMarker');
|
|
@@ -71,7 +70,7 @@ export const createPlugin = api => {
|
|
|
71
70
|
},
|
|
72
71
|
props: {
|
|
73
72
|
decorations: state => {
|
|
74
|
-
if (browser.ie
|
|
73
|
+
if (browser.ie) {
|
|
75
74
|
return debouncedDecorations(state);
|
|
76
75
|
} else {
|
|
77
76
|
var _key$getState2;
|
|
@@ -114,7 +114,9 @@ export const createWidgetDecoration = (resolvedPos, type, selection, isHighlight
|
|
|
114
114
|
const areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
|
|
115
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
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 =
|
|
117
|
+
const areAdjacentCharactersNonWhitespace =
|
|
118
|
+
// @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
|
|
119
|
+
/\S/u.test(lastCharacterOfBeforeNode || '') && /\S/u.test(firstCharacterOfAfterNode || '');
|
|
118
120
|
isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
|
|
119
121
|
}
|
|
120
122
|
return [Decoration.widget(resolvedPos.pos, toDOM(type, isHighlight, isInWord), {
|
|
@@ -5,7 +5,6 @@ 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 { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { selectionDecoration } from '../ui/selection-decoration';
|
|
10
9
|
import { createWidgetDecoration } from '../ui/widget-decoration';
|
|
11
10
|
export var key = new PluginKey('selectionMarker');
|
|
@@ -70,7 +69,7 @@ export var createPlugin = function createPlugin(api) {
|
|
|
70
69
|
},
|
|
71
70
|
props: {
|
|
72
71
|
decorations: function decorations(state) {
|
|
73
|
-
if (browser.ie
|
|
72
|
+
if (browser.ie) {
|
|
74
73
|
return debouncedDecorations(state);
|
|
75
74
|
} else {
|
|
76
75
|
var _key$getState2;
|
|
@@ -115,7 +115,9 @@ export var createWidgetDecoration = function createWidgetDecoration(resolvedPos,
|
|
|
115
115
|
var areTextNodes = parent.isTextblock && (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isText) && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isText);
|
|
116
116
|
var lastCharacterOfBeforeNode = nodeBefore === null || nodeBefore === void 0 || (_nodeBefore$textConte = nodeBefore.textContent) === null || _nodeBefore$textConte === void 0 ? void 0 : _nodeBefore$textConte.slice(-1);
|
|
117
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 =
|
|
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 || '');
|
|
119
121
|
isInWord = Boolean(areTextNodes && areAdjacentCharactersNonWhitespace);
|
|
120
122
|
}
|
|
121
123
|
return [Decoration.widget(resolvedPos.pos, toDOM(type, isHighlight, isInWord), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-marker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Selection marker plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-focus": "^2.0.0",
|
|
36
|
-
"@atlaskit/editor-plugin-type-ahead": "^3.
|
|
36
|
+
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
38
|
"@atlaskit/link": "^3.2.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
|
-
"@atlaskit/primitives": "^14.
|
|
40
|
+
"@atlaskit/primitives": "^14.11.0",
|
|
41
41
|
"@atlaskit/theme": "^19.0.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
43
|
-
"@atlaskit/tokens": "^
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^9.27.0",
|
|
43
|
+
"@atlaskit/tokens": "^6.0.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1",
|
|
46
46
|
"lodash": "^4.17.21"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^107.
|
|
49
|
+
"@atlaskit/editor-common": "^107.21.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"@atlaskit/ssr": "workspace:^",
|
|
57
57
|
"@atlaskit/visual-regression": "workspace:^",
|
|
58
58
|
"@testing-library/react": "^13.4.0",
|
|
59
|
-
"typescript": "~5.4.2",
|
|
60
59
|
"wait-for-expect": "^1.2.0"
|
|
61
60
|
},
|
|
62
61
|
"techstack": {
|
|
@@ -96,9 +95,6 @@
|
|
|
96
95
|
}
|
|
97
96
|
},
|
|
98
97
|
"platform-feature-flags": {
|
|
99
|
-
"platform_editor_plugin_selection_marker_bugfix": {
|
|
100
|
-
"type": "boolean"
|
|
101
|
-
},
|
|
102
98
|
"dst-a11y__replace-anchor-with-link__editor-lego": {
|
|
103
99
|
"type": "boolean"
|
|
104
100
|
},
|