@atlaskit/editor-plugin-selection-marker 1.5.16 → 1.5.18
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
|
@@ -53,6 +53,8 @@ var selectionMarkerCursorStyles = {
|
|
|
53
53
|
* @returns Hyphenated CSS property name.
|
|
54
54
|
*/
|
|
55
55
|
function hyphenate(property) {
|
|
56
|
+
// Ignored via go/ees005
|
|
57
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
56
58
|
return property.replace(/[A-Z]/g, function (match) {
|
|
57
59
|
return "-".concat(match.toLowerCase());
|
|
58
60
|
}).replace(/^ms/, '-ms');
|
|
@@ -87,7 +89,10 @@ var containsText = function containsText(resolvedPos) {
|
|
|
87
89
|
nodeAfter = resolvedPos.nodeAfter;
|
|
88
90
|
return (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isInline) || (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isInline);
|
|
89
91
|
};
|
|
90
|
-
var createWidgetDecoration = exports.createWidgetDecoration = function createWidgetDecoration(resolvedPos, type, selection, isHighlight
|
|
92
|
+
var createWidgetDecoration = exports.createWidgetDecoration = function createWidgetDecoration(resolvedPos, type, selection, isHighlight
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
95
|
+
) {
|
|
91
96
|
// We don't want the cursor to show if it's not text selection
|
|
92
97
|
// ie. if it's on media selection
|
|
93
98
|
if (!(selection instanceof _state.TextSelection) || containsText(resolvedPos) === false || !selection.empty) {
|
package/dist/es2019/index.js
CHANGED
|
@@ -45,6 +45,8 @@ const selectionMarkerCursorStyles = {
|
|
|
45
45
|
* @returns Hyphenated CSS property name.
|
|
46
46
|
*/
|
|
47
47
|
function hyphenate(property) {
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
48
50
|
return property.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`).replace(/^ms/, '-ms');
|
|
49
51
|
}
|
|
50
52
|
const Widget = ({
|
|
@@ -53,7 +55,7 @@ const Widget = ({
|
|
|
53
55
|
}) => {
|
|
54
56
|
const span = document.createElement('span');
|
|
55
57
|
const styles = isHighlight ? selectionMarkerHighlightStyles : selectionMarkerCursorStyles;
|
|
56
|
-
for (
|
|
58
|
+
for (const [rule, value] of Object.entries(styles)) {
|
|
57
59
|
span.style.setProperty(hyphenate(rule), value);
|
|
58
60
|
}
|
|
59
61
|
span.setAttribute('contentEditable', 'false');
|
|
@@ -61,7 +63,7 @@ const Widget = ({
|
|
|
61
63
|
return span;
|
|
62
64
|
};
|
|
63
65
|
const toDOM = (type, isHighlight) => {
|
|
64
|
-
|
|
66
|
+
const element = document.createElement('span');
|
|
65
67
|
element.contentEditable = 'false';
|
|
66
68
|
element.setAttribute('style', `position: relative;`);
|
|
67
69
|
element.appendChild(Widget({
|
|
@@ -77,7 +79,10 @@ const containsText = resolvedPos => {
|
|
|
77
79
|
} = resolvedPos;
|
|
78
80
|
return (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isInline) || (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isInline);
|
|
79
81
|
};
|
|
80
|
-
export const createWidgetDecoration = (resolvedPos, type, selection, isHighlight
|
|
82
|
+
export const createWidgetDecoration = (resolvedPos, type, selection, isHighlight
|
|
83
|
+
// Ignored via go/ees005
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
85
|
+
) => {
|
|
81
86
|
// We don't want the cursor to show if it's not text selection
|
|
82
87
|
// ie. if it's on media selection
|
|
83
88
|
if (!(selection instanceof TextSelection) || containsText(resolvedPos) === false || !selection.empty) {
|
package/dist/esm/index.js
CHANGED
|
@@ -46,6 +46,8 @@ var selectionMarkerCursorStyles = {
|
|
|
46
46
|
* @returns Hyphenated CSS property name.
|
|
47
47
|
*/
|
|
48
48
|
function hyphenate(property) {
|
|
49
|
+
// Ignored via go/ees005
|
|
50
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
49
51
|
return property.replace(/[A-Z]/g, function (match) {
|
|
50
52
|
return "-".concat(match.toLowerCase());
|
|
51
53
|
}).replace(/^ms/, '-ms');
|
|
@@ -80,7 +82,10 @@ var containsText = function containsText(resolvedPos) {
|
|
|
80
82
|
nodeAfter = resolvedPos.nodeAfter;
|
|
81
83
|
return (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.isInline) || (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.isInline);
|
|
82
84
|
};
|
|
83
|
-
export var createWidgetDecoration = function createWidgetDecoration(resolvedPos, type, selection, isHighlight
|
|
85
|
+
export var createWidgetDecoration = function createWidgetDecoration(resolvedPos, type, selection, isHighlight
|
|
86
|
+
// Ignored via go/ees005
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
88
|
+
) {
|
|
84
89
|
// We don't want the cursor to show if it's not text selection
|
|
85
90
|
// ie. if it's on media selection
|
|
86
91
|
if (!(selection instanceof TextSelection) || containsText(resolvedPos) === false || !selection.empty) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-marker",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.18",
|
|
4
4
|
"description": "Selection marker plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
".": "./src/index.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/editor-common": "^
|
|
32
|
+
"@atlaskit/editor-common": "^98.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
34
34
|
"@atlaskit/editor-plugin-focus": "^1.4.0",
|
|
35
35
|
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
38
38
|
"@atlaskit/primitives": "^13.3.0",
|
|
39
39
|
"@atlaskit/theme": "^14.0.0",
|
|
40
|
-
"@atlaskit/tokens": "^2.
|
|
40
|
+
"@atlaskit/tokens": "^2.5.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1",
|
|
43
43
|
"lodash": "^4.17.21"
|