Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_slides-create-image",
name: "Create Image",
description: "Creates an image in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateImageRequest)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
googleSlides,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "google_slides-create-page-element",
name: "Create Page Element",
description: "Create a new page element in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateShapeRequest)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
googleSlides,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_slides-create-presentation",
name: "Create Presentation",
description: "Create a blank presentation or duplicate an existing presentation. [See the docs here](https://developers.google.com/slides/api/guides/presentations#copy_an_existing_presentation)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "google_slides-create-slide",
name: "Create Slide",
description: "Create a new slide in a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateSlideRequest)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
googleSlides,
Expand Down
88 changes: 88 additions & 0 deletions components/google_slides/actions/create-table/create-table.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import googleSlides from "../../google_slides.app.mjs";

export default {
key: "google_slides-create-table",
name: "Create Table",
description: "Create a new table in a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#CreateTableRequest)",
version: "0.0.1",
type: "action",
props: {
googleSlides,
presentationId: {
propDefinition: [
googleSlides,
"presentationId",
],
},
slideId: {
propDefinition: [
googleSlides,
"slideId",
(c) => ({
presentationId: c.presentationId,
}),
],
},
rows: {
type: "integer",
label: "Rows",
description: "The number of rows in the table",
},
columns: {
type: "integer",
label: "Columns",
description: "The number of columns in the table",
},
height: {
type: "integer",
label: "Height",
description: "The height of the shape in points (1/72 of an inch)",
},
width: {
type: "integer",
label: "Width",
description: "The width of the shape in points (1/72 of an inch)",
},
translateX: {
type: "integer",
label: "Translate X",
description: "The translation of the table on the x-axis",
optional: true,
},
translateY: {
type: "integer",
label: "Translate Y",
description: "The translation of the table on the y-axis",
optional: true,
},
},
async run({ $ }) {
const response = await this.googleSlides.createTable(this.presentationId, {
elementProperties: {
pageObjectId: this.slideId,
size: {
height: {
magnitude: this.height,
unit: "PT",
},
width: {
magnitude: this.width,
unit: "PT",
},
},
transform: {
scaleX: 1,
scaleY: 1,
translateX: this.translateX,
translateY: this.translateY,
unit: "PT",
},
},
rows: this.rows,
columns: this.columns,
});

$.export("$summary", "Successfully created table in the slide");
return response.data;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_slides-delete-page-element",
name: "Delete Page Element",
description: "Deletes a page element from a slide. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteObjectRequest)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
googleSlides,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_slides-delete-slide",
name: "Delete Slide",
description: "Deletes a slide from a presentation. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteObjectRequest)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
googleSlides,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import googleSlides from "../../google_slides.app.mjs";

export default {
key: "google_slides-delete-table-column",
name: "Delete Table Column",
description: "Delete column from a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteTableColumnRequest)",
version: "0.0.1",
type: "action",
props: {
googleSlides,
presentationId: {
propDefinition: [
googleSlides,
"presentationId",
],
},
slideId: {
propDefinition: [
googleSlides,
"slideId",
(c) => ({
presentationId: c.presentationId,
}),
],
},
tableId: {
propDefinition: [
googleSlides,
"tableId",
(c) => ({
presentationId: c.presentationId,
slideId: c.slideId,
}),
],
},
columnIndex: {
type: "integer",
label: "Column Index",
description: "The index of the column to delete",
},
},
async run({ $ }) {
const response = await this.googleSlides.deleteTableColumn(this.presentationId, {
tableObjectId: this.tableId,
cellLocation: {
columnIndex: this.columnIndex,
},
});
$.export("$summary", "Successfully deleted table column");
return response.data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import googleSlides from "../../google_slides.app.mjs";

export default {
key: "google_slides-delete-table-row",
name: "Delete Table Row",
description: "Delete row from a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#DeleteTableRowRequest)",
version: "0.0.1",
type: "action",
props: {
googleSlides,
presentationId: {
propDefinition: [
googleSlides,
"presentationId",
],
},
slideId: {
propDefinition: [
googleSlides,
"slideId",
(c) => ({
presentationId: c.presentationId,
}),
],
},
tableId: {
propDefinition: [
googleSlides,
"tableId",
(c) => ({
presentationId: c.presentationId,
slideId: c.slideId,
}),
],
},
rowIndex: {
type: "integer",
label: "Row Index",
description: "The index of the row to delete",
},
},
async run({ $ }) {
const response = await this.googleSlides.deleteTableRow(this.presentationId, {
tableObjectId: this.tableId,
cellLocation: {
rowIndex: this.rowIndex,
},
});
$.export("$summary", "Successfully deleted table row");
return response.data;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_slides-find-presentation",
name: "Find a Presentation",
description: "Find a presentation on Google Drive. [See the docs here](https://developers.google.com/slides/api/samples/presentation#list_existing_presentation_files)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import googleSlides from "../../google_slides.app.mjs";

export default {
key: "google_slides-insert-table-columns",
name: "Insert Table Columns",
description: "Insert new columns into a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTableColumnsRequest)",
version: "0.0.1",
type: "action",
props: {
googleSlides,
presentationId: {
propDefinition: [
googleSlides,
"presentationId",
],
},
slideId: {
propDefinition: [
googleSlides,
"slideId",
(c) => ({
presentationId: c.presentationId,
}),
],
},
tableId: {
propDefinition: [
googleSlides,
"tableId",
(c) => ({
presentationId: c.presentationId,
slideId: c.slideId,
}),
],
},
columnIndex: {
type: "integer",
label: "Column Index",
description: "The column index of an existing cell used as the insertion reference point",
optional: true,
},
insertRight: {
type: "boolean",
label: "Insert Right",
description: "Whether to insert the column to the right of the specified cell location",
optional: true,
},
number: {
type: "integer",
label: "Number",
description: "The number of columns to be inserted. Maximum 20 per request.",
default: 1,
optional: true,
},
},
async run({ $ }) {
const response = await this.googleSlides.insertTableColumns(this.presentationId, {
tableObjectId: this.tableId,
cellLocation: {
columnIndex: this.columnIndex,
},
insertRight: this.insertRight,
number: this.number,
});
$.export("$summary", "Successfully inserted table column");
return response.data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import googleSlides from "../../google_slides.app.mjs";

export default {
key: "google_slides-insert-table-rows",
name: "Insert Table Rows",
description: "Insert new rows into a table. [See the documentation](https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request#InsertTableRowsRequest)",
version: "0.0.1",
type: "action",
props: {
googleSlides,
presentationId: {
propDefinition: [
googleSlides,
"presentationId",
],
},
slideId: {
propDefinition: [
googleSlides,
"slideId",
(c) => ({
presentationId: c.presentationId,
}),
],
},
tableId: {
propDefinition: [
googleSlides,
"tableId",
(c) => ({
presentationId: c.presentationId,
slideId: c.slideId,
}),
],
},
rowIndex: {
type: "integer",
label: "Row Index",
description: "The row index of an existing cell used as the insertion reference point",
optional: true,
},
insertBelow: {
type: "boolean",
label: "Insert Below",
description: "Whether to insert the row below the specified cell location",
optional: true,
},
number: {
type: "integer",
label: "Number",
description: "The number of rows to be inserted. Maximum 20 per request.",
default: 1,
optional: true,
},
},
async run({ $ }) {
const response = await this.googleSlides.insertTableRows(this.presentationId, {
tableObjectId: this.tableId,
cellLocation: {
rowIndex: this.rowIndex,
},
insertBelow: this.insertBelow,
number: this.number,
});
$.export("$summary", "Successfully inserted table row");
return response.data;
},
};
Loading
Loading