react-obfuscate
Advanced tools
Comparing version 3.4.0 to 3.5.0-0
@@ -92,11 +92,14 @@ "use strict"; | ||
value: function handleClick(event) { | ||
var onClick = this.props.onClick; | ||
event.preventDefault(); // Allow instantiator to provide an onClick method to be called | ||
// before we change location (e.g. for analytics tracking) | ||
var onClick = this.props.onClick; // If focused or hovered, this js will be skipped with preference for html | ||
if (onClick && typeof onClick === 'function') { | ||
onClick(); | ||
if (this.state.humanInteraction === false) { | ||
event.preventDefault(); // Allow instantiator to provide an onClick method to be called | ||
// before we change location (e.g. for analytics tracking) | ||
if (onClick && typeof onClick === 'function') { | ||
onClick(); | ||
} | ||
window.location.href = this.createContactLink(this.props); | ||
} | ||
window.location.href = this.createContactLink(this.props); | ||
} | ||
@@ -103,0 +106,0 @@ }, { |
{ | ||
"name": "react-obfuscate", | ||
"version": "3.4.0", | ||
"version": "3.5.0-0", | ||
"description": "An intelligent React component to obfuscate any contact link", | ||
@@ -55,3 +55,3 @@ "main": "dist/obfuscate.js", | ||
"react-test-renderer": "^16.8.5", | ||
"react-window-ui": "^1.1.1" | ||
"react-window-ui": "^2.1.0" | ||
}, | ||
@@ -58,0 +58,0 @@ "jest": { |
@@ -73,17 +73,23 @@ # react-obfuscate | ||
## Options | ||
## Common Options | ||
| Prop | Type | Argument | Default | Description | | ||
| --------- | ----------- | ------------ | ------------ | -------------------------------------------------------------- | | ||
| email | `string` | `<optional>` | `null` | email address of the intended recipient | | ||
| tel | `string` | `<optional>` | `null` | telephone number of the intended recipient | | ||
| sms | `string` | `<optional>` | `null` | sms number of the intended recipient | | ||
| facetime | `string` | `<optional>` | `null` | facetime address of the intended recipient | | ||
| href | `string` | `<optional>` | `null` | Obfuscate any other URL type | | ||
| headers | `object` | `<optional>` | `null` | subject, cc, bcc, body, etc | | ||
| obfuscate | `boolean` | `<optional>` | `true` | set to false to disable obfuscation | | ||
| linkText | `string` | `<optional>` | `obfuscated` | add custom pre-interaction href attribute placeholder text | | ||
| element | `string` | `<optional>` | `'a'` | custom element to render instead of an `a` tag | | ||
| onClick | `function` | `<optional>` | `null` | called prior to setting location (e.g. for analytics tracking) | | ||
| Prop | Type | Argument | Default | Description | | ||
| -------- | -------- | ---------- | ------- | -------------------------------------------- | | ||
| email | `string` | `optional` | `null` | email address of the intended recipient | | ||
| headers | `object` | `optional` | `null` | subject, cc, bcc, body, etc | | ||
| tel | `string` | `optional` | `null` | telephone number of the intended recipient | | ||
| sms | `string` | `optional` | `null` | sms number of the intended recipient | | ||
| facetime | `string` | `optional` | `null` | facetime address of the intended recipient | | ||
| href | `string` | `optional` | `null` | Obfuscate any other URL type (e.g. WhatsApp) | | ||
## Uncommon Options | ||
| Prop | Type | Argument | Default | Description | | ||
| --------- | ---------- | ---------- | ------------ | -------------------------------------------------------------- | | ||
| linkText | `string` | `optional` | `obfuscated` | add custom pre-interaction href attribute placeholder text | | ||
| obfuscate | `boolean` | `optional` | `true` | set to false to disable obfuscation | | ||
| element | `string` | `optional` | `'a'` | use if you want to override the default `a` tag | | ||
| onClick | `function` | `optional` | `null` | called prior to setting location (e.g. for analytics tracking) | | ||
## Development | ||
@@ -90,0 +96,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
17155
137
144
1