@livingdocs/editable.js 3.1.5 → 3.1.7
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/dist/editable.js +1 -1
- package/dist/editable.js.map +1 -1
- package/package.json +13 -13
- package/src/highlight-support.js +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livingdocs/editable.js",
|
|
3
3
|
"description": "Friendly contenteditable API",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.7",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@babel/runtime": "^7.16.7",
|
|
7
7
|
"bowser": "2.11.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@babel/plugin-transform-runtime": "^7.16.10",
|
|
15
15
|
"@babel/preset-env": "^7.16.11",
|
|
16
16
|
"@babel/preset-react": "^7.16.7",
|
|
17
|
-
"babel-loader": "^
|
|
17
|
+
"babel-loader": "^9.0.0",
|
|
18
18
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
19
19
|
"babel-plugin-istanbul": "^6.1.1",
|
|
20
20
|
"chai": "^4.3.6",
|
|
@@ -22,27 +22,27 @@
|
|
|
22
22
|
"eslint": "^8.8.0",
|
|
23
23
|
"eslint-plugin-react": "^7.28.0",
|
|
24
24
|
"font-awesome": "^4.7.0",
|
|
25
|
-
"gh-pages": "^
|
|
25
|
+
"gh-pages": "^5.0.0",
|
|
26
26
|
"karma": "^6.3.13",
|
|
27
27
|
"karma-chrome-launcher": "^3.1.0",
|
|
28
28
|
"karma-coverage": "^2.1.0",
|
|
29
29
|
"karma-firefox-launcher": "^2.1.2",
|
|
30
30
|
"karma-mocha": "^2.0.1",
|
|
31
31
|
"karma-safari-launcher": "^1.0.0",
|
|
32
|
-
"karma-sourcemap-loader": "^0.
|
|
32
|
+
"karma-sourcemap-loader": "^0.4.0",
|
|
33
33
|
"karma-webpack": "^5.0.0",
|
|
34
|
-
"mocha": "^
|
|
34
|
+
"mocha": "^10.0.0",
|
|
35
35
|
"normalize.css": "^8.0.1",
|
|
36
36
|
"prismjs": "^1.26.0",
|
|
37
|
-
"react": "^
|
|
38
|
-
"react-dom": "^
|
|
37
|
+
"react": "^18.0.0",
|
|
38
|
+
"react-dom": "^18.0.0",
|
|
39
39
|
"react-transition-group": "^4.4.2",
|
|
40
|
-
"rimraf": "^
|
|
41
|
-
"sinon": "^
|
|
40
|
+
"rimraf": "^4.0.0",
|
|
41
|
+
"sinon": "^15.0.0",
|
|
42
42
|
"style-loader": "^3.3.1",
|
|
43
43
|
"url-loader": "^4.1.1",
|
|
44
44
|
"webpack": "^5.68.0",
|
|
45
|
-
"webpack-cli": "^
|
|
45
|
+
"webpack-cli": "^5.0.0",
|
|
46
46
|
"webpack-dev-server": "^4.7.3"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
@@ -83,11 +83,11 @@
|
|
|
83
83
|
"isCi": true,
|
|
84
84
|
"name": "Drone",
|
|
85
85
|
"service": "drone",
|
|
86
|
-
"commit": "
|
|
87
|
-
"build": "
|
|
86
|
+
"commit": "faeb13de973b3fcbaca1c38da4d8efc7b138565d",
|
|
87
|
+
"build": "900",
|
|
88
88
|
"branch": "master",
|
|
89
89
|
"isPr": false,
|
|
90
90
|
"slug": "livingdocsIO/editable.js",
|
|
91
|
-
"date": "2023-
|
|
91
|
+
"date": "2023-03-10T10:06:35.613Z"
|
|
92
92
|
}
|
|
93
93
|
}
|
package/src/highlight-support.js
CHANGED
|
@@ -40,6 +40,7 @@ const highlightSupport = {
|
|
|
40
40
|
const markerNode = highlightSupport.createMarkerNode(firstMarker, type, this.win)
|
|
41
41
|
const textSearch = new TextHighlighting(markerNode, 'text')
|
|
42
42
|
const blockText = highlightText.extractText(editableHost)
|
|
43
|
+
if (blockText === '') return -1 // the text was deleted so we can't highlight it
|
|
43
44
|
const matchesArray = textSearch.findMatches(blockText, [text])
|
|
44
45
|
const {actualStartIndex, actualEndIndex} = this.getIndex(matchesArray, startIndex, endIndex)
|
|
45
46
|
const range = rangy.createRange()
|