From 3311b735550b8927c8b7ef2c6d06f768d9fe0476 Mon Sep 17 00:00:00 2001 From: Teddy Ward Date: Mon, 9 Sep 2024 14:29:31 -0400 Subject: [PATCH] feat: update all sample add-ons to 1.0.0 (#21) * feat: update all sample add-ons to 1.0.0 * fix: update startActivity to startCollaboration * fix: remove branch deployment --- .../samples/animation-next-js/package.json | 2 +- .../samples/hello-world-next-js/package.json | 2 +- .../src/app/mainstage/page.tsx | 9 ++++--- .../src/app/sidepanel/page.tsx | 17 +++++++----- .../samples/hello-world/package.json | 4 +-- .../samples/hello-world/src/index.js | 17 +++++++----- addons-web-sdk/samples/package-lock.json | 27 +++++-------------- 7 files changed, 35 insertions(+), 43 deletions(-) diff --git a/addons-web-sdk/samples/animation-next-js/package.json b/addons-web-sdk/samples/animation-next-js/package.json index 65b567c..68a6b01 100644 --- a/addons-web-sdk/samples/animation-next-js/package.json +++ b/addons-web-sdk/samples/animation-next-js/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@googleworkspace/meet-addons": "^0.12.0", + "@googleworkspace/meet-addons": "^1.0.0", "next": "14.2.7", "react": "^18", "react-dom": "^18" diff --git a/addons-web-sdk/samples/hello-world-next-js/package.json b/addons-web-sdk/samples/hello-world-next-js/package.json index e349ff3..895e41b 100644 --- a/addons-web-sdk/samples/hello-world-next-js/package.json +++ b/addons-web-sdk/samples/hello-world-next-js/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@googleworkspace/meet-addons": "^0.9.1", + "@googleworkspace/meet-addons": "^1.0.0", "next": "14.2.7", "react": "^18", "react-dom": "^18" diff --git a/addons-web-sdk/samples/hello-world-next-js/src/app/mainstage/page.tsx b/addons-web-sdk/samples/hello-world-next-js/src/app/mainstage/page.tsx index 5e8d38a..7031323 100644 --- a/addons-web-sdk/samples/hello-world-next-js/src/app/mainstage/page.tsx +++ b/addons-web-sdk/samples/hello-world-next-js/src/app/mainstage/page.tsx @@ -1,4 +1,4 @@ -"use client"; +'use client'; import { useEffect } from 'react'; import { meet } from '@googleworkspace/meet-addons/meet.addons'; @@ -22,11 +22,12 @@ export default function Page() { initializeMainStage(); }, []); - return ( <> -
This is the Add-on Main Stage. Everyone in the call can see this.
+
+ This is the Add-on Main Stage. Everyone in the call can see this. +
Hello, world!
- ) + ); } diff --git a/addons-web-sdk/samples/hello-world-next-js/src/app/sidepanel/page.tsx b/addons-web-sdk/samples/hello-world-next-js/src/app/sidepanel/page.tsx index 2781ac2..ae01e96 100644 --- a/addons-web-sdk/samples/hello-world-next-js/src/app/sidepanel/page.tsx +++ b/addons-web-sdk/samples/hello-world-next-js/src/app/sidepanel/page.tsx @@ -1,7 +1,10 @@ -"use client"; +'use client'; import { useEffect, useState } from 'react'; -import { meet, MeetSidePanelClient } from '@googleworkspace/meet-addons/meet.addons'; +import { + meet, + MeetSidePanelClient, +} from '@googleworkspace/meet-addons/meet.addons'; import { CLOUD_PROJECT_NUMBER, MAIN_STAGE_URL } from '../../constants'; /** @@ -11,11 +14,11 @@ export default function Page() { const [sidePanelClient, setSidePanelClient] = useState(); // Launches the main stage when the main button is clicked. - async function startCollaboration(e: unknown) { + async function startActivity(e: unknown) { if (!sidePanelClient) { - throw new Error("Side Panel is not yet initialized!"); + throw new Error('Side Panel is not yet initialized!'); } - await sidePanelClient.startCollaboration({ mainStageUrl: MAIN_STAGE_URL }); + await sidePanelClient.startActivity({ mainStageUrl: MAIN_STAGE_URL }); } useEffect(() => { @@ -34,7 +37,7 @@ export default function Page() { return ( <>
This is the Add-on Side Panel. Only you can see this.
- + - ) + ); } diff --git a/addons-web-sdk/samples/hello-world/package.json b/addons-web-sdk/samples/hello-world/package.json index 3179032..fbad4a9 100644 --- a/addons-web-sdk/samples/hello-world/package.json +++ b/addons-web-sdk/samples/hello-world/package.json @@ -9,10 +9,10 @@ "build": "mkdir -p ../dist/hello-world && cp src/*.html ../dist/hello-world/ && npx webpack" }, "dependencies": { - "@googleworkspace/meet-addons": "^0.9.1" + "@googleworkspace/meet-addons": "^1.0.0" }, "devDependencies": { "webpack": "^5.94.0", "webpack-cli": "^5.1.4" } -} \ No newline at end of file +} diff --git a/addons-web-sdk/samples/hello-world/src/index.js b/addons-web-sdk/samples/hello-world/src/index.js index 68853cf..0d04b44 100644 --- a/addons-web-sdk/samples/hello-world/src/index.js +++ b/addons-web-sdk/samples/hello-world/src/index.js @@ -15,21 +15,24 @@ import { meet } from '@googleworkspace/meet-addons/meet.addons'; // TODO: Make sure that you modify these constants, if you fork this! -const CLOUD_PROJECT_NUMBER = "989911054302"; -const MAIN_STAGE_URL = "https://googleworkspace.github.io/meet/hello-world/MainStage.html" +const CLOUD_PROJECT_NUMBER = '989911054302'; +const MAIN_STAGE_URL = + 'https://googleworkspace.github.io/meet/hello-world/MainStage.html'; /** - * Prepares the Add-on Side Panel Client, and adds an event to launch the main - * stage when the main button is clicked. + * Prepares the Add-on Side Panel Client, and adds an event to launch the + * activity in the main stage when the main button is clicked. */ export async function setUpAddon() { const session = await meet.addon.createAddonSession({ cloudProjectNumber: CLOUD_PROJECT_NUMBER, }); const sidePanelClient = await session.createSidePanelClient(); - document.getElementById('start-activity').addEventListener('click', async () => { - await sidePanelClient.startCollaboration({ mainStageUrl: MAIN_STAGE_URL }); - }); + document + .getElementById('start-activity') + .addEventListener('click', async () => { + await sidePanelClient.startActivity({ mainStageUrl: MAIN_STAGE_URL }); + }); } /** diff --git a/addons-web-sdk/samples/package-lock.json b/addons-web-sdk/samples/package-lock.json index 9dafcda..2e7b1de 100644 --- a/addons-web-sdk/samples/package-lock.json +++ b/addons-web-sdk/samples/package-lock.json @@ -15,7 +15,7 @@ "animation-next-js": { "version": "0.1.0", "dependencies": { - "@googleworkspace/meet-addons": "^0.12.0", + "@googleworkspace/meet-addons": "^1.0.0", "next": "14.2.7", "react": "^18", "react-dom": "^18" @@ -27,13 +27,10 @@ "typescript": "^5" } }, - "animation-next-js/@googleworkspace/meet-addons@next": { - "extraneous": true - }, "hello-world": { "license": "Apache-2.0", "dependencies": { - "@googleworkspace/meet-addons": "^0.9.1" + "@googleworkspace/meet-addons": "^1.0.0" }, "devDependencies": { "webpack": "^5.94.0", @@ -43,7 +40,7 @@ "hello-world-next-js": { "version": "0.1.0", "dependencies": { - "@googleworkspace/meet-addons": "^0.9.1", + "@googleworkspace/meet-addons": "^1.0.0", "next": "14.2.7", "react": "^18", "react-dom": "^18" @@ -55,18 +52,6 @@ "typescript": "^5" } }, - "hello-world-next-js/node_modules/@googleworkspace/meet-addons": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@googleworkspace/meet-addons/-/meet-addons-0.9.1.tgz", - "integrity": "sha512-GBHec8Cau90Edyi88YEWxvdfwm/0Aa1B/1HQbISjCh4t3sybGY/5Da9ReHMid3th0e2HtzPWpiCvROIQOS37dw==", - "license": "SEE LICENSE IN LICENSE" - }, - "hello-world/node_modules/@googleworkspace/meet-addons": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@googleworkspace/meet-addons/-/meet-addons-0.9.1.tgz", - "integrity": "sha512-GBHec8Cau90Edyi88YEWxvdfwm/0Aa1B/1HQbISjCh4t3sybGY/5Da9ReHMid3th0e2HtzPWpiCvROIQOS37dw==", - "license": "SEE LICENSE IN LICENSE" - }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -78,9 +63,9 @@ } }, "node_modules/@googleworkspace/meet-addons": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@googleworkspace/meet-addons/-/meet-addons-0.12.0.tgz", - "integrity": "sha512-RO3f+lkq9JUDxR5jac4hX0O+90RGlAe2FUI5aQSeYLY0f9ViUuhhQhB4yoLZ33Q8brXVo6dULK6BaX0qmqsz1Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@googleworkspace/meet-addons/-/meet-addons-1.0.0.tgz", + "integrity": "sha512-kE1fwqw4NMszJfgmyNVyDzPtkev1Ee3l7ZT7CAOH7veJ5No0mYOqdCOmheiCAhneLvsoTGjeUfvOYMJSYq728g==", "license": "SEE LICENSE IN LICENSE" }, "node_modules/@jridgewell/gen-mapping": {