-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Google Slides - new components #18142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
components/google_slides/actions/create-table/create-table.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
components/google_slides/actions/delete-table-column/delete-table-column.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}; |
52 changes: 52 additions & 0 deletions
52
components/google_slides/actions/delete-table-row/delete-table-row.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
components/google_slides/actions/insert-table-columns/insert-table-columns.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
number: { | ||
type: "integer", | ||
label: "Number", | ||
description: "The number of columns to be inserted. Maximum 20 per request.", | ||
default: 1, | ||
optional: true, | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
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; | ||
}, | ||
}; |
68 changes: 68 additions & 0 deletions
68
components/google_slides/actions/insert-table-rows/insert-table-rows.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
number: { | ||
type: "integer", | ||
label: "Number", | ||
description: "The number of rows to be inserted. Maximum 20 per request.", | ||
default: 1, | ||
optional: true, | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
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; | ||
}, | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.