Skip to content
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

New Components - mural #14632

Merged
merged 4 commits into from
Nov 13, 2024
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
95 changes: 95 additions & 0 deletions components/mural/actions/create-mural/create-mural.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import mural from "../../mural.app.mjs";

export default {
key: "mural-create-mural",
name: "Create Mural",
description: "Create a new mural within a specified workspace. [See the documentation](https://developers.mural.co/public/reference/createmural)",
version: "0.0.1",
type: "action",
props: {
mural,
workspaceId: {
propDefinition: [
mural,
"workspaceId",
],
},
roomId: {
propDefinition: [
mural,
"roomId",
(c) => ({
workspaceId: c.workspaceId,
}),
],
},
title: {
type: "string",
label: "Title",
description: "The title of the Mural.",
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
backgroundColor: {
type: "string",
label: "Background Color",
description: "The background color of the mural. Example: `#FAFAFAFF`",
optional: true,
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
height: {
type: "integer",
label: "Height",
description: "The height of the mural in px",
optional: true,
},
width: {
type: "integer",
label: "Width",
description: "The width of the mural in px",
optional: true,
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
infinite: {
type: "boolean",
label: "Infinite",
description: "When `true`, this indicates that the mural canvas is borderless and grows as you add widgets to it.",
optional: true,
},
timerSoundTheme: {
type: "string",
label: "Timer Sound Theme",
description: "The timer sound theme for the mural",
options: [
"airplane",
"cello",
"cuckoo",
],
optional: true,
},
visitorAvatarTheme: {
type: "string",
label: "Visitor Avatar Theme",
description: "The visitor avatar theme for the mural",
options: [
"animals",
"music",
"travel",
],
optional: true,
},
},
async run({ $ }) {
const response = await this.mural.createMural({
$,
data: {
roomId: this.roomId,
title: this.title,
backgroundColor: this.backgroundColor,
height: this.height,
width: this.width,
infinite: this.infinite,
timerSoundTheme: this.timerSoundTheme,
visitorAvatarTheme: this.visitorAvatarTheme,
},
});
$.export("$summary", `Successfully created mural "${this.title}"`);
return response;
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
};
117 changes: 117 additions & 0 deletions components/mural/actions/create-sticky/create-sticky.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import mural from "../../mural.app.mjs";

export default {
key: "mural-create-sticky",
name: "Create Sticky",
description: "Create a new sticky note within a given mural. [See the documentation](https://developers.mural.co/public/reference/createstickynote)",
version: "0.0.1",
type: "action",
props: {
mural,
workspaceId: {
propDefinition: [
mural,
"workspaceId",
],
},
muralId: {
propDefinition: [
mural,
"muralId",
(c) => ({
workspaceId: c.workspaceId,
}),
],
},
shape: {
type: "string",
label: "Shape",
description: "The shape of the sticky note widget",
options: [
"circle",
"rectangle",
],
},
xPosition: {
type: "integer",
label: "X Position",
description: "The horizontal position of the widget in px. This is the distance from the left of the parent widget, such as an area. If the widget has no parent widget, this is the distance from the left of the mural.",
},
yPosition: {
type: "integer",
label: "Y Position",
description: "The vertical position of the widget in px. This is the distance from the top of the parent widget, such as an area. If the widget has no parent widget, this is the distance from the top of the mural.",
},
text: {
type: "string",
label: "Text",
description: "The text in the widget",
},
title: {
type: "string",
label: "Title",
description: "The title of the widget in the outline",
optional: true,
},
height: {
type: "integer",
label: "Height",
description: "The height of the widget in px",
optional: true,
},
width: {
type: "integer",
label: "Width",
description: "The width of the widget in px",
optional: true,
},
hidden: {
type: "boolean",
label: "Hidden",
description: "If `true`, the widget is hidden from non-facilitators. Applies only when the widget is in the outline",
optional: true,
},
tagIds: {
propDefinition: [
mural,
"tagIds",
(c) => ({
muralId: c.muralId,
}),
],
},
parentId: {
propDefinition: [
mural,
"widgetId",
(c) => ({
muralId: c.muralId,
type: "areas",
}),
],
label: "Parent ID",
description: "The ID of the area widget that contains the widget",
},
},
async run({ $ }) {
const response = await this.mural.createSticky({
$,
muralId: this.muralId,
data: [
{
shape: this.shape,
x: this.xPosition,
y: this.yPosition,
text: this.text,
title: this.title,
height: this.height,
width: this.width,
hidden: this.hidden,
parentId: this.parentId,
},
],
});
$.export("$summary", `Successfully created sticky note with ID: ${response.value[0].id}`);
return response;
},
michelle0927 marked this conversation as resolved.
Show resolved Hide resolved
};
Loading
Loading