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

frint-react

Package Overview
Dependencies
Maintainers
7
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frint-react - npm Package Compare versions

Comparing version 5.2.0 to 5.2.1

lib/isObservable.spec.js

2

dist/frint-react.js

@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

root["FrintReact"] = factory(root["React"], root["PropTypes"], root["Rx"], root["ReactDOM"], root["_"]["isPlainObject"], root["Rx"]["Observable"], root["Rx"]["Observable"], root["Rx"]["operators"], root["Rx"]["operators"], root["_"]["isEqual"], root["_"]["zipWith"], root["Rx"]["operators"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_14__, __WEBPACK_EXTERNAL_MODULE_15__, __WEBPACK_EXTERNAL_MODULE_16__, __WEBPACK_EXTERNAL_MODULE_17__, __WEBPACK_EXTERNAL_MODULE_18__, __WEBPACK_EXTERNAL_MODULE_24__, __WEBPACK_EXTERNAL_MODULE_25__, __WEBPACK_EXTERNAL_MODULE_28__) {
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_14__, __WEBPACK_EXTERNAL_MODULE_15__, __WEBPACK_EXTERNAL_MODULE_16__, __WEBPACK_EXTERNAL_MODULE_17__, __WEBPACK_EXTERNAL_MODULE_18__, __WEBPACK_EXTERNAL_MODULE_24__, __WEBPACK_EXTERNAL_MODULE_25__, __WEBPACK_EXTERNAL_MODULE_28__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -13,0 +13,0 @@ /******/ // The module cache

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("rxjs/BehaviorSubject"),require("react-dom"),require("lodash/isPlainObject"),require("rxjs/observable/of"),require("rxjs/observable/merge"),require("rxjs/operators/concatMap"),require("rxjs/operators/scan"),require("lodash/isEqual"),require("lodash/zipWith"),require("rxjs/operators/map")):"function"==typeof define&&define.amd?define(["react","prop-types","rxjs/BehaviorSubject","react-dom","lodash/isPlainObject","rxjs/observable/of","rxjs/observable/merge","rxjs/operators/concatMap","rxjs/operators/scan","lodash/isEqual","lodash/zipWith","rxjs/operators/map"],t):"object"==typeof exports?exports.FrintReact=t(require("react"),require("prop-types"),require("rxjs/BehaviorSubject"),require("react-dom"),require("lodash/isPlainObject"),require("rxjs/observable/of"),require("rxjs/observable/merge"),require("rxjs/operators/concatMap"),require("rxjs/operators/scan"),require("lodash/isEqual"),require("lodash/zipWith"),require("rxjs/operators/map")):e.FrintReact=t(e.React,e.PropTypes,e.Rx,e.ReactDOM,e._.isPlainObject,e.Rx.Observable,e.Rx.Observable,e.Rx.operators,e.Rx.operators,e._.isEqual,e._.zipWith,e.Rx.operators)}("undefined"!=typeof self?self:this,function(e,t,n,r,o,u,a,i,s,c,f,l){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.get("component"),n={app:e},r=function(e){return a.default.createElement(s.default,n,a.default.createElement(t,e))};return function(e){return a.default.createElement(r,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(0),a=r(u),i=n(4),s=r(i);e.exports=t.default},function(e,n){e.exports=t},function(e,t,n){"use strict";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}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),u=function(e){return e&&e.__esModule?e:{default:e}}(o);t.default={setData:function(e,t){this.component.setState(r({},e,t))},setDataWithCallback:function(e,t,n){this.component.setState(r({},e,t),n)},getData:function(e){return this.component.state[e]},getProps:function(){return this.component.props},getProp:function(e){return this.component.props[e]},getMountableComponent:u.default},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),s=n(2),c=function(e){return e&&e.__esModule?e:{default:e}}(s),f=function(e){function t(e,n){r(this,t);var u=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return u.app=e.app,u}return u(t,e),a(t,[{key:"getChildContext",value:function(){return{app:this.app}}}]),a(t,[{key:"render",value:function(){return i.Children.only(this.props.children)}}]),t}(i.Component);f.propTypes={app:c.default.object.isRequired,children:c.default.element.isRequired},f.childContextTypes={app:c.default.object.isRequired},t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e){return!(!e||"function"!=typeof e.subscribe)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default,e.exports=t.default},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];[a.default].concat(n).forEach(function(t){Object.keys(t).forEach(function(n){e[n]=t[n],"function"==typeof t[n]&&(e[n]=e[n].bind(e))})})}function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(r,[null].concat(t)))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(20),a=function(e){return e&&e.__esModule?e:{default:e}}(u);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),u=r(o),a=n(12),i=r(a),s=n(6),c=r(s),f=n(1),l=r(f),p=n(19),d=r(p),h=n(22),b=r(h),y=n(4),v=r(y),_=n(26),g=r(_),m=n(3),P=r(m);t.default={render:u.default,streamProps:i.default,isObservable:c.default,getMountableComponent:l.default,observe:d.default,Region:b.default,Provider:v.default,RegionService:g.default,ReactHandler:P.default},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r=(0,s.default)(e);return n(11).render(a.default.createElement(r,null),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(0),a=r(u),i=n(1),s=r(i);e.exports=t.default},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=i;var f=n(14),l=r(f),p=n(15),d=n(16),h=n(17),b=n(18),y=n(5),v=r(y),_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this._defaults=t,this._observables=[(0,p.of)(t)]}return c(e,[{key:"_push",value:function(e){this._observables.push(e)}},{key:"set",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"string"==typeof e?this.setKey(e,n[0]):(0,l.default)(e)?this.setPlainObject(e):(0,v.default)(e)?this.setObservable.apply(this,[e].concat(n)):this}},{key:"setKey",value:function(e,t){return this._push((0,p.of)(u({},e,t))),this}},{key:"setPlainObject",value:function(e){return this._push((0,p.of)(e)),this}},{key:"setObservable",value:function(e){for(var t=e,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(function(e){t=t.pipe((0,h.concatMap)(function(t){var n=e(t);return(0,v.default)(n)?n:(0,p.of)(n)}))}),this._push(t),this}},{key:"setDispatch",value:function(e,t){var n={};return Object.keys(e).forEach(function(r){var o=e[r];n[r]=function(){return t.dispatch(o.apply(void 0,arguments))}}),this._push((0,p.of)(n)),this}},{key:"get$",value:function(){var e=d.merge.apply(void 0,o(this._observables)).pipe((0,b.scan)(function(e,t){return s({},e,t)}));return e.defaultProps=this._defaults,e}}]),e}();e.exports=t.default},function(e,t){e.exports=o},function(e,t){e.exports=u},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t){e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(t){var n=function(n){function r(t,n){o(this,r);var a=u(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,n));a._props$=new h.BehaviorSubject(a.props),a.state={computedProps:{}};var i="function"==typeof e?e(n.app,a._props$):{};return(0,j.default)(i)?(i.defaultProps&&(a.state.computedProps=i.defaultProps),a._handler=(0,y.default)(m.default,_.default,{component:a,getProps$:function(){return i}}),a.state.computedProps=s({},a.state.computedProps,a._handler.getInitialData().computedProps),a):(a.state.computedProps=i,u(a))}return a(r,n),c(r,[{key:"componentWillMount",value:function(){this._handler&&(this._handler.app=this.context.app,this._handler.beforeMount())}},{key:"componentWillReceiveProps",value:function(e){this._handler&&this._props$.next(e)}},{key:"componentWillUnmount",value:function(){this._handler&&this._handler.beforeDestroy()}},{key:"render",value:function(){var e=this.state.computedProps;return l.default.createElement(t,s({},e,this.props))}}]),r}(l.default.Component);return n.displayName=void 0!==t.displayName?"observe("+t.displayName+")":"observe",n.contextTypes={app:d.default.object.isRequired},n}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=i;var f=n(0),l=r(f),p=n(2),d=r(p),h=n(7),b=n(8),y=r(b),v=n(21),_=r(v),g=n(3),m=r(g),P=n(6),j=r(P);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={app:null,component:null,initialize:function(){},beforeDestroy:function(){},getInitialData:function(){return{}},setData:function(e,t){},setDataWithCallback:function(e,t,n){this.setData(e,t),n()},getData:function(e){},getProp:function(e){},getProps:function(){},beforeMount:function(){},afterMount:function(){},beforeUpdate:function(){},shouldUpdate:function(e,t){},afterUpdate:function(){},getMountableComponent:function(e){return e.get("component")}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={getProps$:null,getInitialData:function(){return{computedProps:{}}},beforeMount:function(){var e=this;"function"==typeof this.getProps$&&(this._subscription=this.getProps$(this.app).subscribe(function(t){e.setData("computedProps",t)}))},beforeDestroy:function(){this._subscription&&this._subscription.unsubscribe()}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(2),l=r(f),p=n(8),d=r(p),h=n(23),b=r(h),y=n(3),v=r(y),_=function(e){function t(){var e;o(this,t);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var i=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return i._handler=(0,d.default)(v.default,b.default,{component:i}),i.state=i._handler.getInitialData(),i}return a(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e,t){return this._handler.shouldUpdate(e,t)}},{key:"componentWillMount",value:function(){this._handler.app=this.context.app,this._handler.beforeMount()}},{key:"componentWillReceiveProps",value:function(e){this._handler.afterUpdate(e)}},{key:"componentWillUnmount",value:function(){this._handler.beforeDestroy()}},{key:"render",value:function(){var e=this.state.listForRendering;if(0===e.length)return null;var t=this.props.className;return c.default.createElement("div",{className:t},e.map(function(e){var t=e.Component,n=e.name;return c.default.createElement(t,{key:"app-"+n})}))}}]),t}(c.default.Component);_.propTypes={className:l.default.string,name:l.default.string.isRequired,uniqueKey:l.default.string,data:l.default.any},_.contextTypes={app:l.default.object},t.default=_,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(24),u=r(o),a=n(25),i=r(a);t.default={getInitialData:function(){return{list:[],listForRendering:[]}},sendProps:function(e,t){var n=e.get(e.options.providerNames.region);n&&n.emit(t)},beforeMount:function(){var e=this,t=this.app?this.app.getRootApp():window.app;if(t){this.rootApp=t;var n=t.getApps$(this.getProp("name"),this.getProp("uniqueKey"));this._subscription=n.subscribe({next:function(n){e.setDataWithCallback("list",n,function(){e.getData("list").forEach(function(n){var r=n.name,o=n.weight,u=n.multi;if(!e.getData("listForRendering").some(function(e){return e.name===r})){var a=e.getProp("uniqueKey")?[e.getProp("name"),e.getProp("uniqueKey")]:[e.getProp("name")];e.getProp("uniqueKey")&&!t.hasAppInstance.apply(t,[r].concat(a))&&t.instantiateApp.apply(t,[r].concat(a));var i=t.getAppInstance.apply(t,[r].concat(a));i&&e.sendProps(i,{name:e.getProp("name"),uniqueKey:e.getProp("uniqueKey"),data:e.getProp("data")}),e.setData("listForRendering",e.getData("listForRendering").concat({name:r,weight:o,instance:i,multi:u,Component:e.getMountableComponent(i)}).sort(function(e,t){return e.weight-t.weight}))}})})},error:function(t){console.warn('Subscription error for <Region name="'+e.name+'" />:',t)}})}},shouldUpdate:function(e,t){var n=!(0,u.default)(this.getProps(),e);if(!n){var r=t.listForRendering;n=n||this.getData("listForRendering").length!==r.length,n=n||(0,i.default)(this.getData("listForRendering"),r,function(e,t){return e.name===t.name}).some(function(e){return!e})}return n},afterUpdate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||{},r=n.name,o=void 0===r?this.getProp("name"):r,u=n.uniqueKey,a=void 0===u?this.getProp("uniqueKey"):u,i=n.data,s=void 0===i?this.getProp("data"):i;this.getData("listForRendering").filter(function(e){return e.instance}).forEach(function(t){return e.sendProps(t.instance,{name:o,uniqueKey:a,data:s})})},beforeDestroy:function(){var e=this;this._subscription&&this._subscription.unsubscribe(),this.rootApp&&this.getData("listForRendering").filter(function(e){return e.multi}).forEach(function(t){e.rootApp.destroyApp(t.name,e.getProp("name"),e.getProp("uniqueKey"))})}},e.exports=t.default},function(e,t){e.exports=c},function(e,t){e.exports=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(7),a=n(28),i=function(){function e(){r(this,e),this.props$=new u.BehaviorSubject({})}return o(e,[{key:"emit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props$.next(e)}},{key:"getProps$",value:function(){return this.props$}},{key:"getData$",value:function(){return this.props$.pipe((0,a.map)(function(e){return e.data}))}}]),e}();t.default=i,e.exports=t.default},function(e,t){e.exports=l}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("rxjs/BehaviorSubject"),require("react-dom"),require("lodash/isPlainObject"),require("rxjs/observable/of"),require("rxjs/observable/merge"),require("rxjs/operators/concatMap"),require("rxjs/operators/scan"),require("lodash/isEqual"),require("lodash/zipWith"),require("rxjs/operators/map")):"function"==typeof define&&define.amd?define(["react","prop-types","rxjs/BehaviorSubject","react-dom","lodash/isPlainObject","rxjs/observable/of","rxjs/observable/merge","rxjs/operators/concatMap","rxjs/operators/scan","lodash/isEqual","lodash/zipWith","rxjs/operators/map"],t):"object"==typeof exports?exports.FrintReact=t(require("react"),require("prop-types"),require("rxjs/BehaviorSubject"),require("react-dom"),require("lodash/isPlainObject"),require("rxjs/observable/of"),require("rxjs/observable/merge"),require("rxjs/operators/concatMap"),require("rxjs/operators/scan"),require("lodash/isEqual"),require("lodash/zipWith"),require("rxjs/operators/map")):e.FrintReact=t(e.React,e.PropTypes,e.Rx,e.ReactDOM,e._.isPlainObject,e.Rx.Observable,e.Rx.Observable,e.Rx.operators,e.Rx.operators,e._.isEqual,e._.zipWith,e.Rx.operators)}(this,function(e,t,n,r,o,u,a,i,s,c,f,l){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.get("component"),n={app:e},r=function(e){return a.default.createElement(s.default,n,a.default.createElement(t,e))};return function(e){return a.default.createElement(r,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(0),a=r(u),i=n(4),s=r(i);e.exports=t.default},function(e,n){e.exports=t},function(e,t,n){"use strict";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}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),u=function(e){return e&&e.__esModule?e:{default:e}}(o);t.default={setData:function(e,t){this.component.setState(r({},e,t))},setDataWithCallback:function(e,t,n){this.component.setState(r({},e,t),n)},getData:function(e){return this.component.state[e]},getProps:function(){return this.component.props},getProp:function(e){return this.component.props[e]},getMountableComponent:u.default},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),s=n(2),c=function(e){return e&&e.__esModule?e:{default:e}}(s),f=function(e){function t(e,n){r(this,t);var u=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return u.app=e.app,u}return u(t,e),a(t,[{key:"getChildContext",value:function(){return{app:this.app}}}]),a(t,[{key:"render",value:function(){return i.Children.only(this.props.children)}}]),t}(i.Component);f.propTypes={app:c.default.object.isRequired,children:c.default.element.isRequired},f.childContextTypes={app:c.default.object.isRequired},t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e){return!(!e||"function"!=typeof e.subscribe)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default,e.exports=t.default},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];[a.default].concat(n).forEach(function(t){Object.keys(t).forEach(function(n){e[n]=t[n],"function"==typeof t[n]&&(e[n]=e[n].bind(e))})})}function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(r,[null].concat(t)))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(20),a=function(e){return e&&e.__esModule?e:{default:e}}(u);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),u=r(o),a=n(12),i=r(a),s=n(6),c=r(s),f=n(1),l=r(f),p=n(19),d=r(p),h=n(22),b=r(h),y=n(4),v=r(y),_=n(26),g=r(_),m=n(3),P=r(m);t.default={render:u.default,streamProps:i.default,isObservable:c.default,getMountableComponent:l.default,observe:d.default,Region:b.default,Provider:v.default,RegionService:g.default,ReactHandler:P.default},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r=(0,s.default)(e);return n(11).render(a.default.createElement(r,null),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var u=n(0),a=r(u),i=n(1),s=r(i);e.exports=t.default},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=i;var f=n(14),l=r(f),p=n(15),d=n(16),h=n(17),b=n(18),y=n(5),v=r(y),_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this._defaults=t,this._observables=[(0,p.of)(t)]}return c(e,[{key:"_push",value:function(e){this._observables.push(e)}},{key:"set",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"string"==typeof e?this.setKey(e,n[0]):(0,l.default)(e)?this.setPlainObject(e):(0,v.default)(e)?this.setObservable.apply(this,[e].concat(n)):this}},{key:"setKey",value:function(e,t){return this._push((0,p.of)(u({},e,t))),this}},{key:"setPlainObject",value:function(e){return this._push((0,p.of)(e)),this}},{key:"setObservable",value:function(e){for(var t=e,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(function(e){t=t.pipe((0,h.concatMap)(function(t){var n=e(t);return(0,v.default)(n)?n:(0,p.of)(n)}))}),this._push(t),this}},{key:"setDispatch",value:function(e,t){var n={};return Object.keys(e).forEach(function(r){var o=e[r];n[r]=function(){return t.dispatch(o.apply(void 0,arguments))}}),this._push((0,p.of)(n)),this}},{key:"get$",value:function(){var e=d.merge.apply(void 0,o(this._observables)).pipe((0,b.scan)(function(e,t){return s({},e,t)}));return e.defaultProps=this._defaults,e}}]),e}();e.exports=t.default},function(e,t){e.exports=o},function(e,t){e.exports=u},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t){e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return function(t){var n=function(n){function r(t,n){o(this,r);var a=u(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,n));a._props$=new h.BehaviorSubject(a.props),a.state={computedProps:{}};var i="function"==typeof e?e(n.app,a._props$):{};return(0,j.default)(i)?(i.defaultProps&&(a.state.computedProps=i.defaultProps),a._handler=(0,y.default)(m.default,_.default,{component:a,getProps$:function(){return i}}),a.state.computedProps=s({},a.state.computedProps,a._handler.getInitialData().computedProps),a):(a.state.computedProps=i,u(a))}return a(r,n),c(r,[{key:"componentWillMount",value:function(){this._handler&&(this._handler.app=this.context.app,this._handler.beforeMount())}},{key:"componentWillReceiveProps",value:function(e){this._handler&&this._props$.next(e)}},{key:"componentWillUnmount",value:function(){this._handler&&this._handler.beforeDestroy()}},{key:"render",value:function(){var e=this.state.computedProps;return l.default.createElement(t,s({},e,this.props))}}]),r}(l.default.Component);return n.displayName=void 0!==t.displayName?"observe("+t.displayName+")":"observe",n.contextTypes={app:d.default.object.isRequired},n}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=i;var f=n(0),l=r(f),p=n(2),d=r(p),h=n(7),b=n(8),y=r(b),v=n(21),_=r(v),g=n(3),m=r(g),P=n(6),j=r(P);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={app:null,component:null,initialize:function(){},beforeDestroy:function(){},getInitialData:function(){return{}},setData:function(e,t){},setDataWithCallback:function(e,t,n){this.setData(e,t),n()},getData:function(e){},getProp:function(e){},getProps:function(){},beforeMount:function(){},afterMount:function(){},beforeUpdate:function(){},shouldUpdate:function(e,t){},afterUpdate:function(){},getMountableComponent:function(e){return e.get("component")}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={getProps$:null,getInitialData:function(){return{computedProps:{}}},beforeMount:function(){var e=this;"function"==typeof this.getProps$&&(this._subscription=this.getProps$(this.app).subscribe(function(t){e.setData("computedProps",t)}))},beforeDestroy:function(){this._subscription&&this._subscription.unsubscribe()}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(2),l=r(f),p=n(8),d=r(p),h=n(23),b=r(h),y=n(3),v=r(y),_=function(e){function t(){var e;o(this,t);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var i=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return i._handler=(0,d.default)(v.default,b.default,{component:i}),i.state=i._handler.getInitialData(),i}return a(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e,t){return this._handler.shouldUpdate(e,t)}},{key:"componentWillMount",value:function(){this._handler.app=this.context.app,this._handler.beforeMount()}},{key:"componentWillReceiveProps",value:function(e){this._handler.afterUpdate(e)}},{key:"componentWillUnmount",value:function(){this._handler.beforeDestroy()}},{key:"render",value:function(){var e=this.state.listForRendering;if(0===e.length)return null;var t=this.props.className;return c.default.createElement("div",{className:t},e.map(function(e){var t=e.Component,n=e.name;return c.default.createElement(t,{key:"app-"+n})}))}}]),t}(c.default.Component);_.propTypes={className:l.default.string,name:l.default.string.isRequired,uniqueKey:l.default.string,data:l.default.any},_.contextTypes={app:l.default.object},t.default=_,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(24),u=r(o),a=n(25),i=r(a);t.default={getInitialData:function(){return{list:[],listForRendering:[]}},sendProps:function(e,t){var n=e.get(e.options.providerNames.region);n&&n.emit(t)},beforeMount:function(){var e=this,t=this.app?this.app.getRootApp():window.app;if(t){this.rootApp=t;var n=t.getApps$(this.getProp("name"),this.getProp("uniqueKey"));this._subscription=n.subscribe({next:function(n){e.setDataWithCallback("list",n,function(){e.getData("list").forEach(function(n){var r=n.name,o=n.weight,u=n.multi;if(!e.getData("listForRendering").some(function(e){return e.name===r})){var a=e.getProp("uniqueKey")?[e.getProp("name"),e.getProp("uniqueKey")]:[e.getProp("name")];e.getProp("uniqueKey")&&!t.hasAppInstance.apply(t,[r].concat(a))&&t.instantiateApp.apply(t,[r].concat(a));var i=t.getAppInstance.apply(t,[r].concat(a));i&&e.sendProps(i,{name:e.getProp("name"),uniqueKey:e.getProp("uniqueKey"),data:e.getProp("data")}),e.setData("listForRendering",e.getData("listForRendering").concat({name:r,weight:o,instance:i,multi:u,Component:e.getMountableComponent(i)}).sort(function(e,t){return e.weight-t.weight}))}})})},error:function(t){console.warn('Subscription error for <Region name="'+e.name+'" />:',t)}})}},shouldUpdate:function(e,t){var n=!(0,u.default)(this.getProps(),e);if(!n){var r=t.listForRendering;n=n||this.getData("listForRendering").length!==r.length,n=n||(0,i.default)(this.getData("listForRendering"),r,function(e,t){return e.name===t.name}).some(function(e){return!e})}return n},afterUpdate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||{},r=n.name,o=void 0===r?this.getProp("name"):r,u=n.uniqueKey,a=void 0===u?this.getProp("uniqueKey"):u,i=n.data,s=void 0===i?this.getProp("data"):i;this.getData("listForRendering").filter(function(e){return e.instance}).forEach(function(t){return e.sendProps(t.instance,{name:o,uniqueKey:a,data:s})})},beforeDestroy:function(){var e=this;this._subscription&&this._subscription.unsubscribe(),this.rootApp&&this.getData("listForRendering").filter(function(e){return e.multi}).forEach(function(t){e.rootApp.destroyApp(t.name,e.getProp("name"),e.getProp("uniqueKey"))})}},e.exports=t.default},function(e,t){e.exports=c},function(e,t){e.exports=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(7),a=n(28),i=function(){function e(){r(this,e),this.props$=new u.BehaviorSubject({})}return o(e,[{key:"emit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props$.next(e)}},{key:"getProps$",value:function(){return this.props$}},{key:"getData$",value:function(){return this.props$.pipe((0,a.map)(function(e){return e.data}))}}]),e}();t.default=i,e.exports=t.default},function(e,t){e.exports=l}])});
{
"name": "frint-react",
"version": "5.2.0",
"version": "5.2.1",
"description": "React package for Frint",

@@ -28,4 +28,4 @@ "main": "lib/index.js",

"dependencies": {
"frint-component-handlers": "^5.2.0",
"frint-component-utils": "^5.2.0",
"frint-component-handlers": "^5.2.1",
"frint-component-utils": "^5.2.1",
"lodash": "^4.13.1",

@@ -36,5 +36,5 @@ "rxjs": "^5.5.0"

"cross-env": "^5.0.5",
"frint": "^5.2.0",
"frint-config": "^5.2.0",
"frint-test-utils": "^5.2.0"
"frint": "^5.2.1",
"frint-config": "^5.2.1",
"frint-test-utils": "^5.2.1"
},

@@ -41,0 +41,0 @@ "bugs": {

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