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

@shift-studio/react-extension

Package Overview
Dependencies
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shift-studio/react-extension - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

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=21)}([function(e,t){e.exports=require("@shift-studio/bridge")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@babel/runtime/helpers/getPrototypeOf")},function(e,t){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,t){e.exports=require("@babel/runtime/helpers/objectSpread")},function(e,t){e.exports=require("@babel/runtime/helpers/slicedToArray")},,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/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(4),a=r.n(n),o=r(5),c=r.n(o),i=r(16),l=r.n(i),s=r(11),u=r.n(s),f=r(12),p=r.n(f),h=r(13),d=r.n(h),b=r(2),v=r.n(b),m=r(9),S=r.n(m),P=r(14),y=r.n(P),g=r(17),O=r.n(g),j=r(3),C=r.n(j),x=r(8),w=r(7),q=r.n(w),N=r(0),k=r.n(N),R=Object.prototype.hasOwnProperty;function U(e,t,r){if(e===t)return!0;if(e&&!t||t&&!e)return!1;var n=0,o=0;for(var i in e){if(R.call(e,i)&&(r?!r(e[i],t[i]):e[i]!==t[i]))return!1;n+=1}for(var s in t)if(R.call(t,s))o+=1;return n===o}var E=r(1),_=function(e){var t=e.shiftProps;return t&&t.selection||{}},D=function(e,t,r){var n=k.a.getComponentState(r)||{},o=a()({},n,C()({},t,e));k.a.updateComponentState(r,o)};var T=function(e,t,r,n,o){var i=e.selection,s=r,u=e.flowProps||{};if(n)u=Object.assign({},u,n),k.a.updateComponentOutboundProps(i,t,n);if("function"==typeof r)s=r(u,o,i);else if(void 0===r)s=null;return s};function M(e,t){var s=this,u=e(t),r=q()(u,["shiftProps","propsTypes"],{}),f=u&&u.shiftProps||{},i=f.masterProps,p=f.flowProps;return Object.entries(r).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("Children"===o)return a()({},e,C()({},n,T.bind(s,f,n,u[n])));if("ShiftStyles"!==o||"production"===process.env.NODE_ENV)return e;var i=u[n];return a()({},e,C()({},n,{className:Object(N.classnames)(i&&i.className,Object(N.getUniqueClassName)(s.getShiftSelection(u),n))}))},u),Object.entries(u).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("function"==typeof o)return a()({},e,C()({},n,o.bind({masterProps:i,flowProps:p})));else return e},u),u}function I(e,t){var r=M(e,t);return{useRef:function(e,t){var r=_(e),n=Object(E.useRef)(t);return Object(E.useEffect)(function(){if(n)k.a.registerComponentReference(r,n.current)},[n]),n}.bind(void 0,r),useState:function(t,r,e){if(void 0===r)throw new Error("No key provided for useShiftState");var n=Object(E.useState)(e),o=c()(n,2),i=o[0],s=o[1];return Object(E.useEffect)(function(){var e=_(t);D(i,r,e)},[i]),[i,s]}.bind(void 0,r),useReducer:function(t,r,e,n){if(void 0===r)throw new Error("No key provided for useShiftReducer");var o=Object(E.useReducer)(e,n),i=c()(o,2),s=i[0],u=i[1];return Object(E.useEffect)(function(){var e=_(t);D(s,r,e)},[s]),[s,u]}.bind(void 0,r)}}function W(e,t){var r,n=M(e,t),o=_(n),i=(r=n.shiftProps)&&r.parentSelection||{},s=Object(E.useState)(),u=c()(s,2)[1],f=Object(E.useCallback)(function(){return u({})},[]),p=o.shiftProps;return Object(E.useEffect)(function(){return k.a.registerComponent(o,i,f,u),k.a.updateComponentInboundProps(o,p&&p.flowProps),function(){k.a.unregisterComponent(o)}},[]),n}function V(e){return function(e){function o(e,t){var r;u()(this,o),r=d()(this,v()(o).call(this,e,t)),C()(O()(O()(r)),"shiftRefUpdated",function(e){var t=!e||e.tagName?e:Object(x.findDOMNode)(e);if(r.node!==t)r.node=t,k.a.registerComponentReference(r.getShiftSelection(),r.node)}),r.state=Object.assign({},r.state);var n=(r.props.shiftProps||{}).flowProps;return r.flowProps=n||{},r}return y()(o,e),p()(o,[{key:"shouldComponentUpdate",value:function(e,t){var r=this.props,n=r.shiftProps,o=void 0===n?{}:n,i=l()(r,["shiftProps"]),s=e.shiftProps,u=void 0===s?{}:s,f=l()(e,["shiftProps"]),p=(u||{}).flowProps;return this.flowProps=p||{},!U(i,f)||!U(t,this.state)||!U(o.flowProps,u.flowProps)}},{key:"componentDidUpdate",value:function(e,t,r){if(S()(v()(o.prototype),"componentDidUpdate",this))S()(v()(o.prototype),"componentDidUpdate",this).call(this,e,t,r);var n=this.props.shiftProps;if(k.a.updateComponentInboundProps(this.getShiftSelection(),n&&n.flowProps),!U(t,this.state))k.a.updateComponentState(this.getShiftSelection(),this.state)}},{key:"componentWillUnmount",value:function(){if(S()(v()(o.prototype),"componentWillUnmount",this))S()(v()(o.prototype),"componentWillUnmount",this).call(this);k.a.unregisterComponent(this.getShiftSelection())}},{key:"getShiftSelection",value:function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.props).shiftProps;return e&&e.selection||q()(this.masterProps,["shiftProps","defaultSelection"])||e&&e.defaultSelection}},{key:"useShift",value:function(e,t){var u=this;if("function"!=typeof e)return console.error("First argument of useShift must be a function."),t;var f=e(t),r=q()(f,["shiftProps","propsTypes"],{});if(f=Object.entries(r).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("Children"===o)return a()({},e,C()({},n,u.renderShiftChildren.bind(u,n,f[n])));if("ShiftStyles"!==o||"production"===process.env.NODE_ENV)return e;var i=f[n],s=Object(N.getUniqueClassName)(u.getShiftSelection(f),n);return a()({},e,C()({},n,{className:Object(N.classnames)(i&&i.className,s),style:i&&i.style||{}}))},f),f=Object.entries(f).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("function"==typeof o)return a()({},e,C()({},n,o.bind(u)));else return e},f),this.masterProps=Object.assign({},f),!this.shiftRegistered)if(this.shiftRegistered=!0,k.a.registerComponent(this.getShiftSelection(),q()(this.props,["shiftProps","parentSelection"]),q()(this.props,["shiftProps","masterProps"]),this.forceUpdate.bind(this),this.setState.bind(this)),k.a.updateComponentInboundProps(this.getShiftSelection(),this.flowProps),this.state)k.a.updateComponentState(this.getShiftSelection(),this.state);return f}},{key:"render",value:function(){return S()(v()(o.prototype),"render",this).call(this)}},{key:"renderShiftChildren",value:function(e,t,r,n){var o=this.getShiftSelection(),i=t,s=(this.props.shiftProps||{}).flowProps||{};if(r)s=Object.assign({},s,r),k.a.updateComponentOutboundProps(o,e,r);if("function"==typeof t)i=t(s,n,o);else if(void 0===t)i=null;return i}}]),o}(e)}r.d(t,"default",function(){return V}),r.d(t,"useShift",function(){return W}),r.d(t,"useShiftHooks",function(){return I})}]);
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=21)}([function(e,t){e.exports=require("@shift-studio/bridge")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@babel/runtime/helpers/getPrototypeOf")},function(e,t){e.exports=require("@babel/runtime/helpers/defineProperty")},function(e,t){e.exports=require("@babel/runtime/helpers/objectSpread")},function(e,t){e.exports=require("@babel/runtime/helpers/slicedToArray")},,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/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(4),a=r.n(n),o=r(5),c=r.n(o),i=r(16),l=r.n(i),s=r(11),u=r.n(s),f=r(12),p=r.n(f),h=r(13),d=r.n(h),b=r(2),m=r.n(b),v=r(9),P=r.n(v),S=r(14),y=r.n(S),g=r(17),O=r.n(g),j=r(3),C=r.n(j),x=r(8),w=r(7),q=r.n(w),N=r(0),k=r.n(N),R=Object.prototype.hasOwnProperty;function U(e,t,r){if(e===t)return!0;if(e&&!t||t&&!e)return!1;var n=0,o=0;for(var i in e){if(R.call(e,i)&&(r?!r(e[i],t[i]):e[i]!==t[i]))return!1;n+=1}for(var s in t)if(R.call(t,s))o+=1;return n===o}var E=r(1),_=function(e){var t=e.shiftProps;return t&&t.selection||{}},D=function(e,t,r){var n=k.a.getComponentState(r)||{},o=a()({},n,C()({},t,e));k.a.updateComponentState(r,o)};var M=function(e,t,r,n,o){var i=e.selection,s=r,u=e.flowProps||{};if(n)u=Object.assign({},u,n),k.a.updateComponentOutboundProps(i,t,n);if("function"==typeof r)s=r(u,o,i);else if(void 0===r)s=null;return s};function T(e,t){var s=this,u=e(t),r=q()(u,["shiftProps","propsTypes"],{}),f=u&&u.shiftProps||{},i=f.masterProps,p=f.flowProps;return Object.entries(r).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("Children"===o)return a()({},e,C()({},n,M.bind(s,f,n,u[n])));if("ShiftStyles"!==o||"production"===process.env.NODE_ENV)return e;var i=u[n];return a()({},e,C()({},n,{className:Object(N.classnames)(i&&i.className,Object(N.getUniqueClassName)(s.getShiftSelection(u),n))}))},u),Object.entries(u).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("function"==typeof o)return a()({},e,C()({},n,o.bind({masterProps:i,flowProps:p})));else return e},u),u}function I(e,t){var r=T(e,t);return{useRef:function(e,t){var r=_(e),n=Object(E.useRef)(t);return Object(E.useEffect)(function(){if(n)k.a.registerComponentReference(r,n.current)},[n]),n}.bind(void 0,r),useState:function(t,r,e){if(void 0===r)throw new Error("No key provided for useShiftState");var n=Object(E.useState)(e),o=c()(n,2),i=o[0],s=o[1];return Object(E.useEffect)(function(){var e=_(t);D(i,r,e)},[i]),[i,s]}.bind(void 0,r),useReducer:function(t,r,e,n){if(void 0===r)throw new Error("No key provided for useShiftReducer");var o=Object(E.useReducer)(e,n),i=c()(o,2),s=i[0],u=i[1];return Object(E.useEffect)(function(){var e=_(t);D(s,r,e)},[s]),[s,u]}.bind(void 0,r)}}function W(e,t){var r,n=T(e,t),o=_(n),i=(r=n.shiftProps)&&r.parentSelection||{},s=Object(E.useState)(),u=c()(s,2)[1],f=Object(E.useCallback)(function(){return u({})},[]),p=o.shiftProps;return Object(E.useEffect)(function(){return k.a.registerComponent(o,i,f,u),k.a.updateComponentInboundProps(o,p&&p.flowProps),function(){k.a.unregisterComponent(o)}},[]),n}function V(e){return function(e){function i(e,t){var r;u()(this,i),r=d()(this,m()(i).call(this,e,t)),C()(O()(O()(r)),"shiftRefUpdated",function(e){var t=!e||e.tagName?e:Object(x.findDOMNode)(e);if(r.node!==t)r.node=t,k.a.registerComponentReference(r.getShiftSelection(),r.node)}),r.state=Object.assign({},r.state);var n=(r.props.shiftProps||{}).flowProps;return r.flowProps=n||{},r}return y()(i,e),p()(i,[{key:"shouldComponentUpdate",value:function(e,t){var r=this.props,n=r.shiftProps,o=void 0===n?{}:n,i=l()(r,["shiftProps"]),s=e.shiftProps,u=void 0===s?{}:s,f=l()(e,["shiftProps"]),p=(u||{}).flowProps;return this.flowProps=p||{},!U(i,f)||!U(t,this.state)||!U(o.flowProps,u.flowProps)}},{key:"componentDidUpdate",value:function(e,t,r){if(P()(m()(i.prototype),"componentDidUpdate",this))P()(m()(i.prototype),"componentDidUpdate",this).call(this,e,t,r);var n=this.props.shiftProps,o=this.getShiftSelection();if(k.a.updateComponentMasterProps(o,this.masterProps),k.a.updateComponentInboundProps(o,n&&n.flowProps),!U(t,this.state))k.a.updateComponentState(o,this.state)}},{key:"componentWillUnmount",value:function(){if(P()(m()(i.prototype),"componentWillUnmount",this))P()(m()(i.prototype),"componentWillUnmount",this).call(this);k.a.unregisterComponent(this.getShiftSelection())}},{key:"getShiftSelection",value:function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.props).shiftProps;return e&&e.selection||q()(this.masterProps,["shiftProps","defaultSelection"])||e&&e.defaultSelection}},{key:"useShift",value:function(e,t){var u=this;if("function"!=typeof e)return console.error("First argument of useShift must be a function."),t;var f=e(t),r=q()(f,["shiftProps","propsTypes"],{});if(f=Object.entries(r).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("Children"===o)return a()({},e,C()({},n,u.renderShiftChildren.bind(u,n,f[n])));if("ShiftStyles"!==o||"production"===process.env.NODE_ENV)return e;var i=f[n],s=Object(N.getUniqueClassName)(u.getShiftSelection(f),n);return a()({},e,C()({},n,{className:Object(N.classnames)(i&&i.className,s),style:i&&i.style||{}}))},f),f=Object.entries(f).reduce(function(e,t){var r=c()(t,2),n=r[0],o=r[1];if("function"==typeof o)return a()({},e,C()({},n,o.bind(u)));else return e},f),this.masterProps=Object.assign({},f),!this.shiftRegistered)if(this.shiftRegistered=!0,k.a.registerComponent(this.getShiftSelection(),q()(this.props,["shiftProps","parentSelection"]),q()(this.props,["shiftProps","masterProps"]),this.forceUpdate.bind(this),this.setState.bind(this)),k.a.updateComponentInboundProps(this.getShiftSelection(),this.flowProps),this.state)k.a.updateComponentState(this.getShiftSelection(),this.state);return f}},{key:"render",value:function(){return P()(m()(i.prototype),"render",this).call(this)}},{key:"renderShiftChildren",value:function(e,t,r,n){var o=this.getShiftSelection(),i=t,s=(this.props.shiftProps||{}).flowProps||{};if(r)s=Object.assign({},s,r),k.a.updateComponentOutboundProps(o,e,r);if("function"==typeof t)i=t(s,n,o);else if(void 0===t)i=null;return i}}]),i}(e)}r.d(t,"default",function(){return V}),r.d(t,"useShift",function(){return W}),r.d(t,"useShiftHooks",function(){return I})}]);
{
"name": "@shift-studio/react-extension",
"version": "0.0.5",
"version": "0.0.6",
"description": "Shift extension for react components",

@@ -25,3 +25,3 @@ "main": "index.js",

"peerDependencies": {
"@shift-studio/bridge": "^0.0.1",
"@shift-studio/bridge": "^0.0.3",
"react": ">=16.6.0",

@@ -28,0 +28,0 @@ "react-dom": ">=16.6.0"

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