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

@clutch-creator/react-extension

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clutch-creator/react-extension - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

2

index.js

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

module.exports=function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=r,o.c=n,o.d=function(e,t,r){if(!o.o(e,t))Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){if("undefined"!=typeof Symbol&&Symbol.toStringTag)Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e)t=o(t);if(8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=20)}([function(e,t){e.exports=require("@clutch-creator/bridge")},function(e,t){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,t){e.exports=require("@babel/runtime/helpers/getPrototypeOf")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("lodash/get")},,function(e,t){e.exports=require("react-dom")},function(e,t){e.exports=require("@babel/runtime/helpers/slicedToArray")},function(e,t){e.exports=require("@babel/runtime/helpers/get")},,function(e,t){e.exports=require("@babel/runtime/helpers/classCallCheck")},function(e,t){e.exports=require("@babel/runtime/helpers/createClass")},function(e,t){e.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("@babel/runtime/helpers/inherits")},,function(e,t){e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},function(e,t){e.exports=require("@babel/runtime/helpers/assertThisInitialized")},,,,function(e,t,r){"use strict";r.r(t);var n=r(7),l=r.n(n),o=r(15),f=r.n(o),i=r(10),u=r.n(i),c=r(11),s=r.n(c),p=r(12),a=r.n(p),h=r(16),b=r.n(h),d=r(2),P=r.n(d),y=r(8),m=r.n(y),O=r(13),v=r.n(O),g=r(1),j=r.n(g),C=r(6),w=r(4),S=r.n(w),x=r(0),q=r.n(x),D=Object.prototype.hasOwnProperty;function N(e,t,r){if(e===t)return 1;if(!(e&&!t||t&&!e)){var n=0,o=0;for(var i in e){if(D.call(e,i)&&(r?!r(e[i],t[i]):e[i]!==t[i]))return;n+=1}for(var u in t)if(D.call(t,u))o+=1;return n===o}}var k=r(3);function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);if(e)n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable});r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};if(e%2)U(Object(r),!0).forEach(function(e){j()(t,e,r[e])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(t,Object.getOwnPropertyDescriptors(r));else U(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var R=function(e){var t=e.clutchProps;return t&&t.selection||t&&t.defaultSelection||{}},_=function(e,t,r,n,o){var i=e.selection,u=r,c=e.flowProps||{};if(n)c=Object.assign({},c,n),q.a.updateComponentOutboundProps(i,t,n);if("function"==typeof r)u=r(c,o,i);else if(void 0===r)u=null;return u};function M(e,t){var r,n=function(e,t){var c=this;if("function"!=typeof e)return console.error("First argument of useClutch must be a function."),t;var s=e(t),r=S()(s,["clutchProps","propsTypes"],{}),p=s&&s.clutchProps||{},i=p.masterProps,u=p.flowProps;return s=Object.entries(r).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if("Children"===o)return E({},e,j()({},n,_.bind(c,p,n,s[n])));if("Styles"!==o||"production"===process.env.NODE_ENV)return e;var i=s[n],u=Object(x.getUniqueClassName)(R(s),n);return E({},e,j()({},n,{className:Object(x.classnames)(i&&i.className,u),style:i&&i.style||{}}))},s),s=Object.entries(s).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if(!("function"!=typeof o||o.prototype&&o.prototype.isReactComponent))return E({},e,j()({},n,o.bind({masterProps:i,flowProps:u})));else return e},s)}(e,t),o=R(n),i=(r=n.clutchProps)&&r.parentSelection||{},u=S()(t,["clutchProps","masterProps"]),c=n.clutchProps,s=Object(k.useCallback)(function(){q.a.registerComponent(o,i,u)},[]);return Object(k.useEffect)(function(){return function(){q.a.unregisterComponent(o)}},[]),s(),n.ref=function(e){q.a.registerComponentReference(o,e)},q.a.updateComponentInboundProps(o,c&&c.flowProps),delete n.clutchProps,n}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);if(e)n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable});r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};if(e%2)T(Object(r),!0).forEach(function(e){j()(t,e,r[e])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(t,Object.getOwnPropertyDescriptors(r));else T(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function W(e){return function(e){function i(e,t){var r;u()(this,i),r=a()(this,P()(i).call(this,e,t)),j()(b()(r),"clutchUpdateRef",function(e){var t=!e||e.tagName?e:Object(C.findDOMNode)(e);if(r.node!==t)r.node=t,q.a.registerComponentReference(r.getClutchSelection(),r.node)});var n=(r.props.clutchProps||{}).flowProps;return r.flowProps=n||{},r}return v()(i,e),s()(i,[{key:"shouldComponentUpdate",value:function(e,t){var r=this.props,n=r.clutchProps,o=void 0===n?{}:n,i=f()(r,["clutchProps"]),u=e.clutchProps,c=void 0===u?{}:u,s=f()(e,["clutchProps"]),p=(c||{}).flowProps;return this.flowProps=p||{},!N(i,s)||!N(t,this.state)||!N(o.flowProps,c.flowProps)}},{key:"componentDidUpdate",value:function(e,t,r){if(m()(P()(i.prototype),"componentDidUpdate",this))m()(P()(i.prototype),"componentDidUpdate",this).call(this,e,t,r);var n=this.props.clutchProps,o=this.getClutchSelection();q.a.updateComponentMasterProps(o,this.masterProps),q.a.updateComponentInboundProps(o,n&&n.flowProps)}},{key:"componentWillUnmount",value:function(){if(m()(P()(i.prototype),"componentWillUnmount",this))m()(P()(i.prototype),"componentWillUnmount",this).call(this);q.a.unregisterComponent(this.getClutchSelection())}},{key:"getClutchSelection",value:function(e){var t=(0<arguments.length&&void 0!==e?e:this.props).clutchProps;return t&&t.selection||S()(this.masterProps,["clutchProps","defaultSelection"])||t&&t.defaultSelection}},{key:"useClutch",value:function(e,t){var c=this;if("function"!=typeof e)return console.error("First argument of useClutch must be a function."),t;var s=e(t),r=S()(s,["clutchProps","propsTypes"],{});if(s=Object.entries(r).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if("Children"===o)return I({},e,j()({},n,c.renderClutchChildren.bind(c,n,s[n])));if("Styles"!==o||"production"===process.env.NODE_ENV)return e;var i=s[n],u=Object(x.getUniqueClassName)(c.getClutchSelection(s),n);return I({},e,j()({},n,{className:Object(x.classnames)(i&&i.className,u),style:i&&i.style||{}}))},s),s=Object.entries(s).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if(!("function"!=typeof o||o.prototype&&o.prototype.isReactComponent))return I({},e,j()({},n,o.bind(c)));else return e},s),this.masterProps=Object.assign({},s),s.ref=this.clutchUpdateRef,!this.clutchRegistered)this.clutchRegistered=!0,q.a.registerComponent(this.getClutchSelection(),S()(this.props,["clutchProps","parentSelection"]),S()(this.props,["clutchProps","masterProps"])),q.a.updateComponentInboundProps(this.getClutchSelection(),this.flowProps);return delete s.clutchProps,s}},{key:"render",value:function(){return m()(P()(i.prototype),"render",this).call(this)}},{key:"renderClutchChildren",value:function(e,t,r,n){var o=this.getClutchSelection(),i=t,u=(this.props.clutchProps||{}).flowProps||{};if(r)u=Object.assign({},u,r),q.a.updateComponentOutboundProps(o,e,r);if("function"==typeof t)i=t(u,n,o);else if(void 0===t)i=null;return i}}]),i}(e)}r.d(t,"default",function(){return W}),r.d(t,"useClutch",function(){return M})}]);
module.exports=function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=r,o.c=n,o.d=function(e,t,r){if(!o.o(e,t))Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){if("undefined"!=typeof Symbol&&Symbol.toStringTag)Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e)t=o(t);if(8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=20)}([function(e,t){e.exports=require("@clutch-creator/bridge")},function(e,t){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,t){e.exports=require("@babel/runtime/helpers/getPrototypeOf")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("lodash/get")},,function(e,t){e.exports=require("react-dom")},function(e,t){e.exports=require("@babel/runtime/helpers/slicedToArray")},function(e,t){e.exports=require("@babel/runtime/helpers/get")},,function(e,t){e.exports=require("@babel/runtime/helpers/classCallCheck")},function(e,t){e.exports=require("@babel/runtime/helpers/createClass")},function(e,t){e.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("@babel/runtime/helpers/inherits")},,function(e,t){e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},function(e,t){e.exports=require("@babel/runtime/helpers/assertThisInitialized")},,,,function(e,t,r){"use strict";r.r(t);var n=r(7),l=r.n(n),o=r(15),f=r.n(o),i=r(10),u=r.n(i),c=r(11),s=r.n(c),p=r(12),a=r.n(p),h=r(16),b=r.n(h),d=r(2),P=r.n(d),y=r(8),m=r.n(y),O=r(13),v=r.n(O),g=r(1),j=r.n(g),C=r(6),w=r(4),S=r.n(w),x=r(0),q=r.n(x),D=Object.prototype.hasOwnProperty;function N(e,t,r){if(e===t)return 1;if(!(e&&!t||t&&!e)){var n=0,o=0;for(var i in e){if(D.call(e,i)&&(r?!r(e[i],t[i]):e[i]!==t[i]))return;n+=1}for(var u in t)if(D.call(t,u))o+=1;return n===o}}var k=r(3);function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);if(e)n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable});r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};if(e%2)U(Object(r),!0).forEach(function(e){j()(t,e,r[e])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(t,Object.getOwnPropertyDescriptors(r));else U(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var R=function(e){var t=e.clutchProps;return t&&t.selection||t&&t.defaultSelection||{}},_=function(e,t,r,n,o){var i=R({clutchProps:e}),u=r,c=e.flowProps||{};if(n)c=Object.assign({},c,n),q.a.updateComponentOutboundProps(i,t,n);if("function"==typeof r)u=r(c,o,i);else if(void 0===r)u=null;return u};function M(e,t){var r,n=function(e,t){var c=this;if("function"!=typeof e)return console.error("First argument of useClutch must be a function."),t;var s=e(t),r=S()(s,["clutchProps","propsTypes"],{}),p=s&&s.clutchProps||{},i=p.masterProps,u=p.flowProps;return s=Object.entries(r).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if("Children"===o)return E({},e,j()({},n,_.bind(c,p,n,s[n])));if("Styles"!==o||"production"===process.env.NODE_ENV)return e;var i=s[n],u=Object(x.getUniqueClassName)(R(s),n);return E({},e,j()({},n,{className:Object(x.classnames)(i&&i.className,u),style:i&&i.style||{}}))},s),s=Object.entries(s).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if(!("function"!=typeof o||o.prototype&&o.prototype.isReactComponent))return E({},e,j()({},n,o.bind({masterProps:i,flowProps:u})));else return e},s)}(e,t),o=R(n),i=(r=n.clutchProps)&&r.parentSelection||{},u=S()(t,["clutchProps","masterProps"]),c=n.clutchProps,s=Object(k.useCallback)(function(){q.a.registerComponent(o,i,u)},[]);return Object(k.useEffect)(function(){return function(){q.a.unregisterComponent(o)}},[]),s(),n.ref=function(e){q.a.registerComponentReference(o,e)},q.a.updateComponentInboundProps(o,c&&c.flowProps),delete n.clutchProps,n}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);if(e)n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable});r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};if(e%2)T(Object(r),!0).forEach(function(e){j()(t,e,r[e])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(t,Object.getOwnPropertyDescriptors(r));else T(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function W(e){return function(e){function i(e,t){var r;u()(this,i),r=a()(this,P()(i).call(this,e,t)),j()(b()(r),"clutchUpdateRef",function(e){var t=!e||e.tagName?e:Object(C.findDOMNode)(e);if(r.node!==t)r.node=t,q.a.registerComponentReference(r.getClutchSelection(),r.node)});var n=(r.props.clutchProps||{}).flowProps;return r.flowProps=n||{},r}return v()(i,e),s()(i,[{key:"shouldComponentUpdate",value:function(e,t){var r=this.props,n=r.clutchProps,o=void 0===n?{}:n,i=f()(r,["clutchProps"]),u=e.clutchProps,c=void 0===u?{}:u,s=f()(e,["clutchProps"]),p=(c||{}).flowProps;return this.flowProps=p||{},!N(i,s)||!N(t,this.state)||!N(o.flowProps,c.flowProps)}},{key:"componentDidUpdate",value:function(e,t,r){if(m()(P()(i.prototype),"componentDidUpdate",this))m()(P()(i.prototype),"componentDidUpdate",this).call(this,e,t,r);var n=this.props.clutchProps,o=this.getClutchSelection();q.a.updateComponentMasterProps(o,this.masterProps),q.a.updateComponentInboundProps(o,n&&n.flowProps)}},{key:"componentWillUnmount",value:function(){if(m()(P()(i.prototype),"componentWillUnmount",this))m()(P()(i.prototype),"componentWillUnmount",this).call(this);q.a.unregisterComponent(this.getClutchSelection())}},{key:"getClutchSelection",value:function(e){var t=(0<arguments.length&&void 0!==e?e:this.props).clutchProps;return t&&t.selection||S()(this.masterProps,["clutchProps","defaultSelection"])||t&&t.defaultSelection}},{key:"useClutch",value:function(e,t){var c=this;if("function"!=typeof e)return console.error("First argument of useClutch must be a function."),t;var s=e(t),r=S()(s,["clutchProps","propsTypes"],{});if(s=Object.entries(r).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if("Children"===o)return I({},e,j()({},n,c.renderClutchChildren.bind(c,n,s[n])));if("Styles"!==o||"production"===process.env.NODE_ENV)return e;var i=s[n],u=Object(x.getUniqueClassName)(c.getClutchSelection(s),n);return I({},e,j()({},n,{className:Object(x.classnames)(i&&i.className,u),style:i&&i.style||{}}))},s),s=Object.entries(s).reduce(function(e,t){var r=l()(t,2),n=r[0],o=r[1];if(!("function"!=typeof o||o.prototype&&o.prototype.isReactComponent))return I({},e,j()({},n,o.bind(c)));else return e},s),this.masterProps=Object.assign({},s),s.ref=this.clutchUpdateRef,!this.clutchRegistered)this.clutchRegistered=!0,q.a.registerComponent(this.getClutchSelection(),S()(this.props,["clutchProps","parentSelection"]),S()(this.props,["clutchProps","masterProps"])),q.a.updateComponentInboundProps(this.getClutchSelection(),this.flowProps);return delete s.clutchProps,s}},{key:"render",value:function(){return m()(P()(i.prototype),"render",this).call(this)}},{key:"renderClutchChildren",value:function(e,t,r,n){var o=this.getClutchSelection(),i=t,u=(this.props.clutchProps||{}).flowProps||{};if(r)u=Object.assign({},u,r),q.a.updateComponentOutboundProps(o,e,r);if("function"==typeof t)i=t(u,n,o);else if(void 0===t)i=null;return i}}]),i}(e)}r.d(t,"default",function(){return W}),r.d(t,"useClutch",function(){return M})}]);
{
"name": "@clutch-creator/react-extension",
"version": "0.0.9",
"version": "0.0.10",
"description": "Clutch extension for react components",

@@ -5,0 +5,0 @@ "main": "index.js",

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