@googleworkspace/meet-addons 1.2.0-dev-883351576 → 1.2.0-dev-885237547
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.
- package/meet.addons.mjs +3 -3
- package/package.json +1 -1
package/meet.addons.mjs
CHANGED
|
@@ -24,7 +24,7 @@ function Qb(a,b,c,d){let e=!1;d=Nb(a,d,void 0,f=>{const g=wb(f,c,b);e=g!==f&&g!=
|
|
|
24
24
|
function B(a,b,c,d){d=Wb(d);a:{var e=d;Kb(a);const h=a.l;var f=h[l]|0;if(e==null){var g=Ub(h);if(Tb(g,h,f,c)===b)g.set(c,0);else break a}else{g=h;const k=Ub(g),n=Tb(k,g,f,c);n!==b&&(n&&(f=w(g,f,n)),k.set(c,b))}w(h,f,b,e)}d&&!m(d)&&Lb(a.l);return a}
|
|
25
25
|
function Yb(a,b){Kb(a);const c=a.l;let d=c[l]|0;if(b==null)return w(c,d,1),a;let e=b===Ha?7:b[l]|0,f=e;const g=Rb(e),h=g||Object.isFrozen(b);let k=!0,n=!0;for(let z=0;z<b.length;z++){var r=b[z];g||(r=m(r),k&&(k=!r),n&&(n=r))}g||(e=k?13:5,e=n?e&-4097:e|4096);h&&e===f||(b=[...b],f=0,e=Zb(e,d));e!==f&&(b[l]=e);d=w(c,d,1,b);2&e||!(4096&e||16&e)||Lb(c,d);return a}function Zb(a,b){return a=(2&b?a|2:a&-3)&-273}
|
|
26
26
|
function $b(a){a=v(a,1);a=a==null||typeof a==="boolean"?a:typeof a==="number"?!!a:void 0;return a!=null?a:!1}function ac(a){a=v(a,1,void 0,vb);return a!=null?a:Mb}function C(a,b){a=v(a,b);a=a==null||typeof a==="string"?a:void 0;return a!=null?a:""}function D(a,b){a=v(a,b);a=a==null?a:gb(a)?a|0:void 0;return a!=null?a:0}function E(a,b,c,d){c=x(a,d)===c?c:-1;return Vb(a,b,c)}function bc(a,b){return y(a,1,b==null?b:mb(b),"0")}
|
|
27
|
-
function F(a,b,c){if(c!=null){if(!gb(c))throw Ba("enum");c|=0}return y(a,b,c,0)};function cc(){var a=dc||(dc=ec("[1,2,0]"));a=Ib(a);a=Ob(a,4,u("dev-
|
|
27
|
+
function F(a,b,c){if(c!=null){if(!gb(c))throw Ba("enum");c|=0}return y(a,b,c,0)};function cc(){var a=dc||(dc=ec("[1,2,0]"));a=Ib(a);a=Ob(a,4,u("dev-885237547"));const b=a.l,c=b[l]|0;return m(a,c)?a:Gb(a,b,c)?Hb(a,b):new a.constructor(Fb(b,c,!0))}var G=class{constructor(a){this.l=Cb(a,void 0,void 0,2048)}toJSON(){return Bb(this)}};G.prototype[Ga]=Ja;G.prototype.toString=function(){return this.l.toString()};function fc(a){return b=>{if(b==null||b=="")b=new a;else{b=JSON.parse(b);if(!Array.isArray(b))throw Error("dnarr");b[l]|=32;b=new a(b)}return b}};var ec=function(a){return b=>{b=JSON.parse(b);if(!Array.isArray(b)){var c=typeof b;throw Error("Expected jspb data to be an array, got "+(c!="object"?c:b?Array.isArray(b)?"array":c:"null")+": "+b);}b[l]|=34;return new a(b)}}(class extends G{});var hc=class extends G{};function ic(a){var b=new jc(500);let c=0,d;return(...e)=>{kc(b)?a(...e):(d=()=>void a(...e),c||(c=setTimeout(()=>{c=0;let f;(f=d)==null||f()},lc(b))))}}function mc(a){var b=new jc(100),c=Promise.resolve();return(...d)=>kc(b)?a(...d):c};function kc(a){return nc(a,a.index)>=a.g?(a.h[a.index]=Date.now(),a.index=(a.index+1)%1,!0):!1}function lc(a){const b=a.g;a=nc(a,a.index);return a>=b?0:b-a}function nc(a,b){let c;return Date.now()-((c=a.h[b])!=null?c:-1*a.g)}var jc=class{constructor(a){this.g=a;this.h=[];this.index=0}};var oc=class extends G{},pc=[2,3];var qc=class extends G{};var J=class extends Error{constructor({errorType:a,message:b,i:c}){super(`Meet add-on SDK error: ${`${b}${c?` - ${c}`:""}`}`);this.errorType=a}},K={errorType:"InternalError",message:"An unexpected error has occurred.",i:"No further information is available."},rc={errorType:"MissingUrlParameter",message:"Missing required Meet SDK URL parameter",i:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not strip URL parameters (e.g. as part of a redirect)."},
|
|
28
28
|
sc={errorType:"NeedsMainStageContext",message:"This method can only be invoked if the addon is running in the main stage.",i:"Use getFrameType to check whether the addon is running in the main stage before invoking this method."},tc={errorType:"NeedsSidePanelContext",message:"This method can only be invoked if the addon is running in the side panel.",i:"Use getFrameType to check whether the addon is running in the side panel before invoking this method."},uc={errorType:"NotSupportedInStandalone",
|
|
29
29
|
message:"This method is not supported in standalone mode.",i:"Do not call this method in standalone mode."},vc={errorType:"MustBeIframed",message:"The SDK must be run in an iframe as part of a Google Meet add-on.",i:"See https://developers.google.com/meet/add-ons/guides/deploy-add-on to deploy to Meet."},wc={errorType:"InternalError",message:"The frame type URL parameter is set to an unexpected value.",i:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not modify URL parameters (e.g. as part of a redirect)."},
|
|
30
30
|
xc={errorType:"InvalidCloudProjectNumber",message:"Cloud Project Number provided by meet does not match the one passed in by the SDK. Ensure that the correct Cloud Project Number is passed to the SDK as a string.",i:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not modify URL parameters (e.g. as part of a redirect) and ensure that the correct Cloud Project Number was passed into the SDK as a string."},yc={errorType:"DestinationNotReady",
|
|
@@ -67,8 +67,8 @@ class hf extends O{constructor(a,b,c){super();this.U=a;this.channel=b;this.h=mc(
|
|
|
67
67
|
function Jf(a){var b=new V;return y(b,1,La(a.bytes,!1),va())}function Lf(a){if(a.u()){a=a.m();var b,c=C(a,1);var d=(b=Vb(a,hc,2))==null?void 0:ac(b);b=d!=null?Ff(d):void 0;b=b!=null?b:0;let e;d=(e=v(a,4,void 0,ib))!=null?e:0;return{mediaId:c,mediaPlayoutPosition:b,mediaPlayoutRate:d,playbackState:Mf.get(D(a,3))}}}function Nf(a,b){b=Of(b);B(a,3,xf,b);return a}function Pf(a,b){b=Of(b);B(a,3,sf,b);return a}
|
|
68
68
|
const Mf=Gf().set(0,"INVALID").set(1,"BUFFERING").set(2,"PLAY").set(3,"PAUSE").set(4,"ENDED").F(),Qf=Gf().set("INVALID",0).set("BUFFERING",1).set("PLAY",2).set("PAUSE",3).set("ENDED",4).F();function Of(a){var b=new W;b=y(b,1,u(a.mediaId),"");var c=a.mediaPlayoutRate;if(c!=null&&typeof c!=="number")throw Error(`Value of float/double field must be a number, found ${typeof c}: ${c}`);b=y(b,4,c,0);c=new hc;c=bc(c,a.mediaPlayoutPosition);b=Xb(b,2,c);a=Qf.get(a.playbackState);return F(b,3,a)}
|
|
69
69
|
function Rf({activityTitle:a}){var b=new wf;return Ob(b,4,u(a))}function Sf(a,b){var c=new vf;b=F(c,1,b.B);B(a,6,zf,b);return a}function Tf(a){var b=new uf;B(a,5,zf,b);return a};const Uf=Gf().set("co-doing",1).set("co-watching",2).F();async function Vf(a,b,c){var d=b.D,e=new Bf;var f=new Af;f=y(f,1,u(a.activityTitle),"");var g=Uf.get(a.K);f=F(f,2,g);e=B(e,3,Cf,f);d=await d.call(b,e,cf);let h;if((h=$b(d))!=null&&h)return new Wf(a,b,c,Vb(d,bf,2));throw new Df;}function Xf(a,b){const c=a.config.N(b);c&&!a.config.M(a.g,c)&&(a.g=c,a.j=Ff(ac(b)),a.u(a.g))}function Y(a,b){const {state:c,ga:d,context:e}=b(a.g);a.g=c;a.notify(a.g,e,d)}
|
|
70
|
-
class Wf{constructor(a,b,c,d){this.m=a;this.h=b;this.config=c;this.u=ic(e=>void this.m.O(e));Yf(this.h,e=>{const f=x(e,ef);switch(f){case 1:Xf(this,E(e,bf,1,ef));break;case 2:case 0:console.warn(`IllegalMessage: ${f} -
|
|
71
|
-
|
|
70
|
+
class Wf{constructor(a,b,c,d){this.m=a;this.h=b;this.config=c;this.u=ic(e=>void this.m.O(e));Yf(this.h,e=>{const f=x(e,ef);switch(f){case 1:Xf(this,E(e,bf,1,ef));break;case 2:case 0:console.warn(`IllegalMessage: ${f} - Unhandled message - Please raise a bug with the MeetJS team`)}});this.A=(new Ef({ea:1E3,ia:()=>{var e,f,g=(f=(e=this.m).ka)==null?void 0:f.call(e);if(this.g!==null){this.g={...this.g,...g};e=new Bf;f=this.config;g=f.W;var h=new tf;h=bc(h,this.j);f=g.call(f,h,this.g);e=B(e,1,Cf,f);this.h.send(e)}}})).start();
|
|
71
|
+
this.g=null;this.j=0;d&&Xf(this,d)}disconnect(){this.h.shutdown();this.A.shutdown()}notify(a,b,c){var d=c?Rf(c):void 0;c=this.config;var e=c.X;var f=new yf;f=bc(f,this.j);d=Xb(f,4,d);a=e.call(c,d,a);a=this.config.V(a,b);b=this.h;c=b.send;e=new Bf;a=B(e,2,Cf,a);c.call(b,a)}};var Zf=class{constructor(a){this.g=a}broadcastStateUpdate(a){Y(this.g,()=>({state:a,context:{}}))}disconnect(){this.g.disconnect()}};function $f(a,b){return a==null||b==null?!1:a.bytes.length===b.bytes.length&&a.bytes.every((c,d)=>c===b.bytes[d])};var ag=class{constructor(a){this.g=a}notifySwitchedToMedia(a,b,c){Y(this.g,()=>({state:{mediaId:b,mediaPlayoutRate:1,mediaPlayoutPosition:c,playbackState:"PLAY"},ga:{activityTitle:a},context:{B:1}}))}notifyPauseState(a,b){Y(this.g,c=>{if(c==null)throw Error("Invalid before coWatchingState");return{state:{...c,playbackState:a?"PAUSE":"PLAY",mediaPlayoutPosition:b},context:{B:3}}})}notifySeekToTimestamp(a){Y(this.g,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a},
|
|
72
72
|
context:{B:2}}})}notifyPlayoutRate(a){Y(this.g,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutRate:a},context:{B:4}}})}notifyBuffering(a){Y(this.g,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a,playbackState:"BUFFERING"},context:{B:3}}})}notifyReady(a){Y(this.g,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a},context:{B:3}}})}disconnect(){this.g.disconnect()}};
|
|
73
73
|
function bg(a,b){if(a==null||b==null)return!1;const c=a.playbackState==="PLAY"?3*Math.max(a.mediaPlayoutRate,1):0,d=Math.abs(a.mediaPlayoutPosition-b.mediaPlayoutPosition);return a.mediaId===b.mediaId&&a.mediaPlayoutRate===b.mediaPlayoutRate&&d<=c&&a.playbackState===b.playbackState};function Yf(a,b){vd(a.signal,c=>{b(c)},a.g)}var cg=class{constructor(a,b){this.channel=a;this.signal=b;this.g=new O}send(a){this.channel.send(JSON.stringify(Bb(a)))}async D(a,b){a=await this.channel.D(JSON.stringify(Bb(a)));return b(a.data)}shutdown(){this.g.dispose()}};function dg(a,b){var c=eg;const d=a.signal(),e=a.signal();vd(b,f=>{const g=c(f)?d:e;Oe(a,g,f)},a);return{ja:d,ha:e}}function fg(a,b,c,d){const e=d!=null?d:f=>f;vd(c,f=>{Oe(a,b,e(f))},a)};async function gg(a,b){if(b)return a=await Vf({activityTitle:b.activityTitle,K:"co-watching",ka:()=>b.onCoWatchingStateQuery(),O:c=>{b.onCoWatchingStateChanged(c)}},a,{X:Nf,W:Pf,V:Sf,N:Lf,M:bg}),new ag(a)}async function hg(a,b){if(b)return a=await Vf({activityTitle:b.activityTitle,K:"co-doing",O:c=>{b.onCoDoingStateChanged(c)}},a,{X:If,W:Kf,V:Tf,N:Hf,M:$f}),new Zf(a)}
|
|
74
74
|
async function ig(a){var b=new Re,c=b.signal();a=await a;fg(b,c,a.signal,f=>f.content);const {ja:d,ha:e}=dg(b,c);b=new cg(a.channel,d);c=new cg(a.channel,e);return{aa:b,ba:c}}function eg(a){a:switch(x(a,ef)){case 1:a=E(a,bf,1,ef);break a;default:throw Error("CA Message arrived with no known content message set");}return a.h()};async function jg(a,b){({aa:a}=await ig(lf(a.g)));b=await hg(a,b);if(!b)throw Error("Failed to create co-doing session");return b}async function kg(a,b){({ba:a}=await ig(lf(a.g)));b=await gg(a,b);if(!b)throw Error("Failed to create co-watching session");return b};var lg=class extends Dd{async notifySidePanel(a){await of(this.context.g,1,a)}async unloadSidePanel(){await mf(this.context.g)}async loadSidePanel(){await nf(this.context.g)}};var mg=class extends Dd{async setAddonStartingState(a){if(a===null)throw new J(Fc("addonStartingState"));if(typeof a!=="object")throw new J(L("addonStartingState",typeof a,"object | undefined"));if(a.sidePanelUrl!==void 0&&typeof a.sidePanelUrl!=="string")throw new J(L("sidePanelUrl",typeof a.sidePanelUrl,"string | undefined"));if(a.additionalData!==void 0&&typeof a.additionalData!=="string")throw new J(L("additionalData",typeof a.additionalData,"string | undefined"));if(Object.keys(a).length!==+!!a.sidePanelUrl+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@googleworkspace/meet-addons",
|
|
3
3
|
"description": "The Google Meet add-ons SDK lets you embed your app into Google Meet as an add-on where users can discover, share, and collaborate in the app without leaving Meet",
|
|
4
|
-
"version": "1.2.0-dev-
|
|
4
|
+
"version": "1.2.0-dev-885237547",
|
|
5
5
|
"repository": "googleworkspace/meet",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"homepage": "https://developers.google.com/meet/add-ons/guides/overview",
|