Giter Club home page Giter Club logo

react-obfuscate's Introduction

coston

react-obfuscate's People

Contributors

bostrom avatar charlesbdudley avatar coston avatar dalbitresb12 avatar dependabot[bot] avatar greenkeeper[bot] avatar mic avatar ravinggenius avatar renovate-bot avatar renovate[bot] avatar timmygee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-obfuscate's Issues

Still encountering reversal for emails containing dashes

Email addresses containing dashes are still reversed for me similar to #30

This bug appears for me on recent versions of both Chrome and Firefox.

Things I've tried:

  • Per the readme I tried adding a span around the Obfuscate element
  • Also per the readme I tried setting style={{display:'inline-block'}} on the element
  • I tested the element with style={{ unicodeBidi: 'isolate-overide'}} which was mentioned in #29
  • And I also tested the element with style={{ display:'inline-block', unicodeBidi: 'bidi-overide'}}

For context, I'm using the Obfuscate element within an html table. It's the only element within the table cell, and I am not using consecutive inline elements inside a block element.

Oddly enough, each reversed email (the ones containing dashes) also appears visually with a line break before/after the breakpoint.

Allow overriding component via prop

It would be useful to override the rendered component to allow using (for instance) a <span />. Something like:

<Obfuscate component="span" skipHref>whatever</Obfuscate>

could render as:

<span style="unicode-bidi: isolate-override; direction: rtl;">revetahw</span>

Parantheses

<Obfuscate tel="(347) 855 6622" />

