Skip to content

Commit b5d455e

Browse files
authored
New Components - mural (#14632)
* init * new components * pnpm-lock.yaml * fix description
1 parent 420d660 commit b5d455e

File tree

9 files changed

+655
-8
lines changed

9 files changed

+655
-8
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import mural from "../../mural.app.mjs";
2+
3+
export default {
4+
key: "mural-create-mural",
5+
name: "Create Mural",
6+
description: "Create a new mural within a specified workspace. [See the documentation](https://developers.mural.co/public/reference/createmural)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
mural,
11+
workspaceId: {
12+
propDefinition: [
13+
mural,
14+
"workspaceId",
15+
],
16+
},
17+
roomId: {
18+
propDefinition: [
19+
mural,
20+
"roomId",
21+
(c) => ({
22+
workspaceId: c.workspaceId,
23+
}),
24+
],
25+
},
26+
title: {
27+
type: "string",
28+
label: "Title",
29+
description: "The title of the Mural.",
30+
},
31+
backgroundColor: {
32+
type: "string",
33+
label: "Background Color",
34+
description: "The background color of the mural. Example: `#FAFAFAFF`",
35+
optional: true,
36+
},
37+
height: {
38+
type: "integer",
39+
label: "Height",
40+
description: "The height of the mural in px",
41+
optional: true,
42+
},
43+
width: {
44+
type: "integer",
45+
label: "Width",
46+
description: "The width of the mural in px",
47+
optional: true,
48+
},
49+
infinite: {
50+
type: "boolean",
51+
label: "Infinite",
52+
description: "When `true`, this indicates that the mural canvas is borderless and grows as you add widgets to it.",
53+
optional: true,
54+
},
55+
timerSoundTheme: {
56+
type: "string",
57+
label: "Timer Sound Theme",
58+
description: "The timer sound theme for the mural",
59+
options: [
60+
"airplane",
61+
"cello",
62+
"cuckoo",
63+
],
64+
optional: true,
65+
},
66+
visitorAvatarTheme: {
67+
type: "string",
68+
label: "Visitor Avatar Theme",
69+
description: "The visitor avatar theme for the mural",
70+
options: [
71+
"animals",
72+
"music",
73+
"travel",
74+
],
75+
optional: true,
76+
},
77+
},
78+
async run({ $ }) {
79+
const response = await this.mural.createMural({
80+
$,
81+
data: {
82+
roomId: this.roomId,
83+
title: this.title,
84+
backgroundColor: this.backgroundColor,
85+
height: this.height,
86+
width: this.width,
87+
infinite: this.infinite,
88+
timerSoundTheme: this.timerSoundTheme,
89+
visitorAvatarTheme: this.visitorAvatarTheme,
90+
},
91+
});
92+
$.export("$summary", `Successfully created mural "${this.title}"`);
93+
return response;
94+
},
95+
};
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import mural from "../../mural.app.mjs";
2+
3+
export default {
4+
key: "mural-create-sticky",
5+
name: "Create Sticky",
6+
description: "Create a new sticky note within a given mural. [See the documentation](https://developers.mural.co/public/reference/createstickynote)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
mural,
11+
workspaceId: {
12+
propDefinition: [
13+
mural,
14+
"workspaceId",
15+
],
16+
},
17+
muralId: {
18+
propDefinition: [
19+
mural,
20+
"muralId",
21+
(c) => ({
22+
workspaceId: c.workspaceId,
23+
}),
24+
],
25+
},
26+
shape: {
27+
type: "string",
28+
label: "Shape",
29+
description: "The shape of the sticky note widget",
30+
options: [
31+
"circle",
32+
"rectangle",
33+
],
34+
},
35+
xPosition: {
36+
type: "integer",
37+
label: "X Position",
38+
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.",
39+
},
40+
yPosition: {
41+
type: "integer",
42+
label: "Y Position",
43+
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.",
44+
},
45+
text: {
46+
type: "string",
47+
label: "Text",
48+
description: "The text in the widget",
49+
},
50+
title: {
51+
type: "string",
52+
label: "Title",
53+
description: "The title of the widget in the outline",
54+
optional: true,
55+
},
56+
height: {
57+
type: "integer",
58+
label: "Height",
59+
description: "The height of the widget in px",
60+
optional: true,
61+
},
62+
width: {
63+
type: "integer",
64+
label: "Width",
65+
description: "The width of the widget in px",
66+
optional: true,
67+
},
68+
hidden: {
69+
type: "boolean",
70+
label: "Hidden",
71+
description: "If `true`, the widget is hidden from non-facilitators. Applies only when the widget is in the outline",
72+
optional: true,
73+
},
74+
tagIds: {
75+
propDefinition: [
76+
mural,
77+
"tagIds",
78+
(c) => ({
79+
muralId: c.muralId,
80+
}),
81+
],
82+
},
83+
parentId: {
84+
propDefinition: [
85+
mural,
86+
"widgetId",
87+
(c) => ({
88+
muralId: c.muralId,
89+
type: "areas",
90+
}),
91+
],
92+
label: "Parent ID",
93+
description: "The ID of the area widget that contains the widget",
94+
},
95+
},
96+
async run({ $ }) {
97+
const response = await this.mural.createSticky({
98+
$,
99+
muralId: this.muralId,
100+
data: [
101+
{
102+
shape: this.shape,
103+
x: this.xPosition,
104+
y: this.yPosition,
105+
text: this.text,
106+
title: this.title,
107+
height: this.height,
108+
width: this.width,
109+
hidden: this.hidden,
110+
parentId: this.parentId,
111+
},
112+
],
113+
});
114+
$.export("$summary", `Successfully created sticky note with ID: ${response.value[0].id}`);
115+
return response;
116+
},
117+
};

0 commit comments

Comments
 (0)