Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-plaid-link

Package Overview
Dependencies
Maintainers
7
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-plaid-link - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

8

CHANGELOG.md
# Changelog
## 3.1.0
- Ensure Link is destroyed correctly (#146)
- Export `PlaidLinkOptions` typescript types (#134)
- (Internal) Bump node-fetch from 2.6.0 to 2.6.1 (#136)
- (Internal) Bump elliptic from 6.5.2 to 6.5.3 (#127)
- (Internal) Bump lodash from 4.17.15 to 4.17.19 (#124)
- Fix a bug with the usePlaidLink `ready` state (#163)
## 3.0.0

@@ -4,0 +12,0 @@

2

dist/index.d.ts

@@ -95,2 +95,2 @@ /// <reference types="react" />

declare const PlaidLink: React.FC<PlaidLinkPropTypes>;
export { usePlaidLink, PlaidLink };
export { usePlaidLink, PlaidLink, PlaidLinkOptions };

@@ -95,2 +95,2 @@ /// <reference types="react" />

declare const PlaidLink: React.FC<PlaidLinkPropTypes>;
export { usePlaidLink, PlaidLink };
export { usePlaidLink, PlaidLink, PlaidLinkOptions };

@@ -258,2 +258,3 @@ import react, { useState, useEffect } from 'react';

onExit: function onExit() {
state.open = false;
config.onExit && config.onExit.apply(config, arguments);

@@ -381,3 +382,3 @@ state.onExitCallback && state.onExitCallback();

error: error,
ready: !loading || iframeLoaded,
ready: plaid != null && (!loading || iframeLoaded),
exit: plaid ? plaid.exit : noop,

@@ -384,0 +385,0 @@ open: plaid ? plaid.open : noop

@@ -265,2 +265,3 @@ 'use strict';

onExit: function onExit() {
state.open = false;
config.onExit && config.onExit.apply(config, arguments);

@@ -388,3 +389,3 @@ state.onExitCallback && state.onExitCallback();

error: error,
ready: !loading || iframeLoaded,
ready: plaid != null && (!loading || iframeLoaded),
exit: plaid ? plaid.exit : noop,

@@ -391,0 +392,0 @@ open: plaid ? plaid.open : noop

@@ -95,2 +95,2 @@ /// <reference types="react" />

declare const PlaidLink: React.FC<PlaidLinkPropTypes>;
export { usePlaidLink, PlaidLink };
export { usePlaidLink, PlaidLink, PlaidLinkOptions };

@@ -264,2 +264,3 @@ (function (global, factory) {

onExit: function onExit() {
state.open = false;
config.onExit && config.onExit.apply(config, arguments);

@@ -387,3 +388,3 @@ state.onExitCallback && state.onExitCallback();

error: error,
ready: !loading || iframeLoaded,
ready: plaid != null && (!loading || iframeLoaded),
exit: plaid ? plaid.exit : noop,

@@ -390,0 +391,0 @@ open: plaid ? plaid.open : noop

@@ -95,2 +95,2 @@ /// <reference types="react" />

declare const PlaidLink: React.FC<PlaidLinkPropTypes>;
export { usePlaidLink, PlaidLink };
export { usePlaidLink, PlaidLink, PlaidLinkOptions };

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).PlaidLink={},e.React)}(this,(function(e,t){"use strict";var n="default"in t?t.default:t;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=e[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f(e,t){return e(t={exports:{}},t.exports),t.exports}var d=f((function(e,t){var r=u&&u.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.src,i=e.checkForExisting,l=void 0!==i&&i,a=r(e,["src","checkForExisting"]),u=n.useState(!0),c=u[0],f=u[1],d=n.useState(null),p=d[0],s=d[1];return n.useEffect((function(){if(o){if(l)if(document.querySelectorAll('script[src="'+t+'"]').length>0)return void f(!1);var e=document.createElement("script");e.setAttribute("src",t),Object.keys(a).forEach((function(t){void 0===e[t]?e.setAttribute(t,a[t]):e[t]=a[t]}));var n=function(){f(!1)},r=function(e){s(e)};return e.addEventListener("load",n),e.addEventListener("error",r),document.body.appendChild(e),function(){e.removeEventListener("load",n),e.removeEventListener("error",r)}}}),[t]),[c,p]};var o="undefined"!=typeof window&&void 0!==window.document}));c(d);var p=c(f((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d.default}))),s=function(e){var t={plaid:null,open:!1,onExitCallback:null};if("undefined"==typeof window||!window.Plaid)throw new Error("Plaid not loaded");var n,o,l,a,u=(n=e,o="publicKey",l="key",a={},delete Object.assign(a,n,r({},l,n[o]))[o],a);t.plaid=window.Plaid.create(i({},u,{onExit:function(){u.onExit&&u.onExit.apply(u,arguments),t.onExitCallback&&t.onExitCallback()}}));return{open:function(){t.plaid&&(t.open=!0,t.onExitCallback=null,t.plaid.open())},exit:function(e,n){t.open&&t.plaid?(t.onExitCallback=n,t.plaid.exit(e),e&&e.force&&(t.open=!1)):n&&n()},destroy:function(){t.plaid&&(t.plaid.destroy(),t.plaid=null)}}},y=function(){},b=function(e){var n=a(p({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),2),r=n[0],o=n[1],l=a(t.useState(null),2),u=l[0],c=l[1],f=a(t.useState(!1),2),d=f[0],b=f[1],v=(e.product||[]).slice().sort().join(",");return t.useEffect((function(){if(!r){if(!o&&window.Plaid){null!=u&&u.exit({force:!0},(function(){return u.destroy()}));var t=s(i({},e,{onLoad:function(){b(!0),e.onLoad&&e.onLoad()}}));return c(t),function(){return t.exit({force:!0},(function(){return t.destroy()}))}}console.error("Error loading Plaid",o)}}),[r,o,e.token,v]),{error:o,ready:!r||d,exit:u?u.exit:y,open:u?u.open:y}},v=function(e){var t=e.children,r=e.style,o=e.className,a=l(e,["children","style","className"]),u=b(i({},a)),c=u.error,f=u.open;return n.createElement("button",{disabled:Boolean(c),type:"button",className:o,style:i({padding:"6px 4px",outline:"none",background:"#FFFFFF",border:"2px solid #F1F1F1",borderRadius:"4px"},r),onClick:function(){return f()}},t)};v.displayName="PlaidLink",e.PlaidLink=v,e.usePlaidLink=b,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).PlaidLink={},e.React)}(this,(function(e,t){"use strict";var n="default"in t?t.default:t;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var l,u=e[Symbol.iterator]();!(r=(l=u.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f(e,t){return e(t={exports:{}},t.exports),t.exports}var d=f((function(e,t){var r=a&&a.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.src,i=e.checkForExisting,l=void 0!==i&&i,u=r(e,["src","checkForExisting"]),a=n.useState(!0),c=a[0],f=a[1],d=n.useState(null),p=d[0],s=d[1];return n.useEffect((function(){if(o){if(l)if(document.querySelectorAll('script[src="'+t+'"]').length>0)return void f(!1);var e=document.createElement("script");e.setAttribute("src",t),Object.keys(u).forEach((function(t){void 0===e[t]?e.setAttribute(t,u[t]):e[t]=u[t]}));var n=function(){f(!1)},r=function(e){s(e)};return e.addEventListener("load",n),e.addEventListener("error",r),document.body.appendChild(e),function(){e.removeEventListener("load",n),e.removeEventListener("error",r)}}}),[t]),[c,p]};var o="undefined"!=typeof window&&void 0!==window.document}));c(d);var p=c(f((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d.default}))),s=function(e){var t={plaid:null,open:!1,onExitCallback:null};if("undefined"==typeof window||!window.Plaid)throw new Error("Plaid not loaded");var n,o,l,u,a=(n=e,o="publicKey",l="key",u={},delete Object.assign(u,n,r({},l,n[o]))[o],u);t.plaid=window.Plaid.create(i({},a,{onExit:function(){t.open=!1,a.onExit&&a.onExit.apply(a,arguments),t.onExitCallback&&t.onExitCallback()}}));return{open:function(){t.plaid&&(t.open=!0,t.onExitCallback=null,t.plaid.open())},exit:function(e,n){t.open&&t.plaid?(t.onExitCallback=n,t.plaid.exit(e),e&&e.force&&(t.open=!1)):n&&n()},destroy:function(){t.plaid&&(t.plaid.destroy(),t.plaid=null)}}},y=function(){},b=function(e){var n=u(p({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),2),r=n[0],o=n[1],l=u(t.useState(null),2),a=l[0],c=l[1],f=u(t.useState(!1),2),d=f[0],b=f[1],v=(e.product||[]).slice().sort().join(",");return t.useEffect((function(){if(!r){if(!o&&window.Plaid){null!=a&&a.exit({force:!0},(function(){return a.destroy()}));var t=s(i({},e,{onLoad:function(){b(!0),e.onLoad&&e.onLoad()}}));return c(t),function(){return t.exit({force:!0},(function(){return t.destroy()}))}}console.error("Error loading Plaid",o)}}),[r,o,e.token,v]),{error:o,ready:null!=a&&(!r||d),exit:a?a.exit:y,open:a?a.open:y}},v=function(e){var t=e.children,r=e.style,o=e.className,u=l(e,["children","style","className"]),a=b(i({},u)),c=a.error,f=a.open;return n.createElement("button",{disabled:Boolean(c),type:"button",className:o,style:i({padding:"6px 4px",outline:"none",background:"#FFFFFF",border:"2px solid #F1F1F1",borderRadius:"4px"},r),onClick:function(){return f()}},t)};v.displayName="PlaidLink",e.PlaidLink=v,e.usePlaidLink=b,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "react-plaid-link",
"version": "3.0.0",
"version": "3.1.0",
"description": "A React component for Plaid Link",

@@ -5,0 +5,0 @@ "files": [

@@ -111,10 +111,1 @@ # react-plaid-link [![npm version](https://badge.fury.io/js/react-plaid-link.svg)](http://badge.fury.io/js/react-plaid-link)

## Publishing
You'll need NPM publishing rights for your NPM user. Then you can run:
```
make release-(patch|minor|major)
```
Read [semver](https://semver.org/) to determine what type of version bump to use.

@@ -49,2 +49,3 @@ import { PlaidLinkOptions, Plaid } from './types';

onExit: (...params: any) => {
state.open = false;
config.onExit && config.onExit(...params);

@@ -51,0 +52,0 @@ state.onExitCallback && state.onExitCallback();

export { usePlaidLink } from './usePlaidLink';
export { PlaidLink } from './PlaidLink';
export { PlaidLinkOptions } from './types'

@@ -65,3 +65,3 @@ import { useEffect, useState } from 'react';

error,
ready: !loading || iframeLoaded,
ready: plaid != null && (!loading || iframeLoaded),
exit: plaid ? plaid.exit : noop,

@@ -68,0 +68,0 @@ open: plaid ? plaid.open : noop,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc