@machinemetrics/mm-react-embeddable 1.0.9-0 → 1.0.9-1
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: ${f=>f.$isReady?"visible":"hidden"};
|
|
35
|
-
`,Je=({id:f,src:b,path:C,onInit:p=()=>{},context:_={},params:E={},...M})=>{if("isConfiguring"in M)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in _)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in _)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const T=c.useRef(),[y,F]=c.useState(),[g,h]=c.useState(0),{registerFrame:P,unregisterFrame:D,sendMessage:I}=c.useContext(ie),[Z,s]=c.useState(!0),[u,n]=c.useState();return c.useEffect(()=>{g&&I(f,"set-context",{context:{..._,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[_,E.colorMode,E.isFullScreen,f,g]),c.useEffect(()=>{g&&(I(f,"set-params",{params:E}),I(f,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,f,g]),c.useEffect(()=>{C!==void 0&&n(C)},[C]),c.useEffect(()=>{u===void 0||!g||I(f,"navigate",{path:u})},[u,g,f,I]),c.useEffect(()=>{if(!(!b||!f||!T))return(async()=>{const d=await Ze(b);if(s(d),d){const w=new URL(b);P(f,w.origin,T),p(),F(`${w.origin}/mm-embedded-interop?id=${f}&origin=${window.location.origin}`);return}})(),()=>{D(f)}},[b,f,P,T]),Be(f,"ready",()=>h(d=>d+1)),Z?oe.jsx(wr,{$isReady:g,ref:T,src:y,...M}):oe.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:oe.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Je.propTypes={id:H.string,src:H.string.isRequired,path:H.string,onInit:H.func};exports.MMEmbeddableZone=Je;exports.MMEmbeddableZoneContext=ie;exports.MMEmbeddableZoneProvider=Ve;exports.getAppInfo=qe;exports.testIsEmbeddable=Ze;exports.useEmbeddedEffect=Be;
|
|
35
|
+
`,Je=({id:f,src:b,path:C,onInit:p=()=>{},context:_={},params:E={},...M})=>{if("isConfiguring"in M)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in _)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in _)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const T=c.useRef(),[y,F]=c.useState(),[g,h]=c.useState(0),{registerFrame:P,unregisterFrame:D,sendMessage:I}=c.useContext(ie),[Z,s]=c.useState(!0),[u,n]=c.useState();return c.useEffect(()=>{g&&I(f,"set-context",{context:{..._,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[_,E.colorMode,E.isFullScreen,f,g]),c.useEffect(()=>{g&&(I(f,"set-params",{params:E}),I(f,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,f,g]),c.useEffect(()=>{C!==void 0&&n(C||"/")},[C]),c.useEffect(()=>{u===void 0||!g||I(f,"navigate",{path:u})},[u,g,f,I]),c.useEffect(()=>{if(!(!b||!f||!T))return(async()=>{const d=await Ze(b);if(s(d),d){const w=new URL(b);P(f,w.origin,T),p(),F(`${w.origin}/mm-embedded-interop?id=${f}&origin=${window.location.origin}`);return}})(),()=>{D(f)}},[b,f,P,T]),Be(f,"ready",()=>h(d=>d+1)),Z?oe.jsx(wr,{$isReady:g,ref:T,src:y,...M}):oe.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:oe.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Je.propTypes={id:H.string,src:H.string.isRequired,path:H.string,onInit:H.func};exports.MMEmbeddableZone=Je;exports.MMEmbeddableZoneContext=ie;exports.MMEmbeddableZoneProvider=Ve;exports.getAppInfo=qe;exports.testIsEmbeddable=Ze;exports.useEmbeddedEffect=Be;
|
|
@@ -798,7 +798,7 @@ const Pr = Ve.default || Ve, jr = Pr.iframe`
|
|
|
798
798
|
}, [R, m.colorMode, m.isFullScreen, l, g]), $(() => {
|
|
799
799
|
g && (I(l, "set-params", { params: m }), I(l, "set-configuring", { isConfiguring: m.isConfiguring }));
|
|
800
800
|
}, [m, l, g]), $(() => {
|
|
801
|
-
w !== void 0 && n(w);
|
|
801
|
+
w !== void 0 && n(w || "/");
|
|
802
802
|
}, [w]), $(() => {
|
|
803
803
|
u === void 0 || !g || I(l, "navigate", { path: u });
|
|
804
804
|
}, [u, g, l, I]), $(() => {
|
|
@@ -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: ${f=>f.$isReady?"visible":"hidden"};
|
|
35
|
-
`,Se=({id:f,src:b,path:C,onInit:p=()=>{},context:_={},params:E={},...F})=>{if("isConfiguring"in F)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in _)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in _)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const S=o.useRef(),[y,I]=o.useState(),[g,h]=o.useState(0),{registerFrame:j,unregisterFrame:W,sendMessage:A}=o.useContext(ee),[z,u]=o.useState(!0),[c,n]=o.useState();return o.useEffect(()=>{g&&A(f,"set-context",{context:{..._,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[_,E.colorMode,E.isFullScreen,f,g]),o.useEffect(()=>{g&&(A(f,"set-params",{params:E}),A(f,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,f,g]),o.useEffect(()=>{C!==void 0&&n(C)},[C]),o.useEffect(()=>{c===void 0||!g||A(f,"navigate",{path:c})},[c,g,f,A]),o.useEffect(()=>{if(!(!b||!f||!S))return(async()=>{const d=await we(b);if(u(d),d){const w=new URL(b);j(f,w.origin,S),p(),I(`${w.origin}/mm-embedded-interop?id=${f}&origin=${window.location.origin}`);return}})(),()=>{W(f)}},[b,f,j,S]),Ce(f,"ready",()=>h(d=>d+1)),z?$.jsx(Xe,{$isReady:g,ref:S,src:y,...F}):$.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:$.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Se.propTypes={id:K.string,src:K.string.isRequired,path:K.string,onInit:K.func},O.MMEmbeddableZone=Se,O.MMEmbeddableZoneContext=ee,O.MMEmbeddableZoneProvider=Re,O.getAppInfo=_e,O.testIsEmbeddable=we,O.useEmbeddedEffect=Ce,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
|
35
|
+
`,Se=({id:f,src:b,path:C,onInit:p=()=>{},context:_={},params:E={},...F})=>{if("isConfiguring"in F)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in _)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in _)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const S=o.useRef(),[y,I]=o.useState(),[g,h]=o.useState(0),{registerFrame:j,unregisterFrame:W,sendMessage:A}=o.useContext(ee),[z,u]=o.useState(!0),[c,n]=o.useState();return o.useEffect(()=>{g&&A(f,"set-context",{context:{..._,colorMode:E.colorMode,isFullScreen:E.isFullScreen}})},[_,E.colorMode,E.isFullScreen,f,g]),o.useEffect(()=>{g&&(A(f,"set-params",{params:E}),A(f,"set-configuring",{isConfiguring:E.isConfiguring}))},[E,f,g]),o.useEffect(()=>{C!==void 0&&n(C||"/")},[C]),o.useEffect(()=>{c===void 0||!g||A(f,"navigate",{path:c})},[c,g,f,A]),o.useEffect(()=>{if(!(!b||!f||!S))return(async()=>{const d=await we(b);if(u(d),d){const w=new URL(b);j(f,w.origin,S),p(),I(`${w.origin}/mm-embedded-interop?id=${f}&origin=${window.location.origin}`);return}})(),()=>{W(f)}},[b,f,j,S]),Ce(f,"ready",()=>h(d=>d+1)),z?$.jsx(Xe,{$isReady:g,ref:S,src:y,...F}):$.jsx("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"},children:$.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Se.propTypes={id:K.string,src:K.string.isRequired,path:K.string,onInit:K.func},O.MMEmbeddableZone=Se,O.MMEmbeddableZoneContext=ee,O.MMEmbeddableZoneProvider=Re,O.getAppInfo=_e,O.testIsEmbeddable=we,O.useEmbeddedEffect=Ce,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|