New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@plasmicapp/host

Package Overview
Dependencies
Maintainers
1
Versions
248
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plasmicapp/host - npm Package Compare versions

Comparing version 1.0.59 to 1.0.60

27

dist/host.cjs.development.js

@@ -473,25 +473,10 @@ 'use strict';

var _root$__Sub$setRepeat, _root$__Sub;
/**
* Allows a component from Plasmic Studio to be repeated.
* `isPrimary` should be true for at most one instance of the component, and
* indicates which copy of the element will be highlighted when the element is
* selected in Studio.
* If `isPrimary` is `false`, and `elt` is a React element (or an array of such),
* it'll be cloned (using React.cloneElement) and ajusted if it's a component
* from Plasmic Studio. Otherwise, if `elt` is not a React element, the original
* value is returned.
*/
function repeatedElement(isPrimary, elt) {
return repeatedElementFn(isPrimary, elt);
function repeatedElement(index, elt) {
return _repeatedElementFn(index, elt);
}
var repeatedElementFn = function repeatedElementFn(isPrimary, elt) {
if (isPrimary) {
return elt;
}
var _repeatedElementFn = function repeatedElementFn(index, elt) {
if (Array.isArray(elt)) {
return elt.map(function (v) {
return repeatedElement(isPrimary, v);
return _repeatedElementFn(index, v);
});

@@ -509,3 +494,3 @@ }

var setRepeatedElementFn = (_root$__Sub$setRepeat = root$5 == null ? void 0 : (_root$__Sub = root$5.__Sub) == null ? void 0 : _root$__Sub.setRepeatedElementFn) != null ? _root$__Sub$setRepeat : function (fn) {
repeatedElementFn = fn;
_repeatedElementFn = fn;
};

@@ -537,3 +522,3 @@

var hostVersion = "1.0.59";
var hostVersion = "1.0.60";

@@ -540,0 +525,0 @@ var root$6 = globalThis;

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-dom");function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var s=globalThis;null==s.__PlasmicHostVersion&&(s.__PlasmicHostVersion="2");var l=[],u=new function(e){var t=this;this.value=null,this.set=function(e){t.value=e,l.forEach((function(e){return e()}))},this.get=function(){return t.value}}(null);function c(){return function(e,t){if(void 0===t&&(t=""),null==e)throw t=(function(e){return"string"==typeof e}(t)?t:t())||"",new Error("Value must not be undefined or null"+(t?"- "+t:""));return e}(new URL("https://fakeurl/"+location.hash.replace(/#/,"?")).searchParams.get("origin"),"Missing information from Plasmic window.")}var p=0;function m(e){p++,u.set(e)}var d=t.createContext(!1),f=function(){return t.useContext(d)};function v(){var e,r,a,o=!!window.parent,i=!(null==(e=location.hash)||!e.match(/\bcanvas=true\b/)),s=!(null==(r=location.hash)||!r.match(/\blive=true\b/))||!o,m=o&&!document.querySelector("#plasmic-studio-tag")&&!i&&!s,f=(a=t.useState(0)[1],t.useCallback((function(){a((function(e){return e+1}))}),[]));if(t.useLayoutEffect((function(){return l.push(f),function(){var e=l.indexOf(f);e>=0&&l.splice(e,1)}}),[f]),t.useEffect((function(){var e,t;m&&o&&window.parent!==window&&(e=document.createElement("script"),t=c(),e.src=t+"/static/js/studio.js",document.body.appendChild(e))}),[m,o]),t.useEffect((function(){if(!m&&!document.querySelector("#getlibs")&&s){var e=document.createElement("script");e.id="getlibs",e.src=c()+"/static/js/getlibs.js",e.async=!1,e.onload=function(){null==window.__GetlibsReadyResolver||window.__GetlibsReadyResolver()},document.head.append(e)}}),[m]),!o)return null;if(i||s){var v=document.querySelector("#plasmic-app.__wab_user-body");v||((v=document.createElement("div")).id="plasmic-app",v.classList.add("__wab_user-body"),document.body.appendChild(v));var h=new URLSearchParams(location.hash),g=!!i&&{componentName:h.get("componentName")};return n.createPortal(t.createElement(_,{key:""+p},t.createElement(d.Provider,{value:g},u.get())),v,"plasmic-app")}return m&&window.parent===window?t.createElement("iframe",{src:"https://docs.plasmic.app/app-content/app-host-ready#appHostUrl="+encodeURIComponent(location.href),style:{width:"100vw",height:"100vh",border:"none",position:"fixed",top:0,left:0,zIndex:99999999}}):null}var h=function(e){var r=e.enableWebpackHmr,n=t.useState(null),a=n[0],o=n[1];return t.useEffect((function(){o(t.createElement(v,null))}),[]),t.createElement(t.Fragment,null,!r&&t.createElement(b,null),a)},g=[];function y(e){return g.push(e),function(){var t=g.indexOf(e);t>=0&&g.splice(t,1)}}var _=function(e){var r,n;function a(t){var r;return(r=e.call(this,t)||this).state={},r}n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,o(r,n),a.getDerivedStateFromError=function(e){return{error:e}};var i=a.prototype;return i.componentDidCatch=function(e){g.forEach((function(t){return t(e)}))},i.render=function(){return this.state.error?t.createElement("div",null,"Error: ",""+this.state.error.message):t.createElement(t.Fragment,null,this.props.children)},a}(t.Component);function b(){return null}var x=t.createContext(void 0);function P(e){return"__plasmic_meta_"+e}function E(e){return e}function C(e,t){if(t){for(var r,n=e,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,void 0):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split("."));!(r=a()).done;){var o;n=null==(o=n)?void 0:o[r.value]}return n}}function w(e){return C(S(),e)}function R(e){void 0===e&&(e={});var t=S();return Object.fromEntries(Object.entries(e).filter((function(e){return!!e[0]&&!!e[1]})).map((function(e){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t}(e[0],C(t,e[1]))})))}function S(){return t.useContext(x)}function j(e){var t,n,o=e.name,i=e.data,s=e.hidden,l=e.label,u=e.children,c=null!=(t=S())?t:{};return o?r.createElement(x.Provider,{value:a({},c,(n={},n[o]=i,n[P(o)]={hidden:s,label:l},n))},u):r.createElement(r.Fragment,null,u)}function O(e){var t=e.params,n=e.query;return r.createElement(j,{name:"params",data:void 0===t?{}:t,label:"Page route params"},r.createElement(j,{name:"query",data:void 0===n?{}:n,label:"Page query params"},e.children))}function T(e){return(0,e.children)(S())}var D=globalThis;function F(e,t){D.__PlasmicFetcherRegistry.push({fetcher:e,meta:t})}D.__PlasmicFetcherRegistry=[];var A=globalThis;function M(e,t){A.__PlasmicComponentRegistry.push({component:e,meta:t})}null==A.__PlasmicComponentRegistry&&(A.__PlasmicComponentRegistry=[]);var k=globalThis;function q(e,t){k.__PlasmicContextRegistry.push({component:e,meta:t})}null==k.__PlasmicContextRegistry&&(k.__PlasmicContextRegistry=[]);var V,H,L=globalThis;function N(e,t){L.__PlasmicTraitRegistry.push({trait:e,meta:t})}function U(e,t){return I(e,t)}null==L.__PlasmicTraitRegistry&&(L.__PlasmicTraitRegistry=[]);var I=function(e,r){return e?r:Array.isArray(r)?r.map((function(t){return U(e,t)})):r&&t.isValidElement(r)&&"string"!=typeof r?t.cloneElement(r):r},G=globalThis,z=null!=(V=null==G||null==(H=G.__Sub)?void 0:H.setRepeatedElementFn)?V:function(e){I=e},W={__proto__:null,PlasmicCanvasContext:d,PlasmicCanvasHost:h,usePlasmicCanvasContext:f,unstable_registerFetcher:F,registerComponent:M,registerGlobalContext:q,registerTrait:N,repeatedElement:U,DataContext:x,mkMetaName:P,mkMetaValue:E,applySelector:C,useSelector:w,useSelectors:R,useDataEnv:S,DataProvider:j,PageParamsProvider:O,DataCtxReader:T},$=globalThis;null==$.__Sub&&(console.log("Plasmic: Setting up app host dependencies"),$.__Sub=a({React:t,ReactDOM:n,hostModule:W,hostVersion:"1.0.59",hostUtils:{setPlasmicRootNode:m,registerRenderErrorListener:y,setRepeatedElementFn:z},setPlasmicRootNode:m,registerRenderErrorListener:y,setRepeatedElementFn:z},W)),exports.DataContext=x,exports.DataCtxReader=T,exports.DataProvider=j,exports.PageParamsProvider=O,exports.PlasmicCanvasContext=d,exports.PlasmicCanvasHost=h,exports.applySelector=C,exports.mkMetaName=P,exports.mkMetaValue=E,exports.registerComponent=M,exports.registerGlobalContext=q,exports.registerTrait=N,exports.repeatedElement=U,exports.unstable_registerFetcher=F,exports.useDataEnv=S,exports.usePlasmicCanvasContext=f,exports.useSelector=w,exports.useSelectors=R;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-dom");function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var s=globalThis;null==s.__PlasmicHostVersion&&(s.__PlasmicHostVersion="2");var l=[],u=new function(e){var t=this;this.value=null,this.set=function(e){t.value=e,l.forEach((function(e){return e()}))},this.get=function(){return t.value}}(null);function c(){return function(e,t){if(void 0===t&&(t=""),null==e)throw t=(function(e){return"string"==typeof e}(t)?t:t())||"",new Error("Value must not be undefined or null"+(t?"- "+t:""));return e}(new URL("https://fakeurl/"+location.hash.replace(/#/,"?")).searchParams.get("origin"),"Missing information from Plasmic window.")}var p=0;function m(e){p++,u.set(e)}var d=t.createContext(!1),f=function(){return t.useContext(d)};function v(){var e,r,a,o=!!window.parent,i=!(null==(e=location.hash)||!e.match(/\bcanvas=true\b/)),s=!(null==(r=location.hash)||!r.match(/\blive=true\b/))||!o,m=o&&!document.querySelector("#plasmic-studio-tag")&&!i&&!s,f=(a=t.useState(0)[1],t.useCallback((function(){a((function(e){return e+1}))}),[]));if(t.useLayoutEffect((function(){return l.push(f),function(){var e=l.indexOf(f);e>=0&&l.splice(e,1)}}),[f]),t.useEffect((function(){var e,t;m&&o&&window.parent!==window&&(e=document.createElement("script"),t=c(),e.src=t+"/static/js/studio.js",document.body.appendChild(e))}),[m,o]),t.useEffect((function(){if(!m&&!document.querySelector("#getlibs")&&s){var e=document.createElement("script");e.id="getlibs",e.src=c()+"/static/js/getlibs.js",e.async=!1,e.onload=function(){null==window.__GetlibsReadyResolver||window.__GetlibsReadyResolver()},document.head.append(e)}}),[m]),!o)return null;if(i||s){var v=document.querySelector("#plasmic-app.__wab_user-body");v||((v=document.createElement("div")).id="plasmic-app",v.classList.add("__wab_user-body"),document.body.appendChild(v));var h=new URLSearchParams(location.hash),g=!!i&&{componentName:h.get("componentName")};return n.createPortal(t.createElement(_,{key:""+p},t.createElement(d.Provider,{value:g},u.get())),v,"plasmic-app")}return m&&window.parent===window?t.createElement("iframe",{src:"https://docs.plasmic.app/app-content/app-host-ready#appHostUrl="+encodeURIComponent(location.href),style:{width:"100vw",height:"100vh",border:"none",position:"fixed",top:0,left:0,zIndex:99999999}}):null}var h=function(e){var r=e.enableWebpackHmr,n=t.useState(null),a=n[0],o=n[1];return t.useEffect((function(){o(t.createElement(v,null))}),[]),t.createElement(t.Fragment,null,!r&&t.createElement(b,null),a)},g=[];function y(e){return g.push(e),function(){var t=g.indexOf(e);t>=0&&g.splice(t,1)}}var _=function(e){var r,n;function a(t){var r;return(r=e.call(this,t)||this).state={},r}n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,o(r,n),a.getDerivedStateFromError=function(e){return{error:e}};var i=a.prototype;return i.componentDidCatch=function(e){g.forEach((function(t){return t(e)}))},i.render=function(){return this.state.error?t.createElement("div",null,"Error: ",""+this.state.error.message):t.createElement(t.Fragment,null,this.props.children)},a}(t.Component);function b(){return null}var x=t.createContext(void 0);function P(e){return"__plasmic_meta_"+e}function E(e){return e}function C(e,t){if(t){for(var r,n=e,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,void 0):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split("."));!(r=a()).done;){var o;n=null==(o=n)?void 0:o[r.value]}return n}}function w(e){return C(S(),e)}function R(e){void 0===e&&(e={});var t=S();return Object.fromEntries(Object.entries(e).filter((function(e){return!!e[0]&&!!e[1]})).map((function(e){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t}(e[0],C(t,e[1]))})))}function S(){return t.useContext(x)}function j(e){var t,n,o=e.name,i=e.data,s=e.hidden,l=e.label,u=e.children,c=null!=(t=S())?t:{};return o?r.createElement(x.Provider,{value:a({},c,(n={},n[o]=i,n[P(o)]={hidden:s,label:l},n))},u):r.createElement(r.Fragment,null,u)}function O(e){var t=e.params,n=e.query;return r.createElement(j,{name:"params",data:void 0===t?{}:t,label:"Page route params"},r.createElement(j,{name:"query",data:void 0===n?{}:n,label:"Page query params"},e.children))}function T(e){return(0,e.children)(S())}var D=globalThis;function F(e,t){D.__PlasmicFetcherRegistry.push({fetcher:e,meta:t})}D.__PlasmicFetcherRegistry=[];var A=globalThis;function M(e,t){A.__PlasmicComponentRegistry.push({component:e,meta:t})}null==A.__PlasmicComponentRegistry&&(A.__PlasmicComponentRegistry=[]);var k=globalThis;function q(e,t){k.__PlasmicContextRegistry.push({component:e,meta:t})}null==k.__PlasmicContextRegistry&&(k.__PlasmicContextRegistry=[]);var V,H,L=globalThis;function N(e,t){L.__PlasmicTraitRegistry.push({trait:e,meta:t})}function U(e,t){return I(e,t)}null==L.__PlasmicTraitRegistry&&(L.__PlasmicTraitRegistry=[]);var I=function(e,r){return Array.isArray(r)?r.map((function(t){return I(e,t)})):r&&t.isValidElement(r)&&"string"!=typeof r?t.cloneElement(r):r},G=globalThis,z=null!=(V=null==G||null==(H=G.__Sub)?void 0:H.setRepeatedElementFn)?V:function(e){I=e},W={__proto__:null,PlasmicCanvasContext:d,PlasmicCanvasHost:h,usePlasmicCanvasContext:f,unstable_registerFetcher:F,registerComponent:M,registerGlobalContext:q,registerTrait:N,repeatedElement:U,DataContext:x,mkMetaName:P,mkMetaValue:E,applySelector:C,useSelector:w,useSelectors:R,useDataEnv:S,DataProvider:j,PageParamsProvider:O,DataCtxReader:T},$=globalThis;null==$.__Sub&&(console.log("Plasmic: Setting up app host dependencies"),$.__Sub=a({React:t,ReactDOM:n,hostModule:W,hostVersion:"1.0.60",hostUtils:{setPlasmicRootNode:m,registerRenderErrorListener:y,setRepeatedElementFn:z},setPlasmicRootNode:m,registerRenderErrorListener:y,setRepeatedElementFn:z},W)),exports.DataContext=x,exports.DataCtxReader=T,exports.DataProvider=j,exports.PageParamsProvider=O,exports.PlasmicCanvasContext=d,exports.PlasmicCanvasHost=h,exports.applySelector=C,exports.mkMetaName=P,exports.mkMetaValue=E,exports.registerComponent=M,exports.registerGlobalContext=q,exports.registerTrait=N,exports.repeatedElement=U,exports.unstable_registerFetcher=F,exports.useDataEnv=S,exports.usePlasmicCanvasContext=f,exports.useSelector=w,exports.useSelectors=R;
//# sourceMappingURL=host.cjs.production.min.js.map

@@ -471,25 +471,10 @@ import * as React from 'react';

var _root$__Sub$setRepeat, _root$__Sub;
/**
* Allows a component from Plasmic Studio to be repeated.
* `isPrimary` should be true for at most one instance of the component, and
* indicates which copy of the element will be highlighted when the element is
* selected in Studio.
* If `isPrimary` is `false`, and `elt` is a React element (or an array of such),
* it'll be cloned (using React.cloneElement) and ajusted if it's a component
* from Plasmic Studio. Otherwise, if `elt` is not a React element, the original
* value is returned.
*/
function repeatedElement(isPrimary, elt) {
return repeatedElementFn(isPrimary, elt);
function repeatedElement(index, elt) {
return _repeatedElementFn(index, elt);
}
var repeatedElementFn = function repeatedElementFn(isPrimary, elt) {
if (isPrimary) {
return elt;
}
var _repeatedElementFn = function repeatedElementFn(index, elt) {
if (Array.isArray(elt)) {
return elt.map(function (v) {
return repeatedElement(isPrimary, v);
return _repeatedElementFn(index, v);
});

@@ -507,3 +492,3 @@ }

var setRepeatedElementFn = (_root$__Sub$setRepeat = root$5 == null ? void 0 : (_root$__Sub = root$5.__Sub) == null ? void 0 : _root$__Sub.setRepeatedElementFn) != null ? _root$__Sub$setRepeat : function (fn) {
repeatedElementFn = fn;
_repeatedElementFn = fn;
};

@@ -535,3 +520,3 @@

var hostVersion = "1.0.59";
var hostVersion = "1.0.60";

@@ -538,0 +523,0 @@ var root$6 = globalThis;

/**
* Allows a component from Plasmic Studio to be repeated.
* `isPrimary` should be true for at most one instance of the component, and
* Allows elements to be repeated in Plasmic Studio.
* @param index The index of the copy (starting at 0).
* @param elt the React element to be repeated (or an array of such).
*/
export default function repeatedElement<T>(index: number, elt: T): T;
/**
* Allows elements to be repeated in Plasmic Studio.
* @param isPrimary should be true for at most one instance of the element, and
* indicates which copy of the element will be highlighted when the element is
* selected in Studio.
* If `isPrimary` is `false`, and `elt` is a React element (or an array of such),
* it'll be cloned (using React.cloneElement) and ajusted if it's a component
* from Plasmic Studio. Otherwise, if `elt` is not a React element, the original
* value is returned.
* @param elt the React element to be repeated (or an array of such).
*/
export default function repeatedElement<T>(isPrimary: boolean, elt: T): T;
export declare const setRepeatedElementFn: (fn: typeof repeatedElement) => void;

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

export declare const hostVersion = "1.0.59";
export declare const hostVersion = "1.0.60";
{
"name": "@plasmicapp/host",
"version": "1.0.59",
"version": "1.0.60",
"description": "plasmic library for app hosting",

@@ -58,3 +58,3 @@ "main": "dist/index.js",

},
"gitHead": "6997c79202742f5574c50117c218b10d736deba5"
"gitHead": "686288f6420d91e40f5885c4977397fe89492bb9"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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