Skip to content

Commit ec7e414

Browse files
committed
new components
1 parent ce9fef1 commit ec7e414

File tree

8 files changed

+511
-228
lines changed

8 files changed

+511
-228
lines changed

components/mural/actions/create-mural/create-mural.mjs

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,93 @@ import mural from "../../mural.app.mjs";
33
export default {
44
key: "mural-create-mural",
55
name: "Create Mural",
6-
description: "Create a new mural within a specified workspace.",
7-
version: "0.0.{{ts}}",
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",
88
type: "action",
99
props: {
1010
mural,
11-
workspaceId: mural.propDefinitions.workspaceId,
12-
name: mural.propDefinitions.name,
13-
description: {
14-
...mural.propDefinitions.description,
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+
],
1564
optional: true,
1665
},
17-
templateId: {
18-
...mural.propDefinitions.templateId,
66+
visitorAvatarTheme: {
67+
type: "string",
68+
label: "Visitor Avatar Theme",
69+
description: "The timer sound theme for the mural",
70+
options: [
71+
"animals",
72+
"music",
73+
"travel",
74+
],
1975
optional: true,
2076
},
2177
},
2278
async run({ $ }) {
2379
const response = await this.mural.createMural({
80+
$,
2481
data: {
25-
workspaceId: this.workspaceId,
26-
name: this.name,
27-
description: this.description,
28-
templateId: this.templateId,
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,
2990
},
3091
});
31-
$.export("$summary", `Successfully created mural ${this.name}`);
92+
$.export("$summary", `Successfully created mural "${this.title}"`);
3293
return response;
3394
},
3495
};

components/mural/actions/create-sticky/create-sticky.mjs

Lines changed: 86 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,115 @@ import mural from "../../mural.app.mjs";
33
export default {
44
key: "mural-create-sticky",
55
name: "Create Sticky",
6-
description: "Create a new sticky note within a given mural. [See the documentation](https://developers.mural.co/public/docs/mural-api)",
7-
version: "0.0.{{ts}}",
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",
88
type: "action",
99
props: {
1010
mural,
11-
muralId: {
11+
workspaceId: {
1212
propDefinition: [
1313
mural,
14-
"muralId",
14+
"workspaceId",
1515
],
1616
},
17-
content: {
17+
muralId: {
1818
propDefinition: [
1919
mural,
20-
"stickyContent",
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",
2133
],
2234
},
23-
color: {
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: {
2475
propDefinition: [
2576
mural,
26-
"color",
77+
"tagIds",
78+
(c) => ({
79+
muralId: c.muralId,
80+
}),
2781
],
28-
optional: true,
2982
},
30-
position: {
83+
parentId: {
3184
propDefinition: [
3285
mural,
33-
"position",
86+
"widgetId",
87+
(c) => ({
88+
muralId: c.muralId,
89+
type: "areas",
90+
}),
3491
],
35-
optional: true,
92+
label: "Parent ID",
93+
description: "The ID of the area widget that contains the widget",
3694
},
3795
},
3896
async run({ $ }) {
3997
const response = await this.mural.createSticky({
40-
data: {
41-
muralId: this.muralId,
42-
content: this.content,
43-
color: this.color,
44-
position: this.position,
45-
},
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+
],
46113
});
47-
$.export("$summary", `Successfully created sticky note with ID: ${response.id}`);
114+
$.export("$summary", `Successfully created sticky note with ID: ${response.value[0].id}`);
48115
return response;
49116
},
50117
};

0 commit comments

Comments
 (0)