renders as

)347( 855 6622

is this expected behavior?

Allow Option to not Obfuscation of Children

Suggested feature:

Sometimes, I turn a person's name into a link to their email. It would be nice to have a property to not obfuscate the children.

   <Obfuscate email={staff.email} obfuscateChildren={false}>{staff.name}</Obfuscate>

Ability to specify render component

Hi @coston, thank you for putting out this component! I was wondering if you've considered adding an option to specify the render component to be a custom component?

In my particular case, I already have a custom styled Link component that I rather that this is uses, and I imagine might be the case for others as well.

mouseOver disables props.onClick

Describe the bug
onClick (props.onClick) is called only if this.state.humanInteraction === false. If the cursor has entered the link area, this.state.humanInteraction === true, so the passed onClick prop function is not called.
See handleCopiability and handleClick methods (code below).
Happy to make a PR if you agree this is an issue.
Otherwise, what am I missing?

To Reproduce

  • Give instance of <Obfuscate /> a custom onClick method eg
    <Obfuscate onClick={() => console.log('test'} />
  • Click it
  • <Obfuscate /> will descramble the link, but the onClick method does not get called.

Expected behavior
When user clicks, the onClick prop will be called before the deobfuscation method(s), as implied in docs.

Relevant lines

  handleClick(event) {
    const { onClick } = this.props

    // If focused or hovered, this js will be skipped with preference for html
    if (this.state.humanInteraction === false) { // <--- 1. THIS IS NOT SATISFIED AFTER USER HOVER 
      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()                                                  // <--- 2. SO THIS IS NOT CALLED 
      }

      window.location.href = this.createContactLink(this.props)
    }
  }

Email containing dash is breaking

Hi,

when I upgraded your package to the latest version, I suddenly started seeing a visual issue with an email address that contains a dash.

screen shot 2019-01-22 at 11 27 51

I'm not 100% sure but it looks like the cause is the display: inline-block you introduced with "Use bidi-overide > isolate-overide for browser compatibility" (8e75c4a). If I remove that, the email address looks fine again.

Can't resolve 'react' in '.....react-obfuscate/dist'

Describe the bug
I'm using this package with GatsbyJS, it works fine in the local build or develop, however on deploying to Netlify I get the following error:

Can't resolve 'react' in '/opt/build/repo/node_modules/react-obfuscate/dist'
6:43:45 PM: File: ../node_modules/react-obfuscate/dist/obfuscate.js

Additional context
I'm getting the following as advice from VSCode:
module "..../node_modules/react-obfuscate/dist/obfuscate"
Could not find a declaration file for module 'react-obfuscate'. '..../node_modules/react-obfuscate/dist/obfuscate.js' implicitly has an 'any' type.
Try npm install @types/react-obfuscate if it exists or add a new declaration (.d.ts) file containing declare module 'react-obfuscate';ts(7016)

Missing PropTypes runtime error

On initial install into a simple project, I receive a full-page critical error within this package. This should be a simple fix of removing this package's dependency on prop-types.

./~/react-obfuscate/dist/obfuscate.js
Module not found: Error: Cannot resolve module 'prop-types' in /Users/Dawson/code/personal/www/node_modules/react-obfuscate/dist
resolve module prop-types in /Users/Dawson/code/personal/www/node_modules/react-obfuscate/dist
  looking for modules in /Users/Dawson/code/personal/www/node_modules/next/node_modules
    /Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types doesn't exist (module as directory)
    resolve 'file' prop-types in /Users/Dawson/code/personal/www/node_modules/next/node_modules
      resolve file
        /Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types doesn't exist
        /Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.webpack.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.web.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.json doesn't exist
  looking for modules in /Users/Dawson/code/personal/www/node_modules
    /Users/Dawson/code/personal/www/node_modules/prop-types doesn't exist (module as directory)
    resolve 'file' prop-types in /Users/Dawson/code/personal/www/node_modules
      resolve file
        /Users/Dawson/code/personal/www/node_modules/prop-types doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.webpack.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.web.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.json doesn't exist
  looking for modules in /Users/Dawson/code/personal/www/node_modules
    /Users/Dawson/code/personal/www/node_modules/prop-types doesn't exist (module as directory)
    resolve 'file' prop-types in /Users/Dawson/code/personal/www/node_modules
      resolve file
        /Users/Dawson/code/personal/www/node_modules/prop-types doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.webpack.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.web.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.js doesn't exist
        /Users/Dawson/code/personal/www/node_modules/prop-types.json doesn't exist
[/Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types]
[/Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types]
[/Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.webpack.js]
[/Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.web.js]
[/Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.js]
[/Users/Dawson/code/personal/www/node_modules/next/node_modules/prop-types.json]
[/Users/Dawson/code/personal/www/node_modules/prop-types]
[/Users/Dawson/code/personal/www/node_modules/prop-types]
[/Users/Dawson/code/personal/www/node_modules/prop-types]
[/Users/Dawson/code/personal/www/node_modules/prop-types]
[/Users/Dawson/code/personal/www/node_modules/prop-types.webpack.js]
[/Users/Dawson/code/personal/www/node_modules/prop-types.webpack.js]
[/Users/Dawson/code/personal/www/node_modules/prop-types.web.js]
[/Users/Dawson/code/personal/www/node_modules/prop-types.web.js]
[/Users/Dawson/code/personal/www/node_modules/prop-types.js]
[/Users/Dawson/code/personal/www/node_modules/prop-types.js]
[/Users/Dawson/code/personal/www/node_modules/prop-types.json]
[/Users/Dawson/code/personal/www/node_modules/prop-types.json]
 @ ./~/react-obfuscate/dist/obfuscate.js 15:17-38

SSR 404 error link

Describe the bug
Que using react-obfuscate on a Next.js repository, Google complains of non existing links caused by the library. All these links have the /obfuscate in the URL.

To Reproduce

  1. Use the obfuscate component
  2. Inspect the website on SSR
  3. See that the link is /obfuscate

Expected behavior
I expect that the website either doesn't have that link or doesn't render the component at all on SSR. Also, consider CSR because it might happen the same.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency @testing-library/react to v15.0.5
  • chore(deps): update linter packages (@commitlint/cli, @commitlint/config-conventional, eslint-plugin-react-hooks)
  • chore(deps): update react packages to v18.3.1 (react, react-dom)
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/nodejs-ci.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • @babel/cli 7.24.1
  • @babel/core 7.24.4
  • @babel/eslint-parser 7.24.1
  • @babel/plugin-transform-runtime 7.24.3
  • @babel/plugin-transform-spread 7.24.1
  • @babel/preset-env 7.24.4
  • @babel/preset-react 7.24.1
  • @commitlint/cli 19.2.1
  • @commitlint/config-conventional 19.1.0
  • @testing-library/jest-dom ^6.4.2
  • @testing-library/react ^15.0.2
  • babel-jest 29.7.0
  • coveralls 3.1.1
  • eslint ^8
  • eslint-config-airbnb 19.0.4
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jsx-a11y 6.8.0
  • eslint-plugin-prettier 5.1.3
  • eslint-plugin-react 7.34.1
  • eslint-plugin-react-hooks 4.6.0
  • husky 9.0.11
  • jest ^29.7.0
  • jest-environment-jsdom ^29.7.0
  • lint-staged 15.2.2
  • next 13.4.7
  • prettier 3.2.5
  • prop-types 15.8.1
  • react 18.2.0
  • react-dom 18.2.0
  • react-live 4.1.6
  • react-window-ui 2.2.0
  • prop-types >= 15
  • react >= 16.8
  • react-dom >= 16.8
  • node >= 0.10.0
nvm
.nvmrc
  • node 20
travis
.travis.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Typescript types declaration

Hi guys. Very helpful component; thanks to everyone who contributed!

Project I'm working on has strict types and I've defined basic type declarations for the Obfuscate component.

Are you willing to bundle complete types with the NPM package if I create a pull request containing them?

Links are backwards in some cases

I have an address block like this:

<address>
	<Obfuscate email="[email protected]" />
	<br />
	<Obfuscate tel="+420 111 222 333" />
</address>

The second link always turns and stays backwards when I mouse over it.

I started just randomly messing with the tags and characters around Obfuscate to see what would happen and managed to work around the problem by doing this:

<address>
	<span>
		{' '}
		<Obfuscate email="[email protected]" />
	</span>
	<br />
	<span>
		{' '}
		<Obfuscate tel="+420 111 222 333" />
	</span>
</address>

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

Prop to explicitly obscure children

It would be nice if link text was obscured, even if it may not need to be. Below I have an example of a human formatted phone number as the link text. It doesn't get obscured, which kind of defeats the purpose of using Obfuscate. I could "work around" this by simply omitting the children prop, but then the nicely formatted number would not be displayed.

const telephone = '+15553219876';
const formatted = '+1 555 321.9876';

<Obfuscate tel={telephone}>{formatted}</Obfuscate>

Before interaction:

<a href="obfuscated" style="unicode-bidi: isolate-override; direction: ltr;">+1 919 321.9876</a>

After interaction:

<a href="obfuscated" style="unicode-bidi: isolate-override; direction: ltr;">+1 919 321.9876</a>

Obfuscate emails in compiled js

Is your feature request related to a problem? Please describe.
Assuming a normal build process and the example usage described in README.md, the example input produces an output that specifies the email in plaintext in the .js that is served. In this case, usage of react-obfuscate provides no protection, because certainly a malicious web-crawler which goes to the greater difficulty of rendering the DOM to harvest emails will also scan the .js for emails.

Describe the solution you'd like
I suggest that README.md should not claim that the <Obfuscate> component makes the email or link given in the example useless for spammers, and should detail the additional steps required to protect emails and links from spammers.

Given that there are 12,000 downloads per month for this package, improving it to obfuscate the children and props of the <Obfuscate> tag in the compiled source might be worth doing.

Describe alternatives you've considered
javascript-obfuscator can be used mangle string literals in source code appropriately, or they might be scrambled by hand and recovered with vanilla JavaScript.

Multiple obfuscations incompatible with css columns?

When using multiple obfuscations and using css columns, the first obfuscation doesn't display properly, but fixes itself after hover, the code I am using:

<div with class columns>
  ...
          <p className="staff serif">
            <em>Staff</em>
            <br />
            {site.member.map((member, i) => (
              <React.Fragment key={i}>
                <Obfuscate
                  style={{ display: "inline-block" }}
                  email={member.email}
                >{`${member.name}, ${member.role}`}</Obfuscate>
                {site.member[i + 1] && <br />}
              </React.Fragment>
            ))}
          </p>
  ...
</div with class columns>

In the above code, the first member appears text-aligned right, with the words in reverse order, until I hover on them and they then appear properly.

When I remove the css columns property from the div, this fixes the issue.

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.18.2 to 1.19.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build passed (Details).
  • coverage/coveralls: First build on greenkeeper/prettier-1.19.0 at 100.0% (Details).
  • build (macOS-latest, 12.x): null
  • build (macOS-latest, 10.x): null
  • build (macOS-latest, 8.x): null
  • build (windows-latest, 12.x): There are 2 failures, 0 warnings, and 0 notices.
  • build (windows-latest, 10.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (windows-latest, 8.x): There are 2 failures, 0 warnings, and 0 notices.
  • build (ubuntu-latest, 12.x): null
  • build (ubuntu-latest, 10.x): null
  • build (ubuntu-latest, 8.x): null

Release Notes for Prettier 1.19: Long awaited Vue option, TypeScript 3.7 and new JavaScript features

diff

🔗 Release Notes

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of next is breaking the build 🚨

The devDependency next was updated from 9.1.1 to 9.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

next is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build passed (Details).
  • coverage/coveralls: First build on greenkeeper/next-9.1.2 at 100.0% (Details).
  • build (macOS-latest, 12.x): null
  • build (macOS-latest, 10.x): null
  • build (macOS-latest, 8.x): null
  • build (windows-latest, 12.x): null
  • build (windows-latest, 10.x): null
  • build (windows-latest, 8.x): null
  • build (ubuntu-latest, 12.x): null
  • build (ubuntu-latest, 10.x): null
  • build (ubuntu-latest, 8.x): null

Release Notes for v9.1.2

Minor Changes

  • Add StrictMode toggle: #9161
  • Allow NextScript to optionally defer javascript: #8980

Patches

  • Fix can-not-output-to-public error title: #8988
  • Remove pass-server-data example: #8992
  • Add extra note about canary branch in contributing: #8991
  • Update AMP Optimizer to 1.1.1: #8994
  • Update resetting log for spinners: #8995
  • Monkeypatch @zeit/[email protected]: #8996
  • Add src directory support for global CSS: #8999
  • Update README-zh-CN.md static-file-serving-eg-images: #9002
  • Add CSS fixture for src dir: #9001
  • Fix global Bluebird causing HMR connection to fail: #9009
  • Change to public folder in with-loading example: #9016
  • Update Auth0 example with new version: #9020
  • Next offline: #9010
  • Test no-path relative CSS imports: #9028
  • Add buildId to SPR data routes: #8929
  • Do Not Rely on Module State: #8968
  • Add @zeit/fetch example: #9029
  • Update to error on usage of serverRuntimeConfig with serverless: #9030
  • Replace the deprecated Create Next App URL: #9032
  • Trigger error overlay for dynamic route mismatch: #9031
  • Updated multiple examples to use /public: #9033
  • Update storybook example to v5.2 with CSF: #9036
  • Update README.md: #9040
  • Remove static optimization from message: #9045
  • Fix a minor typo in link: #9049
  • [Docs] Update static file serving section: #9062
  • Remove _document context: #9068
  • Update framework chunk test regex to not select nested dependencies: #9012
  • Fix import in @zeit/fetch example: #9074
  • Pin Azure Chromedriver: #9075
  • Update no-document-title.md: #9082
  • Temporary: Add Support for Now Platform Headers: #9085
  • Temporary: SPR: Use Group Index Mapping: #9089
  • Fix SPR always revalidating in production: #9091
  • Optimize script tags: #9048
  • [using-preact] Update example to Preact X: #9079
  • Fix language fallback in with-react-intl example: #8894
  • Update legacy _app context: #9083
  • Simplify with-noscript example: #9094
  • Update with-react-toolbox example to use /public: #9099
  • [using-inferno] Update inferno to v7.3, fix missing React.createContext function: #9038
  • [with-typescript] Updated TypeScript example to use API routes: #9073
  • Fix SPR header name: #9104
  • Update to return JSON if data request: #9106
  • Add the example of Tailwind CSS with emotion: #8931
  • Remove inferno example: #9108
  • Don't mark page as nextExport if it's SPR: #9113
  • Update with-prefetching example: #9101
  • Dedupe meta tags: #8960
  • Refactor with-modal example: #9097
  • Refactor with-context-api example to use functional components: #9092
  • Make sure to update scope for page export declaration: #9115
  • Allow manually setting amphtml: #9098
  • Support Concurrent Mode in Loadable: #9026
  • Warn on No Cache in CI: #9116
  • Update granular chunks to produce up to 25 chunks per entrypoint on high-complexity apps: #9129
  • Netlify cms example: #8949
  • Update Prerender Error Message: #9143
  • Upgrade React dependencies: #9152
  • Test react(-dom)@canary Every 12 Hours: #9151
  • Fix apollo server initialization in api-routes-apollo-server-and-client example: #9137
  • Upgrade Lockfile: #9158
  • Test React integration using next dist-tag: #9165
  • Cache No-Revalidate Pages: #9170
  • Add yarn check to tests: #9163
  • Add WSL to Metadata: #9171
  • Record src directory usage with version: #9023
  • Add Purgecss to with-tailwindcss example: #9145
  • Fix with-tailwindcss build issues: #9179
  • Check Files during Install: #9182
  • Reenable AMP Tests: #9162
  • Docs(api-routes): fix micro-cors example: #9184
  • Update with-mdx example to latest packages: #9186
  • Ensure directory before flushing cache file: #9187
  • Ensure that all <link> elements have a key prop: #9204
  • Update Babel dependencies: #9203
  • Update with-react-intl example: #9180
  • API: Take multiple values into account for the query: #9196
  • Fix react-native-web example by adding babel plugin: #9078
  • Fix examples #9064: bumps next-redux-wrapper package version that contains babel runtime fix: #9214
  • Remove react-ssr-prepass from Next Deps: #9224
  • Add warning for getStaticParams without getStaticProps: #9226
  • Add configuration flags to disable integrated type checker: #9138
  • Disable worker_threads by default for firebase compatibility: #9199
  • Restore package.json and yarn.lock to allow deploy: #9230
  • Split TypeScript Flag Docs: #9231
  • Delete _document.js: #9236
  • Update examples: static export using dynamic routes: #9237

Credits

Huge thanks to @tusbar, @karlhorky, @sebastianbenz, @ykzts, @manfwh, @ijjk, @ismamz, @sandrinodimattia, @armspkt, @timneutkens, @lfades, @rafaelalmeidatk, @SZharkov, @Baukaalm, @iNishant, @devknoll, @atcastle, @guswnsxodlf, @s-h-a-d-o-w, @HaNdTriX, @resir014, @firstziiz, @melanieseltzer, @iliran11, @Timer, @masives, @none23, @acdlite, @taylorbryant, @zackkrida, @htbvo, @midudev, @bitjson, @ctavan, @YUFENGWANG, @Janpot, @flybayer, @meuwka, @kachkaev, and @juanmiguelbesada for helping!

Commits

The new version differs by 102 commits.

  • acf7d0a v9.1.2
  • 07b46d7 Update examples: static export using dynamic routes instead exp… (#9237)
  • cb7a184 v9.1.2-canary.10
  • d40f010 Delete _document.js (#9236)
  • 4dbd267 Split TypeScript Flag Docs (#9231)
  • f5969d2 Restore package.json and yarn.lock to allow deploy (#9230)
  • 14ed867 Disable worker_threads by default for firebase compatibility (#9199)
  • ad2a3d6 Add configuration flags to disable integrated type checker (#9138)
  • 2d9f199 Add warning for getStaticParams without getStaticProps (#9226)
  • 34e0ce6 Remove react-ssr-prepass from Next Deps (#9224)
  • 4584ea4 Fix examples #9064: bumps next-redux-wrapper package version that contains babel runtime fix (#9214)
  • 1c11ffd Fix react-native-web example by adding babel plugin (#9078)
  • ab0a864 API: Take multiple values into account for the query (#9196)
  • 20978af v9.1.2-canary.9
  • 211c84e allow NextScript to optionally defer javascript (#8980)

There are 102 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Email link backwards

I know it's basically a core of the obfuscation of the package, but it has one really big downside - many people don't click on a link but copy it and then paste it to their email app. And with this package, the pasted email is backwards. Would it be possible to solve this somehow?

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add support for PropTypes.elementType in the element prop

Is your feature request related to a problem? Please describe.

I'm using Obfuscate with Chakra UI, a component library for React, that provides a Link component that is already on-brand and with useful utilities. Obfuscate works fine passing a React element type in the element prop, but the prop types validation expects only a string, not a React element type.

Example usage:

import { Link } from '@chakra-ui/react';
import Obfuscate from 'react-obfuscate';

function MyComponent() {
  return (
    <Obfuscate email="[email protected]" element={Link} />
  );
}

This works, but it produces the following console error log:

Warning: Failed prop type: Invalid prop `element` of type `object` supplied to `Obfuscate`, expected `string`.

Describe the solution you'd like

Probably just update the following line:

// obfuscate.js line 129
- element: T.string,
- element: T. oneOfType([T.string, T.elementType]),

Line: https://github.com/coston/react-obfuscate/blob/master/src/obfuscate.js#L129

and add a unit test for this scenario.

Describe alternatives you've considered

No alternatives considered yet!

--

I'd be happy to make this contribution, just want to open the issue first in case the element prop only accepts strings by design.

Thanks

--

EDIT: I realized later that there's a problem with the output, and the resulting a tag when setting element={Link} doesn't have an href 😅. That is because of the check here that is specifically doing Component === 'a'. Is there a reason for that, or could it be removed to pass those props in all cases?

Screenshot 2023-01-12 at 18 07 29

Add className prop

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
I would like to have a className prop instead of wrapping component in a div/p

Describe alternatives you've considered
Wrapping the component in an HTML element like p

Additional context
N/A

Thank you!

target="_blank" does not open new tab

<Obfuscate
  element="a"
  href="https://www.google.com"
  target="_blank"
  style={{
    textAlign: "left",
  }}
>
  Click Here
</Obfuscate>

Having target="_blank" does not open a new tab, but instead directs current window to the href.

Support for custom href links

I was trying to add a "click to whatsapp chat" on my page which is a regular href link with the user's phone number.
https://wa.me/phonenumber
https://faq.whatsapp.com/en/android/26000030/

Some other apps, such as skype use href="skype:..". Would it be possible for the user to specify a custom url and protocol so react-obfuscate could virtually support any url?

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.6.4 to 7.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build passed (Details).
  • coverage/coveralls: First build on greenkeeper/monorepo.babel7-20191105110141 at 100.0% (Details).
  • build (macOS-latest, 12.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (macOS-latest, 10.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (macOS-latest, 8.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (windows-latest, 12.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (windows-latest, 10.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (windows-latest, 8.x): There are 1 failures, 0 warnings, and 0 notices.
  • build (ubuntu-latest, 12.x): null
  • build (ubuntu-latest, 10.x): null
  • build (ubuntu-latest, 8.x): null

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Is linkText is obsolete?

I tried using the linkText property but it didn't work. For example:

<Obfuscate tel="1-800-222-333" linkText="800.222.333" />

However, the following works fine. I wonder if the readme.md needs to be updated.

<Obfuscate tel="1-800-222-333">800.222.333</Obfuscate>

Add type definitions

There are no type-definitions for this package here or on DefinitelyTyped.
This way it can not be properly used in Typescript projects.

Please add these if possible. Would be much appreciated. 🙏

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.