@plasmicapp/host
Advanced tools
Comparing version 1.0.81 to 1.0.82
@@ -7,2 +7,3 @@ 'use strict'; | ||
var PlasmicQuery = require('@plasmicapp/query'); | ||
var React = require('react'); | ||
@@ -548,3 +549,3 @@ var React__default = _interopDefault(React); | ||
var hostVersion = "1.0.81"; | ||
var hostVersion = "1.0.82"; | ||
@@ -562,2 +563,3 @@ var root$6 = globalThis; | ||
ReactDOM: ReactDOM, | ||
PlasmicQuery: PlasmicQuery, | ||
hostModule: hostModule, | ||
@@ -564,0 +566,0 @@ hostVersion: hostVersion, |
@@ -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 m=0;function p(e){m++,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,p=o&&!document.querySelector("#plasmic-studio-tag")&&!i&&!s,f=new URLSearchParams(location.hash),v=t.useState((function(){var e;return JSON.parse(null!=(e=f.get("globalVariants"))?e:"{}")})),h=v[0],g=v[1],y=(a=t.useState(0)[1],t.useCallback((function(){a((function(e){return e+1}))}),[]));if(t.useLayoutEffect((function(){return l.push(y),function(){var e=l.indexOf(y);e>=0&&l.splice(e,1)}}),[y]),t.useEffect((function(){var e,t;p&&o&&window.parent!==window&&(e=document.createElement("script"),t=c(),e.src=t+"/static/js/studio.js",document.body.appendChild(e))}),[p,o]),t.useEffect((function(){if(!p&&!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)}}),[p]),t.useEffect((function(){var e=function(e){try{var t=JSON.parse(e.data);"canvas-frame"===t.source&&g(t.activeGlobalVariants)}catch(e){}};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}),[]),!o)return null;if(i||s){var _=document.querySelector("#plasmic-app.__wab_user-body");_||((_=document.createElement("div")).id="plasmic-app",_.classList.add("__wab_user-body"),document.body.appendChild(_));var x=!!i&&{componentName:f.get("componentName"),globalVariants:h};return n.createPortal(t.createElement(b,{key:""+m},t.createElement(d.Provider,{value:x},u.get())),_,"plasmic-app")}return p&&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(_,null),a)},g=[];function y(e){return g.push(e),function(){var t=g.indexOf(e);t>=0&&g.splice(t,1)}}var b=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 _(){return null}var x=t.createContext(void 0);function E(e){return"__plasmic_meta_"+e}function P(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 O(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[E(o)]={hidden:s,label:l},n))},u):r.createElement(r.Fragment,null,u)}function j(e){var t=e.children,n=e.params,o=void 0===n?{}:n,i=e.query,s=void 0===i?{}:i,l=S()||{};return r.createElement(O,{name:"params",data:a({},l.params,o),label:"Page route params"},r.createElement(O,{name:"query",data:a({},l.query,s),label:"Page query params"},t))}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 V=globalThis;function q(e,t){V.__PlasmicComponentRegistry.push({component:e,meta:t})}null==V.__PlasmicComponentRegistry&&(V.__PlasmicComponentRegistry=[]);var A=globalThis;function M(e,t){A.__PlasmicContextRegistry.push({component:e,meta:t})}null==A.__PlasmicContextRegistry&&(A.__PlasmicContextRegistry=[]);var k,L,N=globalThis;function H(e,t){N.__PlasmicTraitRegistry.push({trait:e,meta:t})}function U(e,t){return G(e,t)}null==N.__PlasmicTraitRegistry&&(N.__PlasmicTraitRegistry=[]);var G=function(e,r){return Array.isArray(r)?r.map((function(t){return G(e,t)})):r&&t.isValidElement(r)&&"string"!=typeof r?t.cloneElement(r):r},I=globalThis,J=null!=(k=null==I||null==(L=I.__Sub)?void 0:L.setRepeatedElementFn)?k:function(e){G=e},z={__proto__:null,PlasmicCanvasContext:d,PlasmicCanvasHost:h,usePlasmicCanvasContext:f,unstable_registerFetcher:F,registerComponent:q,registerGlobalContext:M,registerTrait:H,repeatedElement:U,DataContext:x,mkMetaName:E,mkMetaValue:P,applySelector:C,useSelector:w,useSelectors:R,useDataEnv:S,DataProvider:O,PageParamsProvider:j,DataCtxReader:T},W=globalThis;null==W.__Sub&&(W.__Sub=a({React:t,ReactDOM:n,hostModule:z,hostVersion:"1.0.81",hostUtils:{setPlasmicRootNode:p,registerRenderErrorListener:y,setRepeatedElementFn:J},setPlasmicRootNode:p,registerRenderErrorListener:y,setRepeatedElementFn:J},z)),exports.DataContext=x,exports.DataCtxReader=T,exports.DataProvider=O,exports.PageParamsProvider=j,exports.PlasmicCanvasContext=d,exports.PlasmicCanvasHost=h,exports.applySelector=C,exports.mkMetaName=E,exports.mkMetaValue=P,exports.registerComponent=q,exports.registerGlobalContext=M,exports.registerTrait=H,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("@plasmicapp/query"),r=require("react"),n=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-dom");function o(){return(o=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 i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(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 l=globalThis;null==l.__PlasmicHostVersion&&(l.__PlasmicHostVersion="2");var u=[],c=new function(e){var t=this;this.value=null,this.set=function(e){t.value=e,u.forEach((function(e){return e()}))},this.get=function(){return t.value}}(null);function m(){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 d(e){p++,c.set(e)}var f=r.createContext(!1),v=function(){return r.useContext(f)};function h(){var e,t,n,o=!!window.parent,i=!(null==(e=location.hash)||!e.match(/\bcanvas=true\b/)),s=!(null==(t=location.hash)||!t.match(/\blive=true\b/))||!o,l=o&&!document.querySelector("#plasmic-studio-tag")&&!i&&!s,d=new URLSearchParams(location.hash),v=r.useState((function(){var e;return JSON.parse(null!=(e=d.get("globalVariants"))?e:"{}")})),h=v[0],g=v[1],y=(n=r.useState(0)[1],r.useCallback((function(){n((function(e){return e+1}))}),[]));if(r.useLayoutEffect((function(){return u.push(y),function(){var e=u.indexOf(y);e>=0&&u.splice(e,1)}}),[y]),r.useEffect((function(){var e,t;l&&o&&window.parent!==window&&(e=document.createElement("script"),t=m(),e.src=t+"/static/js/studio.js",document.body.appendChild(e))}),[l,o]),r.useEffect((function(){if(!l&&!document.querySelector("#getlibs")&&s){var e=document.createElement("script");e.id="getlibs",e.src=m()+"/static/js/getlibs.js",e.async=!1,e.onload=function(){null==window.__GetlibsReadyResolver||window.__GetlibsReadyResolver()},document.head.append(e)}}),[l]),r.useEffect((function(){var e=function(e){try{var t=JSON.parse(e.data);"canvas-frame"===t.source&&g(t.activeGlobalVariants)}catch(e){}};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}),[]),!o)return null;if(i||s){var b=document.querySelector("#plasmic-app.__wab_user-body");b||((b=document.createElement("div")).id="plasmic-app",b.classList.add("__wab_user-body"),document.body.appendChild(b));var x=!!i&&{componentName:d.get("componentName"),globalVariants:h};return a.createPortal(r.createElement(_,{key:""+p},r.createElement(f.Provider,{value:x},c.get())),b,"plasmic-app")}return l&&window.parent===window?r.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 g=function(e){var t=e.enableWebpackHmr,n=r.useState(null),a=n[0],o=n[1];return r.useEffect((function(){o(r.createElement(h,null))}),[]),r.createElement(r.Fragment,null,!t&&r.createElement(x,null),a)},y=[];function b(e){return y.push(e),function(){var t=y.indexOf(e);t>=0&&y.splice(t,1)}}var _=function(e){var t,n;function a(t){var r;return(r=e.call(this,t)||this).state={},r}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),a.getDerivedStateFromError=function(e){return{error:e}};var o=a.prototype;return o.componentDidCatch=function(e){y.forEach((function(t){return t(e)}))},o.render=function(){return this.state.error?r.createElement("div",null,"Error: ",""+this.state.error.message):r.createElement(r.Fragment,null,this.props.children)},a}(r.Component);function x(){return null}var P=r.createContext(void 0);function E(e){return"__plasmic_meta_"+e}function C(e){return e}function w(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 s(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)?s(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 R(e){return w(O(),e)}function S(e){void 0===e&&(e={});var t=O();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],w(t,e[1]))})))}function O(){return r.useContext(P)}function j(e){var t,r,a=e.name,i=e.data,s=e.hidden,l=e.label,u=e.children,c=null!=(t=O())?t:{};return a?n.createElement(P.Provider,{value:o({},c,(r={},r[a]=i,r[E(a)]={hidden:s,label:l},r))},u):n.createElement(n.Fragment,null,u)}function T(e){var t=e.children,r=e.params,a=void 0===r?{}:r,i=e.query,s=void 0===i?{}:i,l=O()||{};return n.createElement(j,{name:"params",data:o({},l.params,a),label:"Page route params"},n.createElement(j,{name:"query",data:o({},l.query,s),label:"Page query params"},t))}function q(e){return(0,e.children)(O())}var D=globalThis;function F(e,t){D.__PlasmicFetcherRegistry.push({fetcher:e,meta:t})}D.__PlasmicFetcherRegistry=[];var V=globalThis;function A(e,t){V.__PlasmicComponentRegistry.push({component:e,meta:t})}null==V.__PlasmicComponentRegistry&&(V.__PlasmicComponentRegistry=[]);var M=globalThis;function k(e,t){M.__PlasmicContextRegistry.push({component:e,meta:t})}null==M.__PlasmicContextRegistry&&(M.__PlasmicContextRegistry=[]);var L,N,H=globalThis;function U(e,t){H.__PlasmicTraitRegistry.push({trait:e,meta:t})}function G(e,t){return I(e,t)}null==H.__PlasmicTraitRegistry&&(H.__PlasmicTraitRegistry=[]);var I=function(e,t){return Array.isArray(t)?t.map((function(t){return I(e,t)})):t&&r.isValidElement(t)&&"string"!=typeof t?r.cloneElement(t):t},J=globalThis,z=null!=(L=null==J||null==(N=J.__Sub)?void 0:N.setRepeatedElementFn)?L:function(e){I=e},Q={__proto__:null,PlasmicCanvasContext:f,PlasmicCanvasHost:g,usePlasmicCanvasContext:v,unstable_registerFetcher:F,registerComponent:A,registerGlobalContext:k,registerTrait:U,repeatedElement:G,DataContext:P,mkMetaName:E,mkMetaValue:C,applySelector:w,useSelector:R,useSelectors:S,useDataEnv:O,DataProvider:j,PageParamsProvider:T,DataCtxReader:q},W=globalThis;null==W.__Sub&&(W.__Sub=o({React:r,ReactDOM:a,PlasmicQuery:t,hostModule:Q,hostVersion:"1.0.82",hostUtils:{setPlasmicRootNode:d,registerRenderErrorListener:b,setRepeatedElementFn:z},setPlasmicRootNode:d,registerRenderErrorListener:b,setRepeatedElementFn:z},Q)),exports.DataContext=P,exports.DataCtxReader=q,exports.DataProvider=j,exports.PageParamsProvider=T,exports.PlasmicCanvasContext=f,exports.PlasmicCanvasHost=g,exports.applySelector=w,exports.mkMetaName=E,exports.mkMetaValue=C,exports.registerComponent=A,exports.registerGlobalContext=k,exports.registerTrait=U,exports.repeatedElement=G,exports.unstable_registerFetcher=F,exports.useDataEnv=O,exports.usePlasmicCanvasContext=v,exports.useSelector=R,exports.useSelectors=S; | ||
//# sourceMappingURL=host.cjs.production.min.js.map |
@@ -0,1 +1,2 @@ | ||
import * as PlasmicQuery from '@plasmicapp/query'; | ||
import * as React from 'react'; | ||
@@ -545,3 +546,3 @@ import React__default, { useState, useCallback, createContext, useContext, useEffect, createElement, Fragment, useLayoutEffect, Component, isValidElement, cloneElement } from 'react'; | ||
var hostVersion = "1.0.81"; | ||
var hostVersion = "1.0.82"; | ||
@@ -559,2 +560,3 @@ var root$6 = globalThis; | ||
ReactDOM: ReactDOM, | ||
PlasmicQuery: PlasmicQuery, | ||
hostModule: hostModule, | ||
@@ -561,0 +563,0 @@ hostVersion: hostVersion, |
@@ -1,1 +0,1 @@ | ||
export declare const hostVersion = "1.0.81"; | ||
export declare const hostVersion = "1.0.82"; |
{ | ||
"name": "@plasmicapp/host", | ||
"version": "1.0.81", | ||
"version": "1.0.82", | ||
"description": "plasmic library for app hosting", | ||
@@ -34,2 +34,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@plasmicapp/query": "^0.1.55", | ||
"window-or-global": "^1.0.1" | ||
@@ -59,3 +60,3 @@ }, | ||
}, | ||
"gitHead": "6d5c0abfccad50013e564f2d2d240668feba6c54" | ||
"gitHead": "1e7d8c058a0dea750ee8ba9cf9afeafc24e569f8" | ||
} |
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
294234
2833
4
+ Added@plasmicapp/query@^0.1.55
+ Added@plasmicapp/query@0.1.79(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedreact@18.3.1(transitive)
+ Addedswr@1.3.0(transitive)