@openstax/highlighter
Advanced tools
Comparing version 1.1.9 to 1.2.0-beta.1
{ | ||
"name": "@openstax/highlighter", | ||
"version": "1.1.9", | ||
"main": "dist/highlighter.js", | ||
"version": "1.2.0-beta.1", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
@@ -9,5 +9,5 @@ "scripts": { | ||
"clean": "rm -rf dist", | ||
"build": "webpack --config=webpack.config.js --mode=production", | ||
"build": "tsc -m es6 --outDir dist", | ||
"build:clean": "npm-run-all clean build", | ||
"test": "jest --coverage --verbose --maxWorkers=2", | ||
"deploy:examples": "gh-pages -d examples", | ||
"lint": "npm-run-all lint:js lint:ts lint:ts-types", | ||
@@ -17,5 +17,5 @@ "lint:js": "eslint src/**/*.js", | ||
"lint:ts-types": "tsc", | ||
"watch": "webpack --config=webpack.config.js --mode=development --watch", | ||
"watch:test": "jest --watchAll", | ||
"watch:ts": "tsc --noEmit --watch" | ||
"test": "jest --coverage --verbose --maxWorkers=2", | ||
"watch": "tsc --noEmit --watch", | ||
"watch:test": "jest --watchAll" | ||
}, | ||
@@ -34,2 +34,3 @@ "devDependencies": { | ||
"eslint-loader": "^2.1.1", | ||
"gh-pages": "^2.0.1", | ||
"jest": "^23.6.0", | ||
@@ -41,5 +42,3 @@ "npm-run-all": "^4.1.3", | ||
"typescript": "^3.1.1", | ||
"typescript-babel-jest": "^1.0.5", | ||
"webpack": "^4.20.2", | ||
"webpack-cli": "^3.1.2" | ||
"typescript-babel-jest": "^1.0.5" | ||
}, | ||
@@ -46,0 +45,0 @@ "resolutions": { |
@@ -60,1 +60,18 @@ # Highlighter | ||
``` | ||
## Running the examples with docker | ||
```bash | ||
# builds the library for the examples to use | ||
docker-compose run build | ||
# runs the test server on port 8080 | ||
docker-compose up serve | ||
``` | ||
## Deploy examples to gh-pages | ||
```bash | ||
yarn build:clean && yarn deploy:examples | ||
``` |
@@ -32,3 +32,7 @@ import Highlight, {FOCUS_CSS} from './Highlight'; | ||
public erase(highlight: Highlight): void { | ||
public eraseAll = (): void => { | ||
this.getHighlights().forEach(this.erase); | ||
} | ||
public erase = (highlight: Highlight): void => { | ||
removeHighlightWrappers(highlight); | ||
@@ -35,0 +39,0 @@ delete this.highlights[highlight.id]; |
@@ -53,9 +53,11 @@ import dom from '../../dom'; | ||
const [startContainer, startOffset] = getFirstByXPath(data.startContainer, data.startOffset, referenceElement); | ||
const [endContainer, endOffset] = getFirstByXPath(data.endContainer, data.endOffset, referenceElement); | ||
const [startContainer, startOffset] = getFirstByXPath(data.startContainer, data.startOffset, referenceElement!); | ||
const [endContainer, endOffset] = getFirstByXPath(data.endContainer, data.endOffset, referenceElement!); | ||
range.setStart(startContainer, startOffset); | ||
range.setEnd(endContainer, endOffset); | ||
if (startContainer && endContainer) { | ||
range.setStart(startContainer, startOffset); | ||
range.setEnd(endContainer, endOffset); | ||
} | ||
return range; | ||
} |
@@ -14,11 +14,12 @@ { | ||
"strict": true, | ||
"declaration": true, | ||
"module": "es6", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"allowJs": true | ||
"sourceMap": true | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"dist", | ||
"**/*.js" | ||
] | ||
} |
@@ -1,1 +0,1 @@ | ||
declare module "serialize-selection"; | ||
declare module 'serialize-selection'; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19
34
77
114053
1987
2
1