@machinemetrics/mm-react-embeddable 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,4 +32,4 @@ React keys must be passed directly to JSX without using spread:
32
32
  height: 100%;
33
33
  border: none;
34
34
  visibility: ${n=>n.$isReady?"visible":"hidden"};
35
- `,Ne=({id:n,src:o,path:T,onInit:c=()=>{},context:w,params:S,...M})=>{if("isConfiguring"in M)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in w)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in w)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const y=d.useRef(),[R,F]=d.useState(),[b,j]=d.useState(0),{registerFrame:i,unregisterFrame:v,sendMessage:l}=d.useContext(ne),[E,P]=d.useState(!0),[m,g]=d.useState();return d.useEffect(()=>{b&&l(n,"set-context",{context:{...w,colorMode:S.colorMode,isFullScreen:S.isFullScreen}})},[w,S.colorMode,S.isFullScreen,n,b]),d.useEffect(()=>{b&&(l(n,"set-params",{params:S}),l(n,"set-configuring",{isConfiguring:S.isConfiguring}))},[S,n,b]),d.useEffect(()=>{T!==void 0&&g(T)},[T]),d.useEffect(()=>{m===void 0||!b||l(n,"navigate",{path:m})},[m,b,n,l]),d.useEffect(()=>{if(!(!o||!n||!y))return(async()=>{const I=await Je(o);if(P(I),I){const D=new URL(o);i(n,D.origin,y),c(),F(`${D.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{v(n)}},[o,n,i,y]),Ke(n,"ready",()=>j(I=>I+1)),E?te.jsx(kr,{$isReady:b,ref:y,src:R,...M}):te.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:te.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Ne.propTypes={id:J.string,src:J.string.isRequired,path:J.string,onInit:J.func};exports.MMEmbeddableZone=Ne;exports.MMEmbeddableZoneContext=ne;exports.MMEmbeddableZoneProvider=Ze;exports.getAppInfo=Be;exports.testIsEmbeddable=Je;exports.useEmbeddedEffect=Ke;
35
+ `,Ne=({id:n,src:o,path:T,onInit:c=()=>{},context:w={},params:S={},...M})=>{if("isConfiguring"in M)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in w)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in w)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const y=d.useRef(),[R,F]=d.useState(),[b,j]=d.useState(0),{registerFrame:i,unregisterFrame:v,sendMessage:l}=d.useContext(ne),[E,P]=d.useState(!0),[m,g]=d.useState();return d.useEffect(()=>{b&&l(n,"set-context",{context:{...w,colorMode:S.colorMode,isFullScreen:S.isFullScreen}})},[w,S.colorMode,S.isFullScreen,n,b]),d.useEffect(()=>{b&&(l(n,"set-params",{params:S}),l(n,"set-configuring",{isConfiguring:S.isConfiguring}))},[S,n,b]),d.useEffect(()=>{T!==void 0&&g(T)},[T]),d.useEffect(()=>{m===void 0||!b||l(n,"navigate",{path:m})},[m,b,n,l]),d.useEffect(()=>{if(!(!o||!n||!y))return(async()=>{const I=await Je(o);if(P(I),I){const D=new URL(o);i(n,D.origin,y),c(),F(`${D.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{v(n)}},[o,n,i,y]),Ke(n,"ready",()=>j(I=>I+1)),E?te.jsx(kr,{$isReady:b,ref:y,src:R,...M}):te.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:te.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Ne.propTypes={id:J.string,src:J.string.isRequired,path:J.string,onInit:J.func};exports.MMEmbeddableZone=Ne;exports.MMEmbeddableZoneContext=ne;exports.MMEmbeddableZoneProvider=Ze;exports.getAppInfo=Be;exports.testIsEmbeddable=Je;exports.useEmbeddedEffect=Ke;
@@ -784,8 +784,8 @@ const Ar = qe.default || qe, $r = Ar.iframe`
784
784
  path: S,
785
785
  onInit: c = () => {
786
786
  },
787
- context: _,
788
- params: w,
787
+ context: _ = {},
788
+ params: w = {},
789
789
  ...k
790
790
  }) => {
791
791
  if ("isConfiguring" in k)
@@ -32,4 +32,4 @@ React keys must be passed directly to JSX without using spread:
32
32
  height: 100%;
33
33
  border: none;
34
34
  visibility: ${n=>n.$isReady?"visible":"hidden"};
35
- `,Te=({id:n,src:o,path:T,onInit:l=()=>{},context:w,params:C,...I})=>{if("isConfiguring"in I)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in w)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in w)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const y=c.useRef(),[R,F]=c.useState(),[b,k]=c.useState(0),{registerFrame:i,unregisterFrame:v,sendMessage:f}=c.useContext(X),[h,j]=c.useState(!0),[m,g]=c.useState();return c.useEffect(()=>{b&&f(n,"set-context",{context:{...w,colorMode:C.colorMode,isFullScreen:C.isFullScreen}})},[w,C.colorMode,C.isFullScreen,n,b]),c.useEffect(()=>{b&&(f(n,"set-params",{params:C}),f(n,"set-configuring",{isConfiguring:C.isConfiguring}))},[C,n,b]),c.useEffect(()=>{T!==void 0&&g(T)},[T]),c.useEffect(()=>{m===void 0||!b||f(n,"navigate",{path:m})},[m,b,n,f]),c.useEffect(()=>{if(!(!o||!n||!y))return(async()=>{const D=await Se(o);if(j(D),D){const A=new URL(o);i(n,A.origin,y),l(),F(`${A.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{v(n)}},[o,n,i,y]),Ce(n,"ready",()=>k(D=>D+1)),h?z.jsx(tr,{$isReady:b,ref:y,src:R,...I}):z.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Te.propTypes={id:Z.string,src:Z.string.isRequired,path:Z.string,onInit:Z.func},P.MMEmbeddableZone=Te,P.MMEmbeddableZoneContext=X,P.MMEmbeddableZoneProvider=_e,P.getAppInfo=we,P.testIsEmbeddable=Se,P.useEmbeddedEffect=Ce,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
35
+ `,Te=({id:n,src:o,path:T,onInit:l=()=>{},context:w={},params:C={},...I})=>{if("isConfiguring"in I)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in w)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in w)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const y=c.useRef(),[R,F]=c.useState(),[b,k]=c.useState(0),{registerFrame:i,unregisterFrame:v,sendMessage:f}=c.useContext(X),[h,j]=c.useState(!0),[m,g]=c.useState();return c.useEffect(()=>{b&&f(n,"set-context",{context:{...w,colorMode:C.colorMode,isFullScreen:C.isFullScreen}})},[w,C.colorMode,C.isFullScreen,n,b]),c.useEffect(()=>{b&&(f(n,"set-params",{params:C}),f(n,"set-configuring",{isConfiguring:C.isConfiguring}))},[C,n,b]),c.useEffect(()=>{T!==void 0&&g(T)},[T]),c.useEffect(()=>{m===void 0||!b||f(n,"navigate",{path:m})},[m,b,n,f]),c.useEffect(()=>{if(!(!o||!n||!y))return(async()=>{const D=await Se(o);if(j(D),D){const A=new URL(o);i(n,A.origin,y),l(),F(`${A.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`);return}})(),()=>{v(n)}},[o,n,i,y]),Ce(n,"ready",()=>k(D=>D+1)),h?z.jsx(tr,{$isReady:b,ref:y,src:R,...I}):z.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Te.propTypes={id:Z.string,src:Z.string.isRequired,path:Z.string,onInit:Z.func},P.MMEmbeddableZone=Te,P.MMEmbeddableZoneContext=X,P.MMEmbeddableZoneProvider=_e,P.getAppInfo=we,P.testIsEmbeddable=Se,P.useEmbeddedEffect=Ce,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-embeddable",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "license": "MIT",
5
5
  "module": "dist/mm-react-embeddable.es.js",
6
6
  "main": "dist/mm-react-embeddable.cjs.js",