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

@mybricks/render-react-hoc

Package Overview
Dependencies
Maintainers
12
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mybricks/render-react-hoc - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

dist/hoc/variable.d.ts

1

dist/hoc/index.d.ts
export * from "./slot";
export * from "./variable";
export * from "./component";
export * from "./calculate";

4

dist/index.d.ts
import React from "react";
import { MyBricksRenderProviderProps } from "./hooks";
import { SlotWrapper, UiComponentWrapper, handleSingleOutput, handleMultipleOutputs, jsComponentSingleOutputWrapper as jsCSOW, jsComponentMultipleOutputsWrapper as jsCMOW, jsComponentMultipleInputsWrapper as jsCMIW } from "./hoc";
import { SlotWrapper, variableWrapper, UiComponentWrapper, handleSingleOutput, handleMultipleOutputs, jsComponentSingleOutputWrapper as jsCSOW, jsComponentMultipleOutputsWrapper as jsCMOW, jsComponentMultipleInputsWrapper as jsCMIW } from "./hoc";
export declare const MyBricksRenderProvider: ({ children, value }: MyBricksRenderProviderProps) => React.JSX.Element;

@@ -10,2 +10,2 @@ export declare const jsComponentSingleOutputWrapper: (params: Parameters<typeof jsCSOW>[0]) => (value: any) => Promise<unknown>;

export declare const _: unique symbol;
export { SlotWrapper, UiComponentWrapper, handleSingleOutput, handleMultipleOutputs, };
export { SlotWrapper, variableWrapper, UiComponentWrapper, handleSingleOutput, handleMultipleOutputs, };

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

import*as e from"react";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},n={};t.d(n,{Ax:()=>G,L8:()=>_,pN:()=>N,_:()=>X,_f:()=>H,Rs:()=>$,Yi:()=>V,vo:()=>Q,gh:()=>J});const r=(o={createContext:()=>e.createContext,default:()=>e.default,forwardRef:()=>e.forwardRef,memo:()=>e.memo,useCallback:()=>e.useCallback,useContext:()=>e.useContext,useEffect:()=>e.useEffect,useImperativeHandle:()=>e.useImperativeHandle,useMemo:()=>e.useMemo,useRef:()=>e.useRef,useState:()=>e.useState},i={},t.d(i,o),i);var o,i,u=(0,r.createContext)({env:{}});function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(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,l(r.key),r)}}function f(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}function s(e){e()}var p=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"taskMap",new WeakMap),f(this,"reactionToTaskMap",new WeakMap)},(t=[{key:"addTask",value:function(e){this.taskMap.set(e,new Map)}},{key:"deleteTask",value:function(e){if(C(e)){var t=d.get(e);d.delete(e),g.delete(t),this.taskMap.delete(t)}}},{key:"deleteReaction",value:function(e){var t=this.reactionToTaskMap.get(e);t&&(this.reactionToTaskMap.delete(e),t.forEach((function(t){t.forEach((function(t){t.delete(e)}))})))}},{key:"registReaction",value:function(e,t){var n=t.target,r=t.key,o=this.taskMap.get(n);if(o){var i=o.get(r);i||(i=new Set,o.set(r,i)),i.has(e)||i.add(e);var u=this.reactionToTaskMap.get(e);u||(u=new Set,this.reactionToTaskMap.set(e,u)),u.has(o)||u.add(o)}}},{key:"getReactions",value:function(e){var t=e.target,n=e.key,r=this.taskMap.get(t);return r&&r.get(n)||[]}},{key:"runTask",value:function(e){var t=this.getReactions(e);t.size&&t.forEach(s)}}])&&c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(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,b(r.key),r)}}function b(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}var m=new(function(){return e=function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=[],(n=b(n="reactionStack"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r},(t=[{key:"regist",value:function(e){var t=this.getCurrentReaction();t&&p.registReaction(t,e)}},{key:"autoRun",value:function(e,t){var n=this.reactionStack;if(-1===n.indexOf(e))try{return n.push(e),t()}finally{n.pop()}}},{key:"getCurrentReaction",value:function(){var e=this.reactionStack;return e[e.length-1]}}])&&v(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()),d=new WeakMap,g=new WeakMap;const w={get:function(e,t){var n=e[t];if(["$$typeof","constructor"].includes(t)||e.__model_style__&&"display"!==t)return n;if(m.regist({target:e,key:t}),n instanceof FormData)return n;var r=g.get(n);return C(n)?r||T(n):r||n},set:function(e,t,n){C(n)&&(n=d.get(n)||n);var r=Object.hasOwnProperty.call(e,t),o=e[t];e[t]=n;var i=!1;switch(!0){case!r||Array.isArray(e)&&"length"===t:case n!==o:i=!0}return i&&(p.runTask({target:e,key:t}),p.deleteTask(g.get(o))),!0}};function h(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,O(r.key),r)}}function O(e){var t=function(e,t){if("object"!=j(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==j(t)?t:t+""}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}var S,k="__render-web-createElement__";function C(e){return e&&"object"===j(e)}var x="__enhanced__";function E(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e[x];if(!n){t?(n=(0,r.memo)(e)).render=M(e.render,!1):n=M(e);try{e[x]=n}catch(e){console.error(e)}}var o=Object.getOwnPropertyNames(e);return o&&o.forEach((function(r){try{t&&"render"===r||(n[r]=e[r])}catch(e){console.error(e)}})),n}function M(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];function n(t,n){var o,i,u,a,c=(0,r.useRef)(null),f=(u=(0,r.useState)([]),a=2,function(e){if(Array.isArray(e))return e}(u)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],c=!0,f=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){f=!0,o=e}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(f)throw o}}return a}}(u,a)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}(u,a)||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.")}())[1],l=(0,r.useCallback)((function(){f([])}),[]);return(0,r.useMemo)((function(){c.current||(c.current=new R(l))}),[]),(0,r.useEffect)((function(){return function(){var e;null===(e=c.current)||void 0===e||e.destroy(),c.current=null}}),[]),null===(o=c.current)||void 0===o||o.track((function(){i=e(t,n)})),i}return n.displayName=e.displayName||e.name,t?(0,r.memo)(n):n}function T(e){return C(e)?d.has(e)?e:g.get(e)||function(e){var t=new Proxy(e,w);return g.set(e,t),d.set(t,e),p.addTask(e),t}(e):{}}var R=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.update=t},(t=[{key:"track",value:function(e){m.autoRun(this.update,e)}},{key:"destroy",value:function(){p.deleteReaction(this.update)}}])&&h(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function _(e){return r.default.createElement("div",{style:e.style},e.children)}function W(){var e=function(){},t=new Promise((function(t){e=t}));return t.resolve=e,t}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function I(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 D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){var r,o,i,u;r=e,o=t,i=n[t],u=function(e,t){if("object"!=A(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),(o="symbol"==A(u)?u:u+"")in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=(0,r.forwardRef)((function(e,t){var n=(0,r.useContext)(u).env,o=(0,r.useMemo)((function(){var t=e.data,n=e.style,o=e.component,i=e.slots,u=e.events,a=T(t),c=T(n),f={show:function(){c.display=""},hide:function(){c.display="none"},showOrHide:function(e){void 0===e?"none"===c.display?c.display="":c.display="none":c.display=e?"":"none"}},l=new Proxy({},{get:function(e,t){return function(e){f[t]=e}}}),s=new Proxy({},{get:function(e,t){return u[t]||function(){}}});return{slots:new Proxy({},{get:function(e,t){return{render:function(){var e=i[t];return r.default.createElement(e,null)}}}}),inputs:l,outputs:s,Component:o,data:a,style:c,registeredInputFunctions:f}}),[]),i=o.data,a=o.style,c=o.slots,f=o.inputs,l=o.outputs,s=o.Component,p=o.registeredInputFunctions;return(0,r.useImperativeHandle)(t,(function(){return p})),r.default.createElement("div",{style:D({},a)},r.default.createElement(s,{slots:c,inputs:f,outputs:l,env:n,data:i,style:a}))}));function $(e){return function(t){return new Promise((function(n){e(t,new Proxy({},{get:function(){return n}}))}))}}function H(e){return function(t){var n=new Proxy({},{get:function(e,t){var n=e[t];return n||(n=e[t]=W()),n}}),r=new Proxy({},{get:function(e,t){var r=n[t];return r||(r=n[t]=W()),r.resolve}});return e(t,r),new Proxy({},{get:function(e,t){return function(e){n[t].then((function(t){e(t)}))}}})}}function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function F(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 L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e,t,n){var r;return r=function(e,t){if("object"!=B(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==B(r)?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function z(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,K(r.key),r)}}function K(e){var t=function(e,t){if("object"!=Y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Y(t)?t:t+""}r.default[k]||(r.default[k]=!0,S=r.default.createElement,r.default.createElement=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0];if(t[1]){if(t.length>0&&"function"==typeof o){if(!o.prototype||!(o.prototype instanceof r.default.Component)&&void 0===o.prototype.isReactComponent){var i=E(o);t.splice(0,1,i)}return S.apply(void 0,t)}if("object"===j(o)&&o.$$typeof===Symbol.for("react.forward_ref")){var u=E(o,!0);return t.splice(0,1,u),S.apply(void 0,t)}return S.apply(void 0,t)}return S.apply(void 0,t)});var q=new(function(){return e=function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r={},(n=K(n="globalContext"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r},(t=[{key:"MyBricksRenderProvider",get:function(){var e=this;return function(t){var n=t.children,o=t.value;return(0,r.useMemo)((function(){e.globalContext=o}),[]),r.default.createElement(u.Provider,{value:o},n)}}},{key:"jsComponentSingleOutputWrapper",value:function(e){return t=e,n=this.globalContext,r=t.data,o=t.component,i=n.env,function(e){return new Promise((function(t){var n=new Proxy({},{get:function(){return t}});o({env:i,data:r,inputs:new Proxy({},{get:function(){return function(t){t(e,n)}}}),outputs:n})}))};var t,n,r,o,i}},{key:"jsComponentMultipleOutputsWrapper",value:function(e){return t=e,n=this.globalContext,r=t.data,o=t.component,i=n.env,function(e){var t=new Proxy({},{get:function(e,t){var n=e[t];return n||(n=e[t]=W()),n}}),n=new Proxy({},{get:function(e,n){return t[n].resolve}});return o({env:i,data:r,inputs:new Proxy({},{get:function(){return function(t){t(e,n)}}}),outputs:n}),new Proxy({},{get:function(e,n){return function(e){t[n].then((function(t){e(t)}))}}})};var t,n,r,o,i}},{key:"jsComponentMultipleInputsWrapper",value:function(e){return t=e,n=this.globalContext,o=t.data,i=t.component,u=n.env,function(e){return function(t){if(r?t.forEach((function(e,t){e!==X?r[t]=e:t in r||(r[t]=e)})):r=t,!r.find((function(e){return e===X}))){var n=r.reduce((function(e,t,n){return L(L({},e),{},U({},"input".concat(n),t))}),{}),a=new Proxy({},{ownKeys:function(){return r.map((function(e,t){return"input".concat(t)}))},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}},get:function(){return function(t){t(n,e)}}});i({env:u,data:o,inputs:a,outputs:e}),r=void 0}}};var t,n,r,o,i,u}}])&&z(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()),G=q.MyBricksRenderProvider,J=q.jsComponentSingleOutputWrapper.bind(q),Q=q.jsComponentMultipleOutputsWrapper.bind(q),V=q.jsComponentMultipleInputsWrapper.bind(q),X=Symbol.for("mybricks.empty"),Z=n.Ax,ee=n.L8,te=n.pN,ne=n._,re=n._f,oe=n.Rs,ie=n.Yi,ue=n.vo,ae=n.gh;export{Z as MyBricksRenderProvider,ee as SlotWrapper,te as UiComponentWrapper,ne as _,re as handleMultipleOutputs,oe as handleSingleOutput,ie as jsComponentMultipleInputsWrapper,ue as jsComponentMultipleOutputsWrapper,ae as jsComponentSingleOutputWrapper};
import*as e from"react";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},n={};t.d(n,{Ax:()=>J,L8:()=>_,pN:()=>$,_:()=>Z,_f:()=>B,Rs:()=>H,Yi:()=>X,vo:()=>V,gh:()=>Q,my:()=>W});const r=(o={createContext:()=>e.createContext,default:()=>e.default,forwardRef:()=>e.forwardRef,memo:()=>e.memo,useCallback:()=>e.useCallback,useContext:()=>e.useContext,useEffect:()=>e.useEffect,useImperativeHandle:()=>e.useImperativeHandle,useMemo:()=>e.useMemo,useRef:()=>e.useRef,useState:()=>e.useState},i={},t.d(i,o),i);var o,i,u=(0,r.createContext)({env:{}});function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(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,l(r.key),r)}}function f(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}function s(e){e()}var p=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"taskMap",new WeakMap),f(this,"reactionToTaskMap",new WeakMap)},(t=[{key:"addTask",value:function(e){this.taskMap.set(e,new Map)}},{key:"deleteTask",value:function(e){if(C(e)){var t=d.get(e);d.delete(e),g.delete(t),this.taskMap.delete(t)}}},{key:"deleteReaction",value:function(e){var t=this.reactionToTaskMap.get(e);t&&(this.reactionToTaskMap.delete(e),t.forEach((function(t){t.forEach((function(t){t.delete(e)}))})))}},{key:"registReaction",value:function(e,t){var n=t.target,r=t.key,o=this.taskMap.get(n);if(o){var i=o.get(r);i||(i=new Set,o.set(r,i)),i.has(e)||i.add(e);var u=this.reactionToTaskMap.get(e);u||(u=new Set,this.reactionToTaskMap.set(e,u)),u.has(o)||u.add(o)}}},{key:"getReactions",value:function(e){var t=e.target,n=e.key,r=this.taskMap.get(t);return r&&r.get(n)||[]}},{key:"runTask",value:function(e){var t=this.getReactions(e);t.size&&t.forEach(s)}}])&&c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(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,b(r.key),r)}}function b(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}var m=new(function(){return e=function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=[],(n=b(n="reactionStack"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r},(t=[{key:"regist",value:function(e){var t=this.getCurrentReaction();t&&p.registReaction(t,e)}},{key:"autoRun",value:function(e,t){var n=this.reactionStack;if(-1===n.indexOf(e))try{return n.push(e),t()}finally{n.pop()}}},{key:"getCurrentReaction",value:function(){var e=this.reactionStack;return e[e.length-1]}}])&&v(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()),d=new WeakMap,g=new WeakMap;const h={get:function(e,t){var n=e[t];if(["$$typeof","constructor"].includes(t)||e.__model_style__&&"display"!==t)return n;if(m.regist({target:e,key:t}),n instanceof FormData)return n;var r=g.get(n);return C(n)?r||T(n):r||n},set:function(e,t,n){C(n)&&(n=d.get(n)||n);var r=Object.hasOwnProperty.call(e,t),o=e[t];e[t]=n;var i=!1;switch(!0){case!r||Array.isArray(e)&&"length"===t:case n!==o:i=!0}return i&&(p.runTask({target:e,key:t}),p.deleteTask(g.get(o))),!0}};function w(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,O(r.key),r)}}function O(e){var t=function(e,t){if("object"!=P(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==P(t)?t:t+""}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}var S,k="__render-web-createElement__";function C(e){return e&&"object"===P(e)}var E="__enhanced__";function x(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e[E];if(!n){t?(n=(0,r.memo)(e)).render=M(e.render,!1):n=M(e);try{e[E]=n}catch(e){console.error(e)}}var o=Object.getOwnPropertyNames(e);return o&&o.forEach((function(r){try{t&&"render"===r||(n[r]=e[r])}catch(e){console.error(e)}})),n}function M(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];function n(t,n){var o,i,u,a,c=(0,r.useRef)(null),f=(u=(0,r.useState)([]),a=2,function(e){if(Array.isArray(e))return e}(u)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],c=!0,f=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){f=!0,o=e}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(f)throw o}}return a}}(u,a)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(u,a)||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.")}())[1],l=(0,r.useCallback)((function(){f([])}),[]);return(0,r.useMemo)((function(){c.current||(c.current=new R(l))}),[]),(0,r.useEffect)((function(){return function(){var e;null===(e=c.current)||void 0===e||e.destroy(),c.current=null}}),[]),null===(o=c.current)||void 0===o||o.track((function(){i=e(t,n)})),i}return n.displayName=e.displayName||e.name,t?(0,r.memo)(n):n}function T(e){return C(e)?d.has(e)?e:g.get(e)||function(e){var t=new Proxy(e,h);return g.set(e,t),d.set(t,e),p.addTask(e),t}(e):{}}var R=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.update=t},(t=[{key:"track",value:function(e){m.autoRun(this.update,e)}},{key:"destroy",value:function(){p.deleteReaction(this.update)}}])&&w(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function _(e){return r.default.createElement("div",{style:e.style},e.children)}function W(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];t[n]={get:function(){return r.value},set:function(e){return r.value=e,r.change(e)}}})),t}function A(){var e=function(){},t=new Promise((function(t){e=t}));return t.resolve=e,t}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function D(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){var r,o,i,u;r=e,o=t,i=n[t],u=function(e,t){if("object"!=I(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),(o="symbol"==I(u)?u:u+"")in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $=(0,r.forwardRef)((function(e,t){var n=(0,r.useContext)(u).env,o=(0,r.useMemo)((function(){var t=e.data,n=e.style,o=e.component,i=e.slots,u=e.events,a=T(t),c=T(n),f={show:function(){c.display=""},hide:function(){c.display="none"},showOrHide:function(e){void 0===e?"none"===c.display?c.display="":c.display="none":c.display=e?"":"none"}},l=new Proxy({},{get:function(e,t){return function(e){f[t]=e}}}),s=new Proxy({},{get:function(e,t){return u[t]||function(){}}});return{slots:new Proxy({},{get:function(e,t){return{render:function(){var e=i[t];return r.default.createElement(e,null)}}}}),inputs:l,outputs:s,Component:o,data:a,style:c,registeredInputFunctions:f}}),[]),i=o.data,a=o.style,c=o.slots,f=o.inputs,l=o.outputs,s=o.Component,p=o.registeredInputFunctions;return(0,r.useImperativeHandle)(t,(function(){return p})),r.default.createElement("div",{style:N({},a)},r.default.createElement(s,{slots:c,inputs:f,outputs:l,env:n,data:i,style:a}))}));function H(e){return function(t){return new Promise((function(n){e(t,new Proxy({},{get:function(){return n}}))}))}}function B(e){return function(t){var n=new Proxy({},{get:function(e,t){var n=e[t];return n||(n=e[t]=A()),n}}),r=new Proxy({},{get:function(e,t){var r=n[t];return r||(r=n[t]=A()),r.resolve}});return e(t,r),new Proxy({},{get:function(e,t){return function(e){n[t].then((function(t){e(t)}))}}})}}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function L(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 U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){Y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Y(e,t,n){var r;return r=function(e,t){if("object"!=F(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==F(r)?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function K(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,q(r.key),r)}}function q(e){var t=function(e,t){if("object"!=z(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}r.default[k]||(r.default[k]=!0,S=r.default.createElement,r.default.createElement=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0];if(t[1]){if(t.length>0&&"function"==typeof o){if(!o.prototype||!(o.prototype instanceof r.default.Component)&&void 0===o.prototype.isReactComponent){var i=x(o);t.splice(0,1,i)}return S.apply(void 0,t)}if("object"===P(o)&&o.$$typeof===Symbol.for("react.forward_ref")){var u=x(o,!0);return t.splice(0,1,u),S.apply(void 0,t)}return S.apply(void 0,t)}return S.apply(void 0,t)});var G=new(function(){return e=function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r={},(n=q(n="globalContext"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r},(t=[{key:"MyBricksRenderProvider",get:function(){var e=this;return function(t){var n=t.children,o=t.value;return(0,r.useMemo)((function(){e.globalContext=o}),[]),r.default.createElement(u.Provider,{value:o},n)}}},{key:"jsComponentSingleOutputWrapper",value:function(e){return t=e,n=this.globalContext,r=t.data,o=t.component,i=n.env,function(e){return new Promise((function(t){var n=new Proxy({},{get:function(){return t}});o({env:i,data:r,inputs:new Proxy({},{get:function(){return function(t){t(e,n)}}}),outputs:n})}))};var t,n,r,o,i}},{key:"jsComponentMultipleOutputsWrapper",value:function(e){return t=e,n=this.globalContext,r=t.data,o=t.component,i=n.env,function(e){var t=new Proxy({},{get:function(e,t){var n=e[t];return n||(n=e[t]=A()),n}}),n=new Proxy({},{get:function(e,n){return t[n].resolve}});return o({env:i,data:r,inputs:new Proxy({},{get:function(){return function(t){t(e,n)}}}),outputs:n}),new Proxy({},{get:function(e,n){return function(e){t[n].then((function(t){e(t)}))}}})};var t,n,r,o,i}},{key:"jsComponentMultipleInputsWrapper",value:function(e){return t=e,n=this.globalContext,o=t.data,i=t.component,u=n.env,function(e){return function(t){if(r?t.forEach((function(e,t){e!==Z?r[t]=e:t in r||(r[t]=e)})):r=t,!r.find((function(e){return e===Z}))){var n=r.reduce((function(e,t,n){return U(U({},e),{},Y({},"input".concat(n),t))}),{}),a=new Proxy({},{ownKeys:function(){return r.map((function(e,t){return"input".concat(t)}))},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}},get:function(){return function(t){t(n,e)}}});i({env:u,data:o,inputs:a,outputs:e}),r=void 0}}};var t,n,r,o,i,u}}])&&K(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()),J=G.MyBricksRenderProvider,Q=G.jsComponentSingleOutputWrapper.bind(G),V=G.jsComponentMultipleOutputsWrapper.bind(G),X=G.jsComponentMultipleInputsWrapper.bind(G),Z=Symbol.for("mybricks.empty"),ee=n.Ax,te=n.L8,ne=n.pN,re=n._,oe=n._f,ie=n.Rs,ue=n.Yi,ae=n.vo,ce=n.gh,fe=n.my;export{ee as MyBricksRenderProvider,te as SlotWrapper,ne as UiComponentWrapper,re as _,oe as handleMultipleOutputs,ie as handleSingleOutput,ue as jsComponentMultipleInputsWrapper,ae as jsComponentMultipleOutputsWrapper,ce as jsComponentSingleOutputWrapper,fe as variableWrapper};
{
"name": "@mybricks/render-react-hoc",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/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