From 79e9170f1db7baca6c18424d2b8360a78318d901 Mon Sep 17 00:00:00 2001
From: Elisha Nuchi <31550519+enuchi@users.noreply.github.com>
Date: Sat, 15 Mar 2025 01:13:59 -0400
Subject: [PATCH 1/5] Use latest gas-client and support closing dialogs
---
README.md | 10 +-
dev/dev-server-wrapper.html | 16 +-
package.json | 4 +-
.../components/SheetEditor.jsx | 29 +-
src/client/dialog-demo-bootstrap/index.html | 2 +-
src/client/dialog-demo-mui/index.html | 2 +-
src/client/dialog-demo-tailwindcss/index.html | 2 +-
src/client/dialog-demo/index.html | 2 +-
src/client/utils/serverFunctions.ts | 6 +-
yarn.lock | 5062 ++++++++---------
10 files changed, 2563 insertions(+), 2572 deletions(-)
diff --git a/README.md b/README.md
index cc98b6e0..9c071215 100644
--- a/README.md
+++ b/README.md
@@ -309,8 +309,8 @@ google.script.run
.addSheet(sheetTitle);
// Using gas-client we can use more familiar promises style like this:
-import Server from 'gas-client';
-const { serverFunctions } = new Server();
+import { GASClient } from 'gas-client';
+const { serverFunctions, scriptHostFunctions } = new GASClient({});
// We now have access to all our server functions, which return promises!
serverFunctions
@@ -327,6 +327,12 @@ async () => {
handleError(err);
}
};
+
+// Use scriptHostFunctions to control dialogs
+scriptHostFunctions.close(); // close a dialog or sidebar
+scriptHostFunctions.setWidth(400); // set dialog width to 400px
+scriptHostFunctions.setHeight(800); // set dialog height to 800px
+
```
In development, `gas-client` will allow you to call server-side functions from your local environment. In production, it will use Google's underlying `google.script.run` utility.
diff --git a/dev/dev-server-wrapper.html b/dev/dev-server-wrapper.html
index c050c058..4c129e59 100644
--- a/dev/dev-server-wrapper.html
+++ b/dev/dev-server-wrapper.html
@@ -20,7 +20,7 @@