{"_id":"@concord-consortium/text-decorator","_rev":"19-b9a84dcaeea54dcd7a96d63afe382996","name":"@concord-consortium/text-decorator","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@concord-consortium/text-decorator","version":"1.0.0","keywords":["text","decoration","text-decorator","html","rect","parse"],"author":{"name":"Concord Consortium","email":"developer@concord.org"},"license":"MIT","_id":"@concord-consortium/text-decorator@1.0.0","maintainers":[{"name":"cgreenhill","email":"clgreenhill@gmail.com"},{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"dougmartin","email":"doug@dougmart.in"},{"name":"dstrawberrygirl","email":"chart@concord.org"},{"name":"knowuh","email":"knowuh@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"piotrjanik","email":"janikpiotrek@gmail.com"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"sfentress","email":"sfentress@gmail.com"}],"homepage":"https://github.com/concord-consortium/text-decorator#readme","bugs":{"url":"https://github.com/concord-consortium/text-decorator/issues"},"dist":{"shasum":"031bed664bf36d519a2461f7b3e5e07793970cdb","tarball":"https://registry.npmjs.org/@concord-consortium/text-decorator/-/text-decorator-1.0.0.tgz","fileCount":4,"integrity":"sha512-9zl7RmeyG665t6WMjOm5R+jThNpQQXlREhNj243PT4hYbBxJ/7dHO7FUlXswej+3KFKGCgmyftzgIPEWCT0jcg==","signatures":[{"sig":"MEUCIC/QjLZP3K/qDgcNJXXcYc9+4vZNY5JpbZXYrXQe2cd/AiEAhE9WE1+JgmB6V7JxkLq5mm9D0a0ukoFYWq/EQp1N/04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":219805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt216CRA9TVsSAnZWagAADcUP/AqaqrQ8i3Qlyji9lZsM\ngBiafho7GQuxNGqFFNnnU0zXVoAHmmKQ72kCGYqYeGXt3acTUQgaJLx2XcAL\nX7r/jYLIC5hofdm5DJfm3KPdak48hiUDyr5hnD1k6l05tG0E1E5G6SJUsjH4\nkrOdRQ98wDswdk1dCLS1vaQEZWMvr7Y+8FrMQD7giSynufP6H0Z2PomEAGM6\nqSsntJB/VIZQ8cPVPftJfE5l6zTOqF9XHMipS0dkmOsokaYeaAOdsiP4EqAm\n5263ZRCkBRugaQKDILxl+udGKeVAG4yTo1VL7gPkC29o4Y4ZVko+AwDx8hOo\neizAC6fNsLqJR0qTe3V5J3TUOGI0H9UD16BzEHCa0HgzJ0JRzGRqfPh186nN\nxKj1ee0ViFvd/lbKgPbJkJjagPj1NEgw3zooHbPFW9/4DdFLBWFwQWPf+CnX\n/328Z/pbIXAKNCXipUOHgdXfCuUV5o74AFZmQ0hMVVUSZA2nKLhHzf+5MIOQ\n3wZe05sBET2gTYumS7OL5tc8BcrrCLfI06F24sAPLkk6uujXwj5v7n+qltlu\n2Siq2Ce6a4yXiJT+1H3nZb8uSdLV6A62dBCFz/oEtvYmTOroQaoUEv0lJZ7D\nkw2YN5NsDmgkVKPs4Fy/yojVyoD7KNwU1siHcueJ5l9zpr9N77pOu7wr5nb0\nebpr\r\n=Jvdf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","transform":{".(ts|tsx)":"ts-jest/preprocessor.js"},"collectCoverage":true,"testEnvironment":"enzyme","coverageThreshold":{"global":{"lines":95,"branches":90,"functions":95,"statements":95}},"moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"setupTestFrameworkScriptFile":"./node_modules/jest-enzyme/lib/index.js"},"main":"dist/text-decorator.js","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"validate-commit-msg":{"types":"conventional-commit-types","helpMessage":"Use \"npm run commit\" instead, we use conventional-changelog format :) (https://github.com/commitizen/cz-cli)"}},"engines":{"node":">=6.0.0"},"gitHead":"cf2e06e224c32546a90592173bb7d6f6621ec5b0","scripts":{"lint":"tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","test":"jest","build":"tsc --module commonjs && webpack --mode production --devtool false && typedoc --out docs --target es6 --theme minimal --mode file src","commit":"git-cz","lint:fix":"tslint --fix -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","prebuild":"rimraf dist","precommit":"lint-staged","test:prod":"npm run lint && npm run test -- --coverage --no-cache","test:watch":"jest --watch","deploy-docs":"ts-node tools/gh-pages-publish","test:coverage":"jest --coverage","report-coverage":"cat ./coverage/lcov.info | coveralls","semantic-release":"semantic-release","semantic-release-prepare":"ts-node tools/semantic-release-prepare"},"typings":"dist/types/text-decorator.d.ts","_npmUser":{"name":"piotrjanik","email":"janikpiotrek@gmail.com"},"prettier":{"semi":true,"singleQuote":true},"repository":{"url":"git+https://github.com/concord-consortium/text-decorator.git","type":"git"},"_npmVersion":"6.4.1","description":"The TextDecorator library provides text decoration capabilities for HTML and React apps","directories":{},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"_nodeVersion":"10.9.0","dependencies":{"parse5":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.4.0","husky":"^0.14.0","react":"^16.4.1","colors":"^1.1.2","enzyme":"^3.3.0","prompt":"^1.0.0","rimraf":"^2.6.1","tslint":"^5.8.0","ts-jest":"^22.4.6","ts-node":"^6.0.0","typedoc":"^0.11.0","webpack":"^4.17.3","gh-pages":"^1.2.0","prettier":"^1.4.4","coveralls":"^3.0.0","cross-env":"^5.0.1","react-dom":"^16.4.1","ts-loader":"^5.1.0","commitizen":"^2.9.6","typescript":"^2.6.2","@types/jest":"^22.0.0","@types/node":"^10.0.3","jest-enzyme":"^6.0.2","lint-staged":"^7.0.0","webpack-cli":"^3.1.0","@types/react":"16.4.1","@types/enzyme":"^3.1.10","@types/parse5":"^5.0.0","tslint-loader":"^3.6.0","replace-in-file":"^3.0.0-beta.2","@types/react-dom":"^16.0.6","semantic-release":"^15.0.0","webpack-dev-server":"^3.1.8","validate-commit-msg":"^2.12.2","tslint-config-prettier":"^1.1.0","tslint-config-standard":"^7.0.0","enzyme-adapter-react-16":"^1.1.1","jest-environment-enzyme":"^6.0.2","cz-conventional-changelog":"^2.0.0","@types/enzyme-adapter-react-16":"^1.0.2","fork-ts-checker-webpack-plugin":"^0.4.9"},"peerDependencies":{"react":"^16.4","react-dom":"^16.4"},"_npmOperationalInternal":{"tmp":"tmp/text-decorator_1.0.0_1538747770079_0.8096029555341793","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@concord-consortium/text-decorator","version":"1.0.1","keywords":["text","decoration","text-decorator","html","rect","parse"],"author":{"name":"Concord Consortium","email":"developer@concord.org"},"license":"MIT","_id":"@concord-consortium/text-decorator@1.0.1","maintainers":[{"name":"cgreenhill","email":"clgreenhill@gmail.com"},{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"dougmartin","email":"doug@dougmart.in"},{"name":"dstrawberrygirl","email":"chart@concord.org"},{"name":"knowuh","email":"knowuh@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"piotrjanik","email":"janikpiotrek@gmail.com"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"sfentress","email":"sfentress@gmail.com"}],"homepage":"https://github.com/concord-consortium/text-decorator#readme","bugs":{"url":"https://github.com/concord-consortium/text-decorator/issues"},"dist":{"shasum":"b3f6fdfcc6ad2c3e4922a021a774357ff5203815","tarball":"https://registry.npmjs.org/@concord-consortium/text-decorator/-/text-decorator-1.0.1.tgz","fileCount":7,"integrity":"sha512-CT0TlbaRytptfVNfBWnmZ20R6F4JW4k865UVpt3V9j+GIgtEZl60VE293ANdGcN7ngeP0xMdGvqdPzgtTYxa0w==","signatures":[{"sig":"MEQCIEyCcEGjffPaOA9ZJYof25CmX5gd1E3xyqMGcWftIItHAiA9/u3pALKEuMh48WBVQXMVQbz4wUSdMzffiljqLICulA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":247566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrJJ/CRA9TVsSAnZWagAASZEP/0LM/mgf2nA2jL8MDuyh\nDjy/gTBo2iBxSUKMmwbFscpYN04SlXwp5kW1d7OqcgZnTQx2qEsYj96V81eW\nN1SR9UTMl/+2D1FU5/MexGI7znZy9znjKRhYw/NcqrxffjU6TV7pAWOEfKcg\nv9h0wqnorevQ1I4u/Ik6i6nL6WXlJFt+zekb8Mie0hYR/Dh1PvFUnGw+W+Jr\ntV+7p2vGqkymUl6om1I6hNZmbQjD/j0DTBUsMrn2vQAGv81CnXwUEZsO3WsV\nWqXwvezqRCdzn/VUTpeCQokT2QNNXZydANoNkiBiWEZKW+96HLjItUTDj9ds\nmFLx/YvytYYZhv1HPFHaa32qPnFQ45vhw4HoCrFwd/icpWGD8uir80bT7fI+\nTrlnmNgSnLnQKdqz0QNWY7HO2xE53exnTgi7VXe/ex+DF4MpAXGObq2Jm7zS\nFVsXm2LCL0Z4ZYdWrt0k03Xlz3A/gm3aK0DQ8Tiixat07DZWvJHp/ghmQQJY\ng1IIDtVNhWAh7EXaLacnZ8Fe1BCfKFQ62DdCI4VnERZxNAkQEYwfcXHO7ev3\nV+lvHhyEl9yYuMq9HKvOllGxw6ifz/8SpgeDyFerkJjwIWILj64rVFAp8pWm\neKUDEJQapBSo3rMeEljkmQInMirQ7MJ362Ud/uedI6zSKJM+4rRfWJ5PsP/Z\npbrH\r\n=Vuzg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","transform":{".(ts|tsx)":"ts-jest/preprocessor.js"},"collectCoverage":true,"testEnvironment":"enzyme","coverageThreshold":{"global":{"lines":95,"branches":90,"functions":95,"statements":95}},"moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"setupTestFrameworkScriptFile":"./node_modules/jest-enzyme/lib/index.js"},"main":"dist/text-decorator.js","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"validate-commit-msg":{"types":"conventional-commit-types","helpMessage":"Use \"npm run commit\" instead, we use conventional-changelog format :) (https://github.com/commitizen/cz-cli)"}},"engines":{"node":">=6.0.0"},"gitHead":"aea4ca99d6921991c45e0bb1ab23f3d250bca55b","scripts":{"lint":"tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","test":"jest","build":"tsc --module commonjs && webpack --mode production --devtool false && typedoc --out docs --target es6 --theme minimal --mode file src","commit":"git-cz","lint:fix":"tslint --fix -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","prebuild":"rimraf dist","precommit":"lint-staged","test:prod":"npm run lint && npm run test -- --coverage --no-cache","test:watch":"jest --watch","test:coverage":"jest --coverage","deploy:gh-pages":"npm run build && ./tools/deploy-gh-pages.js","report-coverage":"cat ./coverage/lcov.info | coveralls","semantic-release":"semantic-release","semantic-release-prepare":"ts-node tools/semantic-release-prepare"},"typings":"dist/types/text-decorator.d.ts","_npmUser":{"name":"piotrjanik","email":"janikpiotrek@gmail.com"},"prettier":{"semi":true,"singleQuote":true},"repository":{"url":"git+https://github.com/concord-consortium/text-decorator.git","type":"git"},"_npmVersion":"6.9.0","description":"The TextDecorator library provides text decoration capabilities for HTML and React apps","directories":{},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"_nodeVersion":"10.9.0","dependencies":{"parse5":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.4.0","husky":"^0.14.0","react":"^16.4.1","colors":"^1.1.2","enzyme":"^3.3.0","prompt":"^1.0.0","rimraf":"^2.6.1","tslint":"^5.8.0","ts-jest":"^22.4.6","ts-node":"^6.0.0","typedoc":"^0.11.0","webpack":"^4.17.3","gh-pages":"^1.2.0","prettier":"^1.4.4","coveralls":"^3.0.0","cross-env":"^5.0.1","react-dom":"^16.4.1","ts-loader":"^5.1.0","commitizen":"^2.9.6","typescript":"^2.6.2","@types/jest":"^22.0.0","@types/node":"^10.0.3","jest-enzyme":"^6.0.2","lint-staged":"^7.0.0","webpack-cli":"^3.1.0","@types/react":"16.4.1","@types/enzyme":"^3.1.10","@types/parse5":"^5.0.0","tslint-loader":"^3.6.0","replace-in-file":"^3.0.0-beta.2","@types/react-dom":"^16.0.6","semantic-release":"^15.0.0","webpack-dev-server":"^3.1.8","validate-commit-msg":"^2.12.2","tslint-config-prettier":"^1.1.0","tslint-config-standard":"^7.0.0","enzyme-adapter-react-16":"^1.1.1","jest-environment-enzyme":"^6.0.2","cz-conventional-changelog":"^2.0.0","@types/enzyme-adapter-react-16":"^1.0.2","fork-ts-checker-webpack-plugin":"^0.4.9"},"peerDependencies":{"react":"^16.4","react-dom":"^16.4"},"_npmOperationalInternal":{"tmp":"tmp/text-decorator_1.0.1_1554813566507_0.6291814466370094","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@concord-consortium/text-decorator","version":"1.0.2","keywords":["text","decoration","text-decorator","html","rect","parse"],"author":{"name":"Concord Consortium","email":"developer@concord.org"},"license":"MIT","_id":"@concord-consortium/text-decorator@1.0.2","maintainers":[{"name":"cgreenhill","email":"clgreenhill@gmail.com"},{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"dougmartin","email":"doug@dougmart.in"},{"name":"dstrawberrygirl","email":"chart@concord.org"},{"name":"knowuh","email":"knowuh@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"piotrjanik","email":"janikpiotrek@gmail.com"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"sfentress","email":"sfentress@gmail.com"}],"homepage":"https://github.com/concord-consortium/text-decorator#readme","bugs":{"url":"https://github.com/concord-consortium/text-decorator/issues"},"dist":{"shasum":"1103582e270ced38d55e696ba0ae2244bbec2341","tarball":"https://registry.npmjs.org/@concord-consortium/text-decorator/-/text-decorator-1.0.2.tgz","fileCount":7,"integrity":"sha512-60+KWiUlJ9YhxgHPfJsDuizBUXgJ3J5MDPIkAZrkl6Zd/yryTEaSfnA0ax7btUGOwKnyiKZCcMdVrNPxVAZBtA==","signatures":[{"sig":"MEUCIFyfuMP30AfeP9dAyTuCQCNGH2HOOsY2e6p6BhFliUMDAiEAwEmtLNyOph85TVHVWmsRacu1pZKh9a6md++2GyiPN64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrJocCRA9TVsSAnZWagAAT3cP/1MOxqgP4Xes2qKTgqFX\nCdVqiAA24MXQ8VbZhp+nzouJW/D/BVoEg9NURdNFacTT5mm7zx4jf2LVssiK\nSxXWLZ7KaZnP+5UCpNaM5ZmgNwvJMeYuUUbePUjwfd8LA0Jl+QjhvQcTZFTH\ntZeyE6XAVIWRCEMMCuZiGKX3rEoKWUZ3kGrwDY+LkTno7Ixm5/LIBZcR1yZS\nSJPz7RYy9VL9I7toEkrpLs4voxXuFn86RV4ELxjGBc2STGZmbeziImczwh5R\n84ILRD02iUIulihjUOFO41pRuxmXQ0FvkUd1hudnyalM/NcHasHlWZjKJz17\nE+wOAaQiRvwT6AAIlidttrTTomJj9qdLS6MsaInC5NaggKwVJR6vniWNI4zk\nQzbpalSBsGe5dW8ae8xMvvV6E3QgXBzkiV9mjL7+jXx5xT7hVAW7KgzT0Wkh\naGmAVTzQw/bxUCsqwwbxZr8ypxL41LgLqK6fh/KVcOAquPOmlGgymbV6dIJ5\nSAy05IdZjpEibdk478zhegWUwMvGJOWsYl3uJXrKxd/KedQe6Zpztf+VTHas\niSv/nFz1e0gzQnBg65lBwEZLxpeQzmuh8MTBDwVg7X8B1ZPaiDBeJ08gaDoX\nDXvZv2YHz5IVIK2LMICv9B/LLBfExX5Ihm2Ns8icUIsDmdyVPhBDtGVwJEmO\nqOzW\r\n=KF0Z\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","transform":{".(ts|tsx)":"ts-jest/preprocessor.js"},"collectCoverage":true,"testEnvironment":"enzyme","coverageThreshold":{"global":{"lines":95,"branches":90,"functions":95,"statements":95}},"moduleFileExtensions":["ts","tsx","js"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"setupTestFrameworkScriptFile":"./node_modules/jest-enzyme/lib/index.js"},"main":"dist/text-decorator.js","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"validate-commit-msg":{"types":"conventional-commit-types","helpMessage":"Use \"npm run commit\" instead, we use conventional-changelog format :) (https://github.com/commitizen/cz-cli)"}},"engines":{"node":">=6.0.0"},"gitHead":"aea4ca99d6921991c45e0bb1ab23f3d250bca55b","scripts":{"lint":"tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","test":"jest","build":"tsc --module commonjs && webpack --devtool false && typedoc --out docs --target es6 --theme minimal --mode file src","commit":"git-cz","lint:fix":"tslint --fix -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","prebuild":"rimraf dist","precommit":"lint-staged","test:prod":"npm run lint && npm run test -- --coverage --no-cache","test:watch":"jest --watch","test:coverage":"jest --coverage","deploy:gh-pages":"npm run build && ./tools/deploy-gh-pages.js","report-coverage":"cat ./coverage/lcov.info | coveralls","semantic-release":"semantic-release","semantic-release-prepare":"ts-node tools/semantic-release-prepare"},"typings":"dist/types/text-decorator.d.ts","_npmUser":{"name":"piotrjanik","email":"janikpiotrek@gmail.com"},"prettier":{"semi":true,"singleQuote":true},"repository":{"url":"git+https://github.com/concord-consortium/text-decorator.git","type":"git"},"_npmVersion":"6.9.0","description":"The TextDecorator library provides text decoration capabilities for HTML and React apps","directories":{},"lint-staged":{"{src,test}/**/*.ts":["prettier --write","git add"]},"_nodeVersion":"10.9.0","dependencies":{"parse5":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.4.0","husky":"^0.14.0","react":"^16.4.1","colors":"^1.1.2","enzyme":"^3.3.0","prompt":"^1.0.0","rimraf":"^2.6.1","tslint":"^5.8.0","ts-jest":"^22.4.6","ts-node":"^6.0.0","typedoc":"^0.11.0","webpack":"^4.17.3","gh-pages":"^1.2.0","prettier":"^1.4.4","coveralls":"^3.0.0","cross-env":"^5.0.1","react-dom":"^16.4.1","ts-loader":"^5.1.0","commitizen":"^2.9.6","typescript":"^2.6.2","@types/jest":"^22.0.0","@types/node":"^10.0.3","jest-enzyme":"^6.0.2","lint-staged":"^7.0.0","webpack-cli":"^3.1.0","@types/react":"16.4.1","@types/enzyme":"^3.1.10","@types/parse5":"^5.0.0","tslint-loader":"^3.6.0","replace-in-file":"^3.0.0-beta.2","@types/react-dom":"^16.0.6","semantic-release":"^15.0.0","webpack-dev-server":"^3.1.8","validate-commit-msg":"^2.12.2","tslint-config-prettier":"^1.1.0","tslint-config-standard":"^7.0.0","enzyme-adapter-react-16":"^1.1.1","jest-environment-enzyme":"^6.0.2","cz-conventional-changelog":"^2.0.0","@types/enzyme-adapter-react-16":"^1.0.2","fork-ts-checker-webpack-plugin":"^0.4.9"},"peerDependencies":{"react":"^16.4","react-dom":"^16.4"},"_npmOperationalInternal":{"tmp":"tmp/text-decorator_1.0.2_1554815515947_0.6075385536035705","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-10-05T13:56:09.926Z","modified":"2025-12-03T22:25:42.521Z","1.0.0":"2018-10-05T13:56:10.411Z","1.0.1":"2019-04-09T12:39:26.653Z","1.0.2":"2019-04-09T13:11:56.113Z"},"bugs":{"url":"https://github.com/concord-consortium/text-decorator/issues"},"author":{"name":"Concord Consortium","email":"developer@concord.org"},"license":"MIT","homepage":"https://github.com/concord-consortium/text-decorator#readme","keywords":["text","decoration","text-decorator","html","rect","parse"],"repository":{"url":"git+https://github.com/concord-consortium/text-decorator.git","type":"git"},"description":"The TextDecorator library provides text decoration capabilities for HTML and React apps","maintainers":[{"email":"softwaredev@concord.org","name":"concordconsortium"},{"email":"scytacki@concord.org","name":"scytacki"},{"email":"doug@zoopdoop.com","name":"dougmartin"},{"email":"fristoe@gmail.com","name":"tealefristoe"},{"email":"kswenson@concord.org","name":"kswenson"},{"email":"emcelroy@concord.org","name":"emcelroy"}],"readme":"# Text Decorator\n\nThis project was created using the [TypeScript Library Starter](https://github.com/alexjoverm/typescript-library-starter#readme) project, whose local [README](README-typescript-library-starter) provides additional information about the configuration of the project.\n\n### Demos\n- [HTML Demo](https://concord-consortium.github.io/text-decorator/test/decorate-html.test.html)\n- [DOM Demo](https://concord-consortium.github.io/text-decorator/test/decorate-dom.test.html)\n- [React Demo](https://concord-consortium.github.io/text-decorator/test/decorate-react.test.html)\n\n### Docs\n\nhttps://concord-consortium.github.io/text-decorator/docs/\n\n## API\n\n### decorateDOMClasses\n`decorateDOMClasses(textClasses: string | string[], options: IDecorateHtmlOptions,\n                    wordClass?: string, listeners?: IEventListeners,\n                    container: Element | Document = document)`\n\nParses the innerHTML of DOM elements with the specified classes, replacing instances of words\nspecified in the options.words argument with the replacement string specified in options.replace.\nHandles HTML tags properly -- text will only be replaced in text, not in tags.\nAllows '$1' in the replacement string so that 'word' with a replacement string\nof `<span>\"$1\"</span>` would be replaced with `<span>\"word\"</span>`.\nAdds the specified event handlers to all elements with the specified class, which will\ncorrespond to each replaced word if the replacement string specifies an element with a class.\n\nIf this function is called multiple times on the same DOM node, it will create extraneous DOM\nelement nesting and redundant addition of event listeners. It is best used in contexts where\nit can be called immediately after the HTML content is rendered.\n\n- `textClasses`: string | string[] - a class or array of classes whose contents are to be decorated.\n  - The individual array elements are passed to `getElementsByClassName()`, so multiple space-delimited classes are ANDed together, i.e. all classes must be present to match, while the array elements are ORed, i.e. matching any array element constitutes a match.\n- `options`:\n  - `words`: string[] - a list of words to be decorated.\n    - Word-matching is case-insensitive.\n    - The words can include limited RegExp functionality:\n      - '.' - represents a wildcard character ('*' is not supported)\n      - '?' - makes the previous character optional\n      - '[', ']' - represents a set of possible characters, e.g. [aeiou] for a vowel\n  - `replace`: string - the replacement string.\n    - Can include '$1' representing the matched word.\n- `wordClass`: string - the class used for the enclosing tag (e.g. 'cc-glossary-word')\n- `listeners`: IEventListeners - one or more { type, listener } tuples\n- `container`: Element | Document - the scope within which to search for elements (defaults to the entire document)\n\n### decorateHtml\n`decorateHtml(input: string, options: IDecorateHtmlOptions)`\n\nParses the specified HTML input, replacing instances of words specified in the\noptions.words argument with the replacement string specified in options.replace.\nHandles HTML tags properly -- text will only be replaced in text, not in tags.\nAllows '$1' in the replacement string so that 'word' with a replacement string\nof `<span>$1</span>` would be replaced with `<span>word</span>`.\n\n- `input`: the HTML to be decorated as a string\n- `options`:\n  - `words`: string[] - a list of words to be decorated.\n    - Word-matching is case-insensitive.\n    - The words can include limited RegExp functionality:\n      - '.' - represents a wildcard character ('*' is not supported)\n      - '?' - makes the previous character optional\n      - '[', ']' - represents a set of possible characters, e.g. [aeiou] for a vowel\n  - `replace`: string - the replacement string.\n    - Can include '$1' representing the matched word.\n\n### decorateReact\n`decorateReact(input: ReactNode, options: IDecorateReactOptions): ReactNode`\n\nPost-processes the specified React virtual DOM, replacing instances of words specified in\nthe options.words argument with the replacement string specified in options.replace.\nHandles nested virtual DOM elements properly: text will only be replaced in text, not in tags.\n\nWhile this function can be called directly, it is anticipated that for most clients either\n`decorateReactHOC()`, the higher-order component (HOC) wrapper, or `DecorateChildren`, the\nparent component that supports decorating its children, will be more convenient.\n\n- `input`: the virtual DOM to be decorated\n- `options`:\n  - `words`: string[] - a list of words to be decorated.\n    - Word-matching is case-insensitive.\n    - The words can include limited RegExp functionality:\n      - '.' - represents a wildcard character ('*' is not supported)\n      - '?' - makes the previous character optional\n      - '[', ']' - represents a set of possible characters, e.g. [aeiou] for a vowel\n  - `replace`: the string or virtual DOM element with which to replace each matched word.\n    - The replace element can be coded in JSX/TSX.\n    - The replacement can include '$1' representing the matched word.\n    - If the replacement is a single empty element without a '$1', the '$1' is inferred,\n    i.e. `<span></span>` is treated like `<span>$1</span>`.\n\nEvent listeners can be included in the replace argument in typical React fashion, so\nthe addEventListeners() and removeEventListeners() functions need/should not be called.\n\n### addEventListeners/removeEventListeners\n`addEventListeners(className: string, listeners: IEventListeners, container: Element | Document = document)`\n`removeEventListeners(className: string, listeners: IEventListeners,container: Element | Document = document)`\n\nSince `decorateHtml()` is simply performing string replacement operations,\nit cannot add or remove any event handlers. Once the resulting HTML\nhas been added to the DOM, `addEventListeners()` can be called to\nadd handlers for 'click' or other events and the `removeEventListeners()`\nfunction can be used to remove those same event handlers.\n\n- `className`: string - the class used for the enclosing tag (e.g. 'cc-glossary-word')\n- `listeners`: IEventListeners - one or more { type, listener } tuples\n- `container`: Element | Document - the scope within which to search for elements (defaults to the entire document)\n\n### decorateReactHOC\n`decorateReactHOC(options: IDecorateReactOptions)`\n\nHigher-order component which can be used to wrap another component,\ndecorating text within the wrapped component.\n\n[Discussion](https://medium.com/@franleplant/react-higher-order-components-in-depth-cf9032ee6c3e) of \"render highjacking\" in a higher-order component using the \"inheritance inversion\" technique used here.\n\n[Discussion](https://medium.com/@jrwebdev/react-higher-order-component-patterns-in-typescript-42278f7590fb) of TypeScript types for higher-order components.\n\nUsage:\n```javascript\n class MyClass {\n   render() { ... }\n }\n export default decorateReactHOC(options)(MyClass);\n```\n### DecorateChildren\n`<DecorateChildren decorateOptions={...}> {...children...} </DecorateChildren>`\n\nReact component which decorates any text among its children.\n- decorateOptions must be passed in props.\n- See [Appendix B](https://medium.com/@franleplant/react-higher-order-components-in-depth-cf9032ee6c3e) for discussion of parent component versus higher-order component wrapper.\n","readmeFilename":"README.md"}