react-text-illuminator
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -14,3 +14,3 @@ 'use strict'; | ||
_ref$highlightColor = _ref.highlightColor, | ||
highlightColor = _ref$highlightColor === void 0 ? 'yellow' : _ref$highlightColor; | ||
highlightColor = _ref$highlightColor === void 0 ? '#ffff00' : _ref$highlightColor; | ||
var highlight = function highlight(textContent, highlightTerm) { | ||
@@ -17,0 +17,0 @@ var escapeRegExp = function escapeRegExp(string) { |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;exports.default=function(e){var r=e.highlightTerm,n=e.highlightColor,l=void 0===n?"yellow":n;return t.createElement("p",null,function(e,r){if(!r.trim()||""===r)return[t.createElement("span",{key:"0"},e)];var n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("("+n+")","gi");return e.split(o).map((function(e,r){return o.test(e.toLowerCase())?t.createElement("span",{key:r,style:{backgroundColor:l}},e):t.createElement("span",{key:r},e)}))}(e.textContent,void 0===r?"":r))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;exports.default=function(e){var r=e.highlightTerm,n=e.highlightColor,a=void 0===n?"#ffff00":n;return t.createElement("p",null,function(e,r){if(!r.trim()||""===r)return[t.createElement("span",{key:"0"},e)];var n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("("+n+")","gi");return e.split(o).map((function(e,r){return o.test(e.toLowerCase())?t.createElement("span",{key:r,style:{backgroundColor:a}},e):t.createElement("span",{key:r},e)}))}(e.textContent,void 0===r?"":r))}; | ||
//# sourceMappingURL=react-text-illuminator.cjs.production.min.js.map |
@@ -8,3 +8,3 @@ import React from 'react'; | ||
_ref$highlightColor = _ref.highlightColor, | ||
highlightColor = _ref$highlightColor === void 0 ? 'yellow' : _ref$highlightColor; | ||
highlightColor = _ref$highlightColor === void 0 ? '#ffff00' : _ref$highlightColor; | ||
var highlight = function highlight(textContent, highlightTerm) { | ||
@@ -11,0 +11,0 @@ var escapeRegExp = function escapeRegExp(string) { |
{ | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -5,12 +5,30 @@ # ReactTextIlluminator | ||
[![size](https://img.shields.io/bundlephobia/minzip/react-text-illuminator?style=for-the-badge)](https://bundlephobia.com/package/react-text-illuminator) | ||
[![Blazing Fast](https://badgen.now.sh/badge/SPEED/BLAZING%20%F0%9F%94%A5/green)](https://npm.im/react-text-illuminator) | ||
## Installation | ||
You can install the ReactTextIlluminator component via npm: | ||
You can install the ReactTextIlluminator component | ||
via npm: | ||
```bash | ||
npm i react-text-illuminator | ||
``` | ||
or via yarn: | ||
```bash | ||
yarn add react-text-illuminator | ||
``` | ||
## Features | ||
- Text Highlighting | ||
- Customization of Highlight Term | ||
- Customization of Highlight Color | ||
- Support for Complex Text | ||
- Escape of Special Characters | ||
## Props | ||
@@ -20,7 +38,7 @@ | ||
| Prop | Type | Description | Default Value | | ||
| ---------------- | -------- | ---------------------------------------------------- | ------------- | | ||
| `textContent` | `string` | The text content to be displayed. | - | | ||
| `highlightTerm` | `string` | The text to be highlighted within the `textContent`. | - | | ||
| `highlightColor` | `string` | The background color used for highlighting. | `"yellow"` | | ||
| Prop | Type | Description | Default Value | | ||
| ---------------- | -------- | ---------------------------------------------------- | ---------------------------------------------------------------- | | ||
| `textContent` | `string` | The text content to be displayed. | - | | ||
| `highlightTerm` | `string` | The text to be highlighted within the `textContent`. | - | | ||
| `highlightColor` | `string` | The background color used for highlighting. | ![#00d1a0](https://via.placeholder.com/10/ffff00?text=+) #ffff00 | | | ||
@@ -50,1 +68,17 @@ ## Usage | ||
``` | ||
## Documentation | ||
[Documentation](https://github.com/fredarcito/react-text-illuminator) | ||
## License | ||
[MIT](https://choosealicense.com/licenses/mit/) | ||
## 🚀 About Me | ||
Hello everyone, I'm fredarcito, a Frontend engineer in constant learning. I only know that I don't know anything, but Google knows. | ||
## Feedback | ||
If you have any feedback, please reach out to us at freddy@gogrow.dev |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17867
82