UNPKG

@composiv/liveui-react

Version:

Includes RemoteComponent used by LiveUI applications.

15 lines 14.5 kB
module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=5)}([function(e,r,n){var t=n(3);e.exports=n(7)(t.isElement,!0)},function(e,r){e.exports=require("react")},function(e,r){e.exports=require("@composiv/liveui-core")},function(e,r,n){"use strict";e.exports=n(6)},function(e,r,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,r,n){"use strict";n.r(r);var t=n(1),o=n.n(t),a=n(2),i=n(0),u=n.n(i);function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],t=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(e){o=!0,a=e}finally{try{t||null==u.return||u.return()}finally{if(o)throw a}}return n}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return f(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function l(e,r){if(null==e)return{};var n,t,o=function(e,r){if(null==e)return{};var n,t,o={},a=Object.keys(e);for(t=0;t<a.length;t++)n=a[t],r.indexOf(n)>=0||(o[n]=e[n]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)n=a[t],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function s(e){var r=e.url,n=e.name,i=e.source,u=e.onError,f=l(e,["url","name","source","onError"]),s=c(Object(t.useState)({DynamicElement:void 0}),2),p=s[0],y=s[1];function d(e){fetch(e,{method:"GET"}).then((function(e){return e.text()})).then((function(e){var r=a.ViewBuilder.build(e,u);y({DynamicElement:r})})).catch((function(e){var r=u("Remote Component fetch failed",-200,e);y({DynamicElement:r})}))}Object(t.useEffect)((function(){!function(){if(r)d(r);else if(n){d(a.Registry.getComponentUrl(n))}else if(i){var e=a.ViewBuilder.build(i,u);y({DynamicElement:e})}}()}),[]);var m=p.DynamicElement;return m?o.a.createElement(m,f):null}s.defaultProps={onError:function(e,r,n){return console.log(e,r,n),null},cached:!1},s.propTypes={name:u.a.string,source:u.a.string,onError:u.a.func,cached:u.a.bool},r.default=s},function(e,r,n){"use strict"; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case n:var y=e.type;switch(y){case f:case l:case o:case i:case a:case p:return y;default:var b=y&&y.$$typeof;switch(b){case c:case s:case m:case d:case u:return b;default:return r}}case t:return r}}}var w=f,S=l,j=c,x=u,E=n,P=s,I=o,T=m,$=d,A=t,k=i,_=a,R=p,C=!1;function M(e){return O(e)===l}r.AsyncMode=w,r.ConcurrentMode=S,r.ContextConsumer=j,r.ContextProvider=x,r.Element=E,r.ForwardRef=P,r.Fragment=I,r.Lazy=T,r.Memo=$,r.Portal=A,r.Profiler=k,r.StrictMode=_,r.Suspense=R,r.isAsyncMode=function(e){return C||(C=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(e)||O(e)===f},r.isConcurrentMode=M,r.isContextConsumer=function(e){return O(e)===c},r.isContextProvider=function(e){return O(e)===u},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},r.isForwardRef=function(e){return O(e)===s},r.isFragment=function(e){return O(e)===o},r.isLazy=function(e){return O(e)===m},r.isMemo=function(e){return O(e)===d},r.isPortal=function(e){return O(e)===t},r.isProfiler=function(e){return O(e)===i},r.isStrictMode=function(e){return O(e)===a},r.isSuspense=function(e){return O(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===l||e===i||e===a||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===u||e.$$typeof===c||e.$$typeof===s||e.$$typeof===v||e.$$typeof===g||e.$$typeof===h||e.$$typeof===b)},r.typeOf=O})()},function(e,r,n){"use strict";var t=n(3),o=n(8),a=n(4),i=n(9),u=Function.call.bind(Object.prototype.hasOwnProperty),c=function(){};function f(){return null}c=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}},e.exports=function(e,r){var n="function"==typeof Symbol&&Symbol.iterator;var l={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:y(f),arrayOf:function(e){return y((function(r,n,t,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var u=r[n];if(!Array.isArray(u))return new p("Invalid "+o+" `"+i+"` of type `"+b(u)+"` supplied to `"+t+"`, expected an array.");for(var c=0;c<u.length;c++){var f=e(u,c,t,o,i+"["+c+"]",a);if(f instanceof Error)return f}return null}))},element:y((function(r,n,t,o,a){var i=r[n];return e(i)?null:new p("Invalid "+o+" `"+a+"` of type `"+b(i)+"` supplied to `"+t+"`, expected a single ReactElement.")})),elementType:y((function(e,r,n,o,a){var i=e[r];return t.isValidElementType(i)?null:new p("Invalid "+o+" `"+a+"` of type `"+b(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return y((function(r,n,t,o,a){if(!(r[n]instanceof e)){var i=e.name||"<<anonymous>>";return new p("Invalid "+o+" `"+a+"` of type `"+function(e){if(!e.constructor||!e.constructor.name)return"<<anonymous>>";return e.constructor.name}(r[n])+"` supplied to `"+t+"`, expected instance of `"+i+"`.")}return null}))},node:y((function(e,r,n,t,o){return m(e[r])?null:new p("Invalid "+t+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return y((function(r,n,t,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var c=r[n],f=b(c);if("object"!==f)return new p("Invalid "+o+" `"+i+"` of type `"+f+"` supplied to `"+t+"`, expected an object.");for(var l in c)if(u(c,l)){var s=e(c,l,t,o,i+"."+l,a);if(s instanceof Error)return s}return null}))},oneOf:function(e){if(!Array.isArray(e))return c(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),f;function r(r,n,t,o,a){for(var i=r[n],u=0;u<e.length;u++)if(s(i,e[u]))return null;var c=JSON.stringify(e,(function(e,r){return"symbol"===v(r)?String(r):r}));return new p("Invalid "+o+" `"+a+"` of value `"+String(i)+"` supplied to `"+t+"`, expected one of "+c+".")}return y(r)},oneOfType:function(e){if(!Array.isArray(e))return c("Invalid argument supplied to oneOfType, expected an instance of array."),f;for(var r=0;r<e.length;r++){var n=e[r];if("function"!=typeof n)return c("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(n)+" at index "+r+"."),f}return y((function(r,n,t,o,i){for(var u=0;u<e.length;u++){if(null==(0,e[u])(r,n,t,o,i,a))return null}return new p("Invalid "+o+" `"+i+"` supplied to `"+t+"`.")}))},shape:function(e){return y((function(r,n,t,o,i){var u=r[n],c=b(u);if("object"!==c)return new p("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+t+"`, expected `object`.");for(var f in e){var l=e[f];if(l){var s=l(u,f,t,o,i+"."+f,a);if(s)return s}}return null}))},exact:function(e){return y((function(r,n,t,i,u){var c=r[n],f=b(c);if("object"!==f)return new p("Invalid "+i+" `"+u+"` of type `"+f+"` supplied to `"+t+"`, expected `object`.");var l=o({},r[n],e);for(var s in l){var y=e[s];if(!y)return new p("Invalid "+i+" `"+u+"` key `"+s+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(r[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=y(c,s,t,i,u+"."+s,a);if(d)return d}return null}))}};function s(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function p(e){this.message=e,this.stack=""}function y(e){var n={},t=0;function o(o,i,u,f,l,s,y){if(f=f||"<<anonymous>>",s=s||u,y!==a){if(r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}if("undefined"!=typeof console){var m=f+":"+u;!n[m]&&t<3&&(c("You are manually calling a React.PropTypes validation function for the `"+s+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[m]=!0,t++)}}return null==i[u]?o?null===i[u]?new p("The "+l+" `"+s+"` is marked as required in `"+f+"`, but its value is `null`."):new p("The "+l+" `"+s+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(i,u,f,l,s)}var i=o.bind(null,!1);return i.isRequired=o.bind(null,!0),i}function d(e){return y((function(r,n,t,o,a,i){var u=r[n];return b(u)!==e?new p("Invalid "+o+" `"+a+"` of type `"+v(u)+"` supplied to `"+t+"`, expected `"+e+"`."):null}))}function m(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(m);if(null===r||e(r))return!0;var t=function(e){var r=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof r)return r}(r);if(!t)return!1;var o,a=t.call(r);if(t!==r.entries){for(;!(o=a.next()).done;)if(!m(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!m(i[1]))return!1}return!0;default:return!1}}function b(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function v(e){if(null==e)return""+e;var r=b(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function g(e){var r=v(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return p.prototype=Error.prototype,l.checkPropTypes=i,l.resetWarningCache=i.resetWarningCache,l.PropTypes=l,l}},function(e,r,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},n=0;n<10;n++)r["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},t)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var n,u,c=i(e),f=1;f<arguments.length;f++){for(var l in n=Object(arguments[f]))o.call(n,l)&&(c[l]=n[l]);if(t){u=t(n);for(var s=0;s<u.length;s++)a.call(n,u[s])&&(c[u[s]]=n[u[s]])}}return c}},function(e,r,n){"use strict";var t=function(){},o=n(4),a={},i=Function.call.bind(Object.prototype.hasOwnProperty);function u(e,r,n,u,c){for(var f in e)if(i(e,f)){var l;try{if("function"!=typeof e[f]){var s=Error((u||"React class")+": "+n+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.");throw s.name="Invariant Violation",s}l=e[f](r,f,u,n,null,o)}catch(e){l=e}if(!l||l instanceof Error||t((u||"React class")+": type specification of "+n+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in a)){a[l.message]=!0;var p=c?c():"";t("Failed "+n+" type: "+l.message+(null!=p?p:""))}}}t=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}},u.resetWarningCache=function(){a={}},e.exports=u}]); //# sourceMappingURL=liveui-react.development.js.map