@machinemetrics/mm-react-embeddable 1.3.0-1 → 1.3.0

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.
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),w=require("prop-types"),v=require("styled-components"),T=e.createContext(null),A=({children:t})=>{const[i,l]=e.useState({}),[d,f]=e.useState({}),c=e.useRef({}),g=e.useRef({}),b=e.useRef({}),$=e.useCallback((r,s)=>{var n;return!!((n=b.current[r])!=null&&n.has(s))},[]),E=e.useCallback((r,s,n)=>{l(o=>({...o,[r]:{origin:s,frameRef:n}}))},[]),M=e.useCallback(r=>{l(s=>{const n={...s};return delete n[r],n}),f(s=>{const n={...s};return delete n[r],n}),delete b.current[r]},[]);e.useEffect(()=>{const r=(n=[],o)=>{n.forEach(a=>a(o))},s=n=>{var R,S,F,q,P;if(!((R=n==null?void 0:n.data)!=null&&R.instanceId))return;const{instanceId:o,type:a}=n.data,u=c.current;if(a==="response"){const{callbackId:C,response:H,error:B}=n.data,U=g.current[C];U&&(U(H,B),delete g.current[C]);return}if(a==="mark-registered"){const{requestType:C}=n.data;b.current[o]||(b.current[o]=new Set),b.current[o].add(C);return}a==="ready"&&f(C=>({...C,[o]:!0})),r((S=u[o])==null?void 0:S[a],n.data),r((F=u["*"])==null?void 0:F[a],n.data),r((q=u[o])==null?void 0:q["*"],n.data),r((P=u["*"])==null?void 0:P["*"],n.data)};return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},[i]);const m=e.useCallback((r,s,n)=>{var a,u;const o=i[r];if(!o){console.warn(`Origin not set for id: ${r}. Unable to send message.`);return}(u=(a=o==null?void 0:o.frameRef)==null?void 0:a.current)!=null&&u.contentWindow&&o.frameRef.current.contentWindow.postMessage({type:s,...n,instanceId:r},o.origin)},[i]),y=e.useRef(0),x=e.useCallback(()=>`${Date.now()}-${++y.current}`,[]),h=e.useCallback(async(r,s,n={})=>new Promise((o,a)=>{const u=x(),R=(S,F)=>{delete g.current[u],F?a(F):o(S)};g.current[u]=R,m(r,"request",{callbackId:u,requestType:s,data:n})}),[m]),I=e.useCallback((r,s)=>{m(r,"load-options",s)},[m]),p=e.useCallback((r,s)=>{m(r,"validate",s)},[m]),L=e.useMemo(()=>({registerFrame:E,unregisterFrame:M,sendMessage:m,sendRequest:h,loadOptions:I,validate:p,hasHandler:$,readyFrames:d,addListener:(r,s,n)=>(c.current[r]||(c.current[r]={}),c.current[r][s]||(c.current[r][s]=[]),c.current[r][s].push(n),()=>{c.current[r][s]=c.current[r][s].filter(o=>o!==n)})}),[E,M,m,h,I,p,$,d]);return e.createElement(T.Provider,{value:L},t)},k={},O=async t=>{try{const i=new URL(t).origin;if(k[i]!==void 0)return k[i];const d=await(await fetch(`${i}/mm-app-manifest.json`)).json();if(!d.version)throw new Error("Invalid manifest");return k[i]=d,d}catch{}return k[origin]=!1,!1},j=async t=>!!await O(t),Z=(t,i,l)=>{const d=e.useContext(T);if(d===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const f=e.useRef(l);e.useEffect(()=>{f.current=l},[l]),e.useEffect(()=>{if(!(!t||!i)){if(i.startsWith("key:")){const c=i.substring(4);return d.readyFrames[t]&&d.sendMessage(t,"subscribe-key",{keyChord:c}),d.addListener(t,`key-pressed:${c}`,(...b)=>f.current(...b))}return d.addListener(t,i,(...c)=>f.current(...c))}},[d,t,i])};A.propTypes={children:w.node.isRequired};const D=v.default||v,_=D.iframe`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),C=require("prop-types"),O=require("styled-components"),q=e.createContext(null),W=({children:r})=>{const[u,d]=e.useState({}),[i,R]=e.useState({}),c=e.useRef({}),f=e.useRef({}),b=e.useRef({}),T=e.useCallback((t,s)=>{var n;return!!((n=b.current[t])!=null&&n.has(s))},[]),w=e.useCallback((t,s,n)=>{d(o=>({...o,[t]:{origin:s,frameRef:n}}))},[]),h=e.useCallback(t=>{d(s=>{const n={...s};return delete n[t],n}),R(s=>{const n={...s};return delete n[t],n}),delete b.current[t]},[]);e.useEffect(()=>{const t=(n=[],o)=>{n.forEach(a=>a(o))},s=n=>{var $,y,E,m,k;if(!(($=n==null?void 0:n.data)!=null&&$.instanceId))return;const{instanceId:o,type:a}=n.data,l=c.current;if(a==="response"){const{callbackId:I,response:_,error:H}=n.data,U=f.current[I];U&&(U(_,H),delete f.current[I]);return}if(a==="mark-registered"){const{requestType:I}=n.data;b.current[o]||(b.current[o]=new Set),b.current[o].add(I);return}a==="ready"&&R(I=>({...I,[o]:!0})),t((y=l[o])==null?void 0:y[a],n.data),t((E=l["*"])==null?void 0:E[a],n.data),t((m=l[o])==null?void 0:m["*"],n.data),t((k=l["*"])==null?void 0:k["*"],n.data)};return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},[u]);const g=e.useCallback((t,s,n)=>{var a,l;const o=u[t];if(!o){console.warn(`Origin not set for id: ${t}. Unable to send message.`);return}(l=(a=o==null?void 0:o.frameRef)==null?void 0:a.current)!=null&&l.contentWindow&&o.frameRef.current.contentWindow.postMessage({type:s,...n,instanceId:t},o.origin)},[u]),M=e.useRef(0),P=e.useCallback(()=>`${Date.now()}-${++M.current}`,[]),F=e.useCallback(async(t,s,n={})=>new Promise((o,a)=>{const l=P(),$=(y,E)=>{delete f.current[l],E?a(E):o(y)};f.current[l]=$,g(t,"request",{callbackId:l,requestType:s,data:n})}),[g]),L=e.useCallback((t,s)=>{g(t,"load-options",s)},[g]),p=e.useCallback((t,s)=>{g(t,"validate",s)},[g]),x=e.useMemo(()=>({registerFrame:w,unregisterFrame:h,sendMessage:g,sendRequest:F,loadOptions:L,validate:p,hasHandler:T,readyFrames:i,addListener:(t,s,n)=>(c.current[t]||(c.current[t]={}),c.current[t][s]||(c.current[t][s]=[]),c.current[t][s].push(n),()=>{c.current[t][s]=c.current[t][s].filter(o=>o!==n)})}),[w,h,g,F,L,p,T,i]);return e.createElement(q.Provider,{value:x},r)},Z={},j=async r=>{try{const u=new URL(r).origin;if(Z[u]!==void 0)return Z[u];const i=await(await fetch(`${u}/mm-app-manifest.json`)).json();if(!i.version)throw new Error("Invalid manifest");return Z[u]=i,i}catch{}return Z[origin]=!1,!1},v=async r=>!!await j(r),S=(r,u,d)=>{const i=e.useContext(q);if(i===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const R=e.useRef(d);e.useEffect(()=>{R.current=d},[d]),e.useEffect(()=>{if(!(!r||!u)){if(u.startsWith("key:")){const c=u.substring(4);return i.readyFrames[r]&&i.sendMessage(r,"subscribe-key",{keyChord:c}),i.addListener(r,`key-pressed:${c}`,(...b)=>R.current(...b))}return i.addListener(r,u,(...c)=>R.current(...c))}},[i,r,u])};W.propTypes={children:C.node.isRequired};const z=O.default||O,B=1e4,D=z.iframe`
2
2
  width: 100%;
3
3
  height: 100%;
4
4
  border: none;
5
- visibility: ${t=>t.$isReady?"visible":"hidden"};
6
- `,W=({id:t,src:i,path:l,onInit:d=()=>{},context:f={},params:c={},skipManifestCheck:g=!1,readyTimeout:b=5e3,...$})=>{if("isConfiguring"in $)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in f)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in f)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const E=e.useRef(),[M,m]=e.useState(),[y,x]=e.useState(0),{registerFrame:h,unregisterFrame:I,sendMessage:p}=e.useContext(T),[L,r]=e.useState(!0),[s,n]=e.useState(),o=e.useRef();e.useEffect(()=>{y&&p(t,"set-context",{context:{...f,colorMode:c.colorMode,isFullScreen:c.isFullScreen}})},[f,c.colorMode,c.isFullScreen,t,y]),e.useEffect(()=>{y&&(p(t,"set-params",{params:c}),p(t,"set-configuring",{isConfiguring:c.isConfiguring}))},[c,t,y]),e.useEffect(()=>{l!==void 0&&n((l==null?void 0:l.indexOf("/"))===0?l:`/${l}`)},[l]),e.useEffect(()=>{s===void 0||!y||p(t,"navigate",{path:s})},[s,y,t,p]),e.useEffect(()=>{if(!(!i||!t||!E)){if(g){const u=new URL(i);h(t,u.origin,E),d(),m(`${u.origin}/mm-embedded-interop?id=${t}&origin=${window.location.origin}`)}else(async()=>{const u=await j(i);if(r(u),u){const R=new URL(i);h(t,R.origin,E),d(),m(`${R.origin}/mm-embedded-interop?id=${t}&origin=${window.location.origin}`)}})();return()=>{I(t)}}},[i,t,h,E,g]),e.useEffect(()=>{if(!(!g||!M||b==null))return o.current=setTimeout(()=>r(!1),b),()=>clearTimeout(o.current)},[M,g,b]),Z(t,"ready",()=>{clearTimeout(o.current),x(u=>u+1)});const a=e.useRef();return Z(t,"heartbeat",()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{if(E.current){const u=new URL(i);E.current.src=`${u.origin}/mm-embedded-interop?id=${t}&origin=${window.location.origin}`}},6e3)}),e.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),L?e.createElement(_,{$isReady:y,ref:E,src:M,...$}):e.createElement("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{textAlign:"center"}},"Application must support the MM App Framework to be embedded."))};W.propTypes={id:w.string,src:w.string.isRequired,path:w.string,onInit:w.func,skipManifestCheck:w.bool,readyTimeout:w.number};exports.MMEmbeddableZone=W;exports.MMEmbeddableZoneContext=T;exports.MMEmbeddableZoneProvider=A;exports.getAppInfo=O;exports.testIsEmbeddable=j;exports.useEmbeddedEffect=Z;
5
+ visibility: ${r=>r.$isReady?"visible":"hidden"};
6
+ `,A=({id:r,src:u,path:d,onInit:i=()=>{},onTimeout:R,context:c={},params:f={},skipManifestCheck:b=!1,...T})=>{if("isConfiguring"in T)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in c)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in c)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const w=e.useRef(),[h,g]=e.useState(),[M,P]=e.useState(0),{registerFrame:F,unregisterFrame:L,sendMessage:p}=e.useContext(q),[x,t]=e.useState(!0),[s,n]=e.useState(),o=e.useRef(),a=e.useRef(R),l=e.useRef(i),$=e.useRef(!1);e.useEffect(()=>{a.current=R},[R]),e.useEffect(()=>{l.current=i},[i]),e.useEffect(()=>{M&&p(r,"set-context",{context:{...c,colorMode:f.colorMode,isFullScreen:f.isFullScreen}})},[c,f.colorMode,f.isFullScreen,r,M]),e.useEffect(()=>{M&&(p(r,"set-params",{params:f}),p(r,"set-configuring",{isConfiguring:f.isConfiguring}))},[f,r,M]),e.useEffect(()=>{d!==void 0&&n((d==null?void 0:d.indexOf("/"))===0?d:`/${d}`)},[d]),e.useEffect(()=>{s===void 0||!M||p(r,"navigate",{path:s})},[s,M,r,p]),e.useEffect(()=>{if(!(!u||!r||!w)){if(b){const m=new URL(u);t(!0),F(r,m.origin,w),l.current(),g(`${m.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`)}else(async()=>{const m=await v(u);if(t(m),m){const k=new URL(u);F(r,k.origin,w),l.current(),g(`${k.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`)}})();return()=>{L(r)}}},[u,r,F,w,b]),e.useEffect(()=>{if(!(!b||!h||$.current))return o.current=setTimeout(()=>{a.current&&a.current()},B),()=>clearTimeout(o.current)},[h,b]);const y=e.useCallback(()=>{$.current=!0,clearTimeout(o.current)},[]);S(r,"init",y),S(r,"authorize",y),S(r,"login",y),S(r,"ready",()=>{y(),P(m=>m+1)});const E=e.useRef();return S(r,"heartbeat",()=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{if(w.current){const m=new URL(u);w.current.src=`${m.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`}},6e3)}),e.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]),!b&&!x?null:e.createElement(D,{$isReady:M,ref:w,src:h,...T})};A.propTypes={id:C.string,src:C.string.isRequired,path:C.string,onInit:C.func,onTimeout:C.func,skipManifestCheck:C.bool};exports.MMEmbeddableZone=A;exports.MMEmbeddableZoneContext=q;exports.MMEmbeddableZoneProvider=W;exports.getAppInfo=j;exports.testIsEmbeddable=v;exports.useEmbeddedEffect=S;
@@ -1,256 +1,254 @@
1
- import U, { createContext as _, useState as T, useRef as E, useCallback as R, useEffect as p, useMemo as z, useContext as H } from "react";
2
- import h from "prop-types";
3
- import v from "styled-components";
4
- const q = _(null), G = ({ children: r }) => {
5
- const [o, d] = T({}), [u, l] = T({}), i = E({}), g = E({}), f = E({}), x = R((e, t) => {
1
+ import A, { createContext as B, useState as U, useRef as R, useCallback as $, useEffect as g, useMemo as D, useContext as H } from "react";
2
+ import T from "prop-types";
3
+ import j from "styled-components";
4
+ const W = B(null), K = ({ children: e }) => {
5
+ const [s, a] = U({}), [c, y] = U({}), i = R({}), l = R({}), f = R({}), x = $((r, t) => {
6
6
  var n;
7
- return !!((n = f.current[e]) != null && n.has(t));
8
- }, []), b = R((e, t, n) => {
9
- d((s) => ({ ...s, [e]: { origin: t, frameRef: n } }));
10
- }, []), $ = R((e) => {
11
- d((t) => {
7
+ return !!((n = f.current[r]) != null && n.has(t));
8
+ }, []), p = $((r, t, n) => {
9
+ a((o) => ({ ...o, [r]: { origin: t, frameRef: n } }));
10
+ }, []), I = $((r) => {
11
+ a((t) => {
12
12
  const n = { ...t };
13
- return delete n[e], n;
14
- }), l((t) => {
13
+ return delete n[r], n;
14
+ }), y((t) => {
15
15
  const n = { ...t };
16
- return delete n[e], n;
17
- }), delete f.current[e];
16
+ return delete n[r], n;
17
+ }), delete f.current[r];
18
18
  }, []);
19
- p(() => {
20
- const e = (n = [], s) => {
21
- n.forEach((a) => a(s));
19
+ g(() => {
20
+ const r = (n = [], o) => {
21
+ n.forEach((u) => u(o));
22
22
  }, t = (n) => {
23
- var M, P, L, A, O;
24
- if (!((M = n == null ? void 0 : n.data) != null && M.instanceId))
23
+ var F, M, w, m, C;
24
+ if (!((F = n == null ? void 0 : n.data) != null && F.instanceId))
25
25
  return;
26
- const { instanceId: s, type: a } = n.data, c = i.current;
27
- if (a === "response") {
28
- const { callbackId: I, response: B, error: D } = n.data, j = g.current[I];
29
- j && (j(B, D), delete g.current[I]);
26
+ const { instanceId: o, type: u } = n.data, d = i.current;
27
+ if (u === "response") {
28
+ const { callbackId: S, response: v, error: z } = n.data, _ = l.current[S];
29
+ _ && (_(v, z), delete l.current[S]);
30
30
  return;
31
31
  }
32
- if (a === "mark-registered") {
33
- const { requestType: I } = n.data;
34
- f.current[s] || (f.current[s] = /* @__PURE__ */ new Set()), f.current[s].add(I);
32
+ if (u === "mark-registered") {
33
+ const { requestType: S } = n.data;
34
+ f.current[o] || (f.current[o] = /* @__PURE__ */ new Set()), f.current[o].add(S);
35
35
  return;
36
36
  }
37
- a === "ready" && l((I) => ({ ...I, [s]: !0 })), e((P = c[s]) == null ? void 0 : P[a], n.data), e((L = c["*"]) == null ? void 0 : L[a], n.data), e((A = c[s]) == null ? void 0 : A["*"], n.data), e((O = c["*"]) == null ? void 0 : O["*"], n.data);
37
+ u === "ready" && y((S) => ({ ...S, [o]: !0 })), r((M = d[o]) == null ? void 0 : M[u], n.data), r((w = d["*"]) == null ? void 0 : w[u], n.data), r((m = d[o]) == null ? void 0 : m["*"], n.data), r((C = d["*"]) == null ? void 0 : C["*"], n.data);
38
38
  };
39
39
  return window.addEventListener("message", t), () => {
40
40
  window.removeEventListener("message", t);
41
41
  };
42
- }, [o]);
43
- const m = R(
44
- (e, t, n) => {
45
- var a, c;
46
- const s = o[e];
47
- if (!s) {
48
- console.warn(`Origin not set for id: ${e}. Unable to send message.`);
42
+ }, [s]);
43
+ const b = $(
44
+ (r, t, n) => {
45
+ var u, d;
46
+ const o = s[r];
47
+ if (!o) {
48
+ console.warn(`Origin not set for id: ${r}. Unable to send message.`);
49
49
  return;
50
50
  }
51
- (c = (a = s == null ? void 0 : s.frameRef) == null ? void 0 : a.current) != null && c.contentWindow && s.frameRef.current.contentWindow.postMessage(
52
- { type: t, ...n, instanceId: e },
53
- s.origin
51
+ (d = (u = o == null ? void 0 : o.frameRef) == null ? void 0 : u.current) != null && d.contentWindow && o.frameRef.current.contentWindow.postMessage(
52
+ { type: t, ...n, instanceId: r },
53
+ o.origin
54
54
  );
55
55
  },
56
- [o]
57
- ), w = E(0), Z = R(() => `${Date.now()}-${++w.current}`, []), F = R(
58
- async (e, t, n = {}) => new Promise((s, a) => {
59
- const c = Z(), M = (P, L) => {
60
- delete g.current[c], L ? a(L) : s(P);
56
+ [s]
57
+ ), E = R(0), O = $(() => `${Date.now()}-${++E.current}`, []), L = $(
58
+ async (r, t, n = {}) => new Promise((o, u) => {
59
+ const d = O(), F = (M, w) => {
60
+ delete l.current[d], w ? u(w) : o(M);
61
61
  };
62
- g.current[c] = M, m(e, "request", { callbackId: c, requestType: t, data: n });
62
+ l.current[d] = F, b(r, "request", { callbackId: d, requestType: t, data: n });
63
63
  }),
64
- [m]
65
- ), C = R(
66
- (e, t) => {
67
- m(e, "load-options", t);
64
+ [b]
65
+ ), Z = $(
66
+ (r, t) => {
67
+ b(r, "load-options", t);
68
68
  },
69
- [m]
70
- ), y = R(
71
- (e, t) => {
72
- m(e, "validate", t);
69
+ [b]
70
+ ), h = $(
71
+ (r, t) => {
72
+ b(r, "validate", t);
73
73
  },
74
- [m]
75
- ), k = z(
74
+ [b]
75
+ ), k = D(
76
76
  () => ({
77
- registerFrame: b,
78
- unregisterFrame: $,
79
- sendMessage: m,
80
- sendRequest: F,
81
- loadOptions: C,
82
- validate: y,
77
+ registerFrame: p,
78
+ unregisterFrame: I,
79
+ sendMessage: b,
80
+ sendRequest: L,
81
+ loadOptions: Z,
82
+ validate: h,
83
83
  hasHandler: x,
84
- readyFrames: u,
85
- addListener: (e, t, n) => (i.current[e] || (i.current[e] = {}), i.current[e][t] || (i.current[e][t] = []), i.current[e][t].push(n), () => {
86
- i.current[e][t] = i.current[e][t].filter((s) => s !== n);
84
+ readyFrames: c,
85
+ addListener: (r, t, n) => (i.current[r] || (i.current[r] = {}), i.current[r][t] || (i.current[r][t] = []), i.current[r][t].push(n), () => {
86
+ i.current[r][t] = i.current[r][t].filter((o) => o !== n);
87
87
  })
88
88
  }),
89
89
  [
90
+ p,
91
+ I,
90
92
  b,
91
- $,
92
- m,
93
- F,
94
- C,
95
- y,
93
+ L,
94
+ Z,
95
+ h,
96
96
  x,
97
- u
97
+ c
98
98
  ]
99
99
  );
100
- return /* @__PURE__ */ U.createElement(q.Provider, { value: k }, r);
101
- }, S = {}, J = async (r) => {
100
+ return /* @__PURE__ */ A.createElement(W.Provider, { value: k }, e);
101
+ }, q = {}, G = async (e) => {
102
102
  try {
103
- const o = new URL(r).origin;
104
- if (S[o] !== void 0)
105
- return S[o];
106
- const u = await (await fetch(`${o}/mm-app-manifest.json`)).json();
107
- if (!u.version)
103
+ const s = new URL(e).origin;
104
+ if (q[s] !== void 0)
105
+ return q[s];
106
+ const c = await (await fetch(`${s}/mm-app-manifest.json`)).json();
107
+ if (!c.version)
108
108
  throw new Error("Invalid manifest");
109
- return S[o] = u, u;
109
+ return q[s] = c, c;
110
110
  } catch {
111
111
  }
112
- return S[origin] = !1, !1;
113
- }, K = async (r) => !!await J(r), W = (r, o, d) => {
114
- const u = H(q);
115
- if (u === null)
112
+ return q[origin] = !1, !1;
113
+ }, J = async (e) => !!await G(e), P = (e, s, a) => {
114
+ const c = H(W);
115
+ if (c === null)
116
116
  throw new Error(
117
117
  "useEmbeddedEffect must be used within a MMEmbeddableZoneProvider"
118
118
  );
119
- const l = E(d);
120
- p(() => {
121
- l.current = d;
122
- }, [d]), p(() => {
123
- if (!(!r || !o)) {
124
- if (o.startsWith("key:")) {
125
- const i = o.substring(4);
126
- return u.readyFrames[r] && u.sendMessage(r, "subscribe-key", { keyChord: i }), u.addListener(
127
- r,
119
+ const y = R(a);
120
+ g(() => {
121
+ y.current = a;
122
+ }, [a]), g(() => {
123
+ if (!(!e || !s)) {
124
+ if (s.startsWith("key:")) {
125
+ const i = s.substring(4);
126
+ return c.readyFrames[e] && c.sendMessage(e, "subscribe-key", { keyChord: i }), c.addListener(
127
+ e,
128
128
  `key-pressed:${i}`,
129
- (...f) => l.current(...f)
129
+ (...f) => y.current(...f)
130
130
  );
131
131
  }
132
- return u.addListener(
133
- r,
134
- o,
135
- (...i) => l.current(...i)
132
+ return c.addListener(
133
+ e,
134
+ s,
135
+ (...i) => y.current(...i)
136
136
  );
137
137
  }
138
- }, [u, r, o]);
138
+ }, [c, e, s]);
139
139
  };
140
- G.propTypes = {
141
- children: h.node.isRequired
140
+ K.propTypes = {
141
+ children: T.node.isRequired
142
142
  };
143
- const Q = v.default || v, V = Q.iframe`
143
+ const Q = j.default || j, V = 1e4, X = Q.iframe`
144
144
  width: 100%;
145
145
  height: 100%;
146
146
  border: none;
147
- visibility: ${(r) => r.$isReady ? "visible" : "hidden"};
148
- `, X = ({
149
- id: r,
150
- src: o,
151
- path: d,
152
- onInit: u = () => {
147
+ visibility: ${(e) => e.$isReady ? "visible" : "hidden"};
148
+ `, Y = ({
149
+ id: e,
150
+ src: s,
151
+ path: a,
152
+ onInit: c = () => {
153
153
  },
154
- context: l = {},
155
- params: i = {},
156
- skipManifestCheck: g = !1,
157
- readyTimeout: f = 5e3,
154
+ onTimeout: y,
155
+ context: i = {},
156
+ params: l = {},
157
+ skipManifestCheck: f = !1,
158
158
  ...x
159
159
  }) => {
160
160
  if ("isConfiguring" in x)
161
161
  return console.error(
162
162
  "isConfiguring must be passed via the params prop to MMEmbeddableZone"
163
163
  ), null;
164
- if ("colorMode" in l)
164
+ if ("colorMode" in i)
165
165
  return console.error(
166
166
  "colorMode must be passed via the params prop to MMEmbeddableZone"
167
167
  ), null;
168
- if ("isFullScreen" in l)
168
+ if ("isFullScreen" in i)
169
169
  return console.error(
170
170
  "isFullScreen must be passed via the params prop to MMEmbeddableZone"
171
171
  ), null;
172
- const b = E(), [$, m] = T(), [w, Z] = T(0), { registerFrame: F, unregisterFrame: C, sendMessage: y } = H(
173
- q
174
- ), [k, e] = T(!0), [t, n] = T(), s = E();
175
- p(() => {
176
- w && y(r, "set-context", {
172
+ const p = R(), [I, b] = U(), [E, O] = U(0), { registerFrame: L, unregisterFrame: Z, sendMessage: h } = H(
173
+ W
174
+ ), [k, r] = U(!0), [t, n] = U(), o = R(), u = R(y), d = R(c), F = R(!1);
175
+ g(() => {
176
+ u.current = y;
177
+ }, [y]), g(() => {
178
+ d.current = c;
179
+ }, [c]), g(() => {
180
+ E && h(e, "set-context", {
177
181
  context: {
178
- ...l,
182
+ ...i,
179
183
  // TODO: Remove this once everything is migrated to params
180
- colorMode: i.colorMode,
181
- isFullScreen: i.isFullScreen
184
+ colorMode: l.colorMode,
185
+ isFullScreen: l.isFullScreen
182
186
  }
183
187
  });
184
- }, [l, i.colorMode, i.isFullScreen, r, w]), p(() => {
185
- w && (y(r, "set-params", { params: i }), y(r, "set-configuring", { isConfiguring: i.isConfiguring }));
186
- }, [i, r, w]), p(() => {
187
- d !== void 0 && n((d == null ? void 0 : d.indexOf("/")) === 0 ? d : `/${d}`);
188
- }, [d]), p(() => {
189
- t === void 0 || !w || y(r, "navigate", { path: t });
190
- }, [t, w, r, y]), p(() => {
191
- if (!(!o || !r || !b)) {
192
- if (g) {
193
- const c = new URL(o);
194
- F(r, c.origin, b), u(), m(
195
- `${c.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`
188
+ }, [i, l.colorMode, l.isFullScreen, e, E]), g(() => {
189
+ E && (h(e, "set-params", { params: l }), h(e, "set-configuring", { isConfiguring: l.isConfiguring }));
190
+ }, [l, e, E]), g(() => {
191
+ a !== void 0 && n((a == null ? void 0 : a.indexOf("/")) === 0 ? a : `/${a}`);
192
+ }, [a]), g(() => {
193
+ t === void 0 || !E || h(e, "navigate", { path: t });
194
+ }, [t, E, e, h]), g(() => {
195
+ if (!(!s || !e || !p)) {
196
+ if (f) {
197
+ const m = new URL(s);
198
+ r(!0), L(e, m.origin, p), d.current(), b(
199
+ `${m.origin}/mm-embedded-interop?id=${e}&origin=${window.location.origin}`
196
200
  );
197
201
  } else
198
202
  (async () => {
199
- const c = await K(o);
200
- if (e(c), c) {
201
- const M = new URL(o);
202
- F(r, M.origin, b), u(), m(
203
- `${M.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`
203
+ const m = await J(s);
204
+ if (r(m), m) {
205
+ const C = new URL(s);
206
+ L(e, C.origin, p), d.current(), b(
207
+ `${C.origin}/mm-embedded-interop?id=${e}&origin=${window.location.origin}`
204
208
  );
205
209
  }
206
210
  })();
207
211
  return () => {
208
- C(r);
212
+ Z(e);
209
213
  };
210
214
  }
211
- }, [o, r, F, b, g]), p(() => {
212
- if (!(!g || !$ || f == null))
213
- return s.current = setTimeout(() => e(!1), f), () => clearTimeout(s.current);
214
- }, [$, g, f]), W(r, "ready", () => {
215
- clearTimeout(s.current), Z((c) => c + 1);
215
+ }, [s, e, L, p, f]), g(() => {
216
+ if (!(!f || !I || F.current))
217
+ return o.current = setTimeout(() => {
218
+ u.current && u.current();
219
+ }, V), () => clearTimeout(o.current);
220
+ }, [I, f]);
221
+ const M = $(() => {
222
+ F.current = !0, clearTimeout(o.current);
223
+ }, []);
224
+ P(e, "init", M), P(e, "authorize", M), P(e, "login", M), P(e, "ready", () => {
225
+ M(), O((m) => m + 1);
216
226
  });
217
- const a = E();
218
- return W(r, "heartbeat", () => {
219
- a.current && clearTimeout(a.current), a.current = setTimeout(() => {
220
- if (b.current) {
221
- const c = new URL(o);
222
- b.current.src = `${c.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`;
227
+ const w = R();
228
+ return P(e, "heartbeat", () => {
229
+ w.current && clearTimeout(w.current), w.current = setTimeout(() => {
230
+ if (p.current) {
231
+ const m = new URL(s);
232
+ p.current.src = `${m.origin}/mm-embedded-interop?id=${e}&origin=${window.location.origin}`;
223
233
  }
224
234
  }, 6e3);
225
- }), p(() => () => {
226
- a.current && clearTimeout(a.current);
227
- }, []), k ? /* @__PURE__ */ U.createElement(V, { $isReady: w, ref: b, src: $, ...x }) : /* @__PURE__ */ U.createElement(
228
- "div",
229
- {
230
- style: {
231
- height: "100%",
232
- display: "flex",
233
- flex: 1,
234
- alignItems: "center",
235
- justifyContent: "center"
236
- }
237
- },
238
- /* @__PURE__ */ U.createElement("div", { style: { textAlign: "center" } }, "Application must support the MM App Framework to be embedded.")
239
- );
235
+ }), g(() => () => {
236
+ w.current && clearTimeout(w.current);
237
+ }, []), !f && !k ? null : /* @__PURE__ */ A.createElement(X, { $isReady: E, ref: p, src: I, ...x });
240
238
  };
241
- X.propTypes = {
242
- id: h.string,
243
- src: h.string.isRequired,
244
- path: h.string,
245
- onInit: h.func,
246
- skipManifestCheck: h.bool,
247
- readyTimeout: h.number
239
+ Y.propTypes = {
240
+ id: T.string,
241
+ src: T.string.isRequired,
242
+ path: T.string,
243
+ onInit: T.func,
244
+ onTimeout: T.func,
245
+ skipManifestCheck: T.bool
248
246
  };
249
247
  export {
250
- X as MMEmbeddableZone,
251
- q as MMEmbeddableZoneContext,
252
- G as MMEmbeddableZoneProvider,
253
- J as getAppInfo,
254
- K as testIsEmbeddable,
255
- W as useEmbeddedEffect
248
+ Y as MMEmbeddableZone,
249
+ W as MMEmbeddableZoneContext,
250
+ K as MMEmbeddableZoneProvider,
251
+ G as getAppInfo,
252
+ J as testIsEmbeddable,
253
+ P as useEmbeddedEffect
256
254
  };
@@ -1,6 +1,6 @@
1
- (function(f,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("react"),require("prop-types"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","styled-components"],e):(f=typeof globalThis!="undefined"?globalThis:f||self,e(f["mm-react-embeddable"]={},f.React,f.PropTypes,f.styled))})(this,(function(f,e,p,j){"use strict";const k=e.createContext(null),v=({children:n})=>{const[i,a]=e.useState({}),[l,m]=e.useState({}),u=e.useRef({}),E=e.useRef({}),b=e.useRef({}),I=e.useCallback((r,s)=>{var t;return!!((t=b.current[r])!=null&&t.has(s))},[]),y=e.useCallback((r,s,t)=>{a(o=>({...o,[r]:{origin:s,frameRef:t}}))},[]),C=e.useCallback(r=>{a(s=>{const t={...s};return delete t[r],t}),m(s=>{const t={...s};return delete t[r],t}),delete b.current[r]},[]);e.useEffect(()=>{const r=(t=[],o)=>{t.forEach(c=>c(o))},s=t=>{var h,q,S,W,H;if(!((h=t==null?void 0:t.data)!=null&&h.instanceId))return;const{instanceId:o,type:c}=t.data,d=u.current;if(c==="response"){const{callbackId:F,response:z,error:G}=t.data,B=E.current[F];B&&(B(z,G),delete E.current[F]);return}if(c==="mark-registered"){const{requestType:F}=t.data;b.current[o]||(b.current[o]=new Set),b.current[o].add(F);return}c==="ready"&&m(F=>({...F,[o]:!0})),r((q=d[o])==null?void 0:q[c],t.data),r((S=d["*"])==null?void 0:S[c],t.data),r((W=d[o])==null?void 0:W["*"],t.data),r((H=d["*"])==null?void 0:H["*"],t.data)};return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},[i]);const g=e.useCallback((r,s,t)=>{var c,d;const o=i[r];if(!o){console.warn(`Origin not set for id: ${r}. Unable to send message.`);return}(d=(c=o==null?void 0:o.frameRef)==null?void 0:c.current)!=null&&d.contentWindow&&o.frameRef.current.contentWindow.postMessage({type:s,...t,instanceId:r},o.origin)},[i]),w=e.useRef(0),T=e.useCallback(()=>`${Date.now()}-${++w.current}`,[]),$=e.useCallback(async(r,s,t={})=>new Promise((o,c)=>{const d=T(),h=(q,S)=>{delete E.current[d],S?c(S):o(q)};E.current[d]=h,g(r,"request",{callbackId:d,requestType:s,data:t})}),[g]),Z=e.useCallback((r,s)=>{g(r,"load-options",s)},[g]),M=e.useCallback((r,s)=>{g(r,"validate",s)},[g]),U=e.useMemo(()=>({registerFrame:y,unregisterFrame:C,sendMessage:g,sendRequest:$,loadOptions:Z,validate:M,hasHandler:I,readyFrames:l,addListener:(r,s,t)=>(u.current[r]||(u.current[r]={}),u.current[r][s]||(u.current[r][s]=[]),u.current[r][s].push(t),()=>{u.current[r][s]=u.current[r][s].filter(o=>o!==t)})}),[y,C,g,$,Z,M,I,l]);return e.createElement(k.Provider,{value:U},n)},L={},A=async n=>{try{const i=new URL(n).origin;if(L[i]!==void 0)return L[i];const l=await(await fetch(`${i}/mm-app-manifest.json`)).json();if(!l.version)throw new Error("Invalid manifest");return L[i]=l,l}catch{}return L[origin]=!1,!1},O=async n=>!!await A(n),x=(n,i,a)=>{const l=e.useContext(k);if(l===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const m=e.useRef(a);e.useEffect(()=>{m.current=a},[a]),e.useEffect(()=>{if(!(!n||!i)){if(i.startsWith("key:")){const u=i.substring(4);return l.readyFrames[n]&&l.sendMessage(n,"subscribe-key",{keyChord:u}),l.addListener(n,`key-pressed:${u}`,(...b)=>m.current(...b))}return l.addListener(n,i,(...u)=>m.current(...u))}},[l,n,i])};v.propTypes={children:p.node.isRequired};const D=(j.default||j).iframe`
1
+ (function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("react"),require("prop-types"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","styled-components"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a["mm-react-embeddable"]={},a.React,a.PropTypes,a.styled))})(this,(function(a,e,C,W){"use strict";const q=e.createContext(null),v=({children:r})=>{const[u,f]=e.useState({}),[c,M]=e.useState({}),i=e.useRef({}),m=e.useRef({}),b=e.useRef({}),L=e.useCallback((n,s)=>{var t;return!!((t=b.current[n])!=null&&t.has(s))},[]),y=e.useCallback((n,s,t)=>{f(o=>({...o,[n]:{origin:s,frameRef:t}}))},[]),S=e.useCallback(n=>{f(s=>{const t={...s};return delete t[n],t}),M(s=>{const t={...s};return delete t[n],t}),delete b.current[n]},[]);e.useEffect(()=>{const n=(t=[],o)=>{t.forEach(d=>d(o))},s=t=>{var F,h,w,g,Z;if(!((F=t==null?void 0:t.data)!=null&&F.instanceId))return;const{instanceId:o,type:d}=t.data,l=i.current;if(d==="response"){const{callbackId:T,response:_,error:G}=t.data,z=m.current[T];z&&(z(_,G),delete m.current[T]);return}if(d==="mark-registered"){const{requestType:T}=t.data;b.current[o]||(b.current[o]=new Set),b.current[o].add(T);return}d==="ready"&&M(T=>({...T,[o]:!0})),n((h=l[o])==null?void 0:h[d],t.data),n((w=l["*"])==null?void 0:w[d],t.data),n((g=l[o])==null?void 0:g["*"],t.data),n((Z=l["*"])==null?void 0:Z["*"],t.data)};return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},[u]);const E=e.useCallback((n,s,t)=>{var d,l;const o=u[n];if(!o){console.warn(`Origin not set for id: ${n}. Unable to send message.`);return}(l=(d=o==null?void 0:o.frameRef)==null?void 0:d.current)!=null&&l.contentWindow&&o.frameRef.current.contentWindow.postMessage({type:s,...t,instanceId:n},o.origin)},[u]),p=e.useRef(0),x=e.useCallback(()=>`${Date.now()}-${++p.current}`,[]),k=e.useCallback(async(n,s,t={})=>new Promise((o,d)=>{const l=x(),F=(h,w)=>{delete m.current[l],w?d(w):o(h)};m.current[l]=F,E(n,"request",{callbackId:l,requestType:s,data:t})}),[E]),O=e.useCallback((n,s)=>{E(n,"load-options",s)},[E]),$=e.useCallback((n,s)=>{E(n,"validate",s)},[E]),j=e.useMemo(()=>({registerFrame:y,unregisterFrame:S,sendMessage:E,sendRequest:k,loadOptions:O,validate:$,hasHandler:L,readyFrames:c,addListener:(n,s,t)=>(i.current[n]||(i.current[n]={}),i.current[n][s]||(i.current[n][s]=[]),i.current[n][s].push(t),()=>{i.current[n][s]=i.current[n][s].filter(o=>o!==t)})}),[y,S,E,k,O,$,L,c]);return e.createElement(q.Provider,{value:j},r)},U={},A=async r=>{try{const u=new URL(r).origin;if(U[u]!==void 0)return U[u];const c=await(await fetch(`${u}/mm-app-manifest.json`)).json();if(!c.version)throw new Error("Invalid manifest");return U[u]=c,c}catch{}return U[origin]=!1,!1},P=async r=>!!await A(r),I=(r,u,f)=>{const c=e.useContext(q);if(c===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const M=e.useRef(f);e.useEffect(()=>{M.current=f},[f]),e.useEffect(()=>{if(!(!r||!u)){if(u.startsWith("key:")){const i=u.substring(4);return c.readyFrames[r]&&c.sendMessage(r,"subscribe-key",{keyChord:i}),c.addListener(r,`key-pressed:${i}`,(...b)=>M.current(...b))}return c.addListener(r,u,(...i)=>M.current(...i))}},[c,r,u])};v.propTypes={children:C.node.isRequired};const B=W.default||W,D=1e4,K=B.iframe`
2
2
  width: 100%;
3
3
  height: 100%;
4
4
  border: none;
5
- visibility: ${n=>n.$isReady?"visible":"hidden"};
6
- `,P=({id:n,src:i,path:a,onInit:l=()=>{},context:m={},params:u={},skipManifestCheck:E=!1,readyTimeout:b=5e3,...I})=>{if("isConfiguring"in I)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in m)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in m)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const y=e.useRef(),[C,g]=e.useState(),[w,T]=e.useState(0),{registerFrame:$,unregisterFrame:Z,sendMessage:M}=e.useContext(k),[U,r]=e.useState(!0),[s,t]=e.useState(),o=e.useRef();e.useEffect(()=>{w&&M(n,"set-context",{context:{...m,colorMode:u.colorMode,isFullScreen:u.isFullScreen}})},[m,u.colorMode,u.isFullScreen,n,w]),e.useEffect(()=>{w&&(M(n,"set-params",{params:u}),M(n,"set-configuring",{isConfiguring:u.isConfiguring}))},[u,n,w]),e.useEffect(()=>{a!==void 0&&t((a==null?void 0:a.indexOf("/"))===0?a:`/${a}`)},[a]),e.useEffect(()=>{s===void 0||!w||M(n,"navigate",{path:s})},[s,w,n,M]),e.useEffect(()=>{if(!(!i||!n||!y)){if(E){const d=new URL(i);$(n,d.origin,y),l(),g(`${d.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`)}else(async()=>{const d=await O(i);if(r(d),d){const h=new URL(i);$(n,h.origin,y),l(),g(`${h.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`)}})();return()=>{Z(n)}}},[i,n,$,y,E]),e.useEffect(()=>{if(!(!E||!C||b==null))return o.current=setTimeout(()=>r(!1),b),()=>clearTimeout(o.current)},[C,E,b]),x(n,"ready",()=>{clearTimeout(o.current),T(d=>d+1)});const c=e.useRef();return x(n,"heartbeat",()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{if(y.current){const d=new URL(i);y.current.src=`${d.origin}/mm-embedded-interop?id=${n}&origin=${window.location.origin}`}},6e3)}),e.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),U?e.createElement(D,{$isReady:w,ref:y,src:C,...I}):e.createElement("div",{style:{height:"100%",display:"flex",flex:1,alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{textAlign:"center"}},"Application must support the MM App Framework to be embedded."))};P.propTypes={id:p.string,src:p.string.isRequired,path:p.string,onInit:p.func,skipManifestCheck:p.bool,readyTimeout:p.number},f.MMEmbeddableZone=P,f.MMEmbeddableZoneContext=k,f.MMEmbeddableZoneProvider=v,f.getAppInfo=A,f.testIsEmbeddable=O,f.useEmbeddedEffect=x,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
5
+ visibility: ${r=>r.$isReady?"visible":"hidden"};
6
+ `,H=({id:r,src:u,path:f,onInit:c=()=>{},onTimeout:M,context:i={},params:m={},skipManifestCheck:b=!1,...L})=>{if("isConfiguring"in L)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in i)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in i)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const y=e.useRef(),[S,E]=e.useState(),[p,x]=e.useState(0),{registerFrame:k,unregisterFrame:O,sendMessage:$}=e.useContext(q),[j,n]=e.useState(!0),[s,t]=e.useState(),o=e.useRef(),d=e.useRef(M),l=e.useRef(c),F=e.useRef(!1);e.useEffect(()=>{d.current=M},[M]),e.useEffect(()=>{l.current=c},[c]),e.useEffect(()=>{p&&$(r,"set-context",{context:{...i,colorMode:m.colorMode,isFullScreen:m.isFullScreen}})},[i,m.colorMode,m.isFullScreen,r,p]),e.useEffect(()=>{p&&($(r,"set-params",{params:m}),$(r,"set-configuring",{isConfiguring:m.isConfiguring}))},[m,r,p]),e.useEffect(()=>{f!==void 0&&t((f==null?void 0:f.indexOf("/"))===0?f:`/${f}`)},[f]),e.useEffect(()=>{s===void 0||!p||$(r,"navigate",{path:s})},[s,p,r,$]),e.useEffect(()=>{if(!(!u||!r||!y)){if(b){const g=new URL(u);n(!0),k(r,g.origin,y),l.current(),E(`${g.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`)}else(async()=>{const g=await P(u);if(n(g),g){const Z=new URL(u);k(r,Z.origin,y),l.current(),E(`${Z.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`)}})();return()=>{O(r)}}},[u,r,k,y,b]),e.useEffect(()=>{if(!(!b||!S||F.current))return o.current=setTimeout(()=>{d.current&&d.current()},D),()=>clearTimeout(o.current)},[S,b]);const h=e.useCallback(()=>{F.current=!0,clearTimeout(o.current)},[]);I(r,"init",h),I(r,"authorize",h),I(r,"login",h),I(r,"ready",()=>{h(),x(g=>g+1)});const w=e.useRef();return I(r,"heartbeat",()=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{if(y.current){const g=new URL(u);y.current.src=`${g.origin}/mm-embedded-interop?id=${r}&origin=${window.location.origin}`}},6e3)}),e.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),!b&&!j?null:e.createElement(K,{$isReady:p,ref:y,src:S,...L})};H.propTypes={id:C.string,src:C.string.isRequired,path:C.string,onInit:C.func,onTimeout:C.func,skipManifestCheck:C.bool},a.MMEmbeddableZone=H,a.MMEmbeddableZoneContext=q,a.MMEmbeddableZoneProvider=v,a.getAppInfo=A,a.testIsEmbeddable=P,a.useEmbeddedEffect=I,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-embeddable",
3
- "version": "1.3.0-1",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "module": "dist/mm-react-embeddable.es.js",
6
6
  "main": "dist/mm-react-embeddable.cjs.js",