Skip to content

Commit 21a6afa

Browse files
committed
Update tablet screen size #22
1 parent 4438791 commit 21a6afa

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

build/index.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ server.tool("create_frame", "Create a frame shape in Frame0. Must add a new page
5252
};
5353
const FRAME_SIZE = {
5454
phone: { width: 320, height: 690 },
55-
tablet: { width: 520, height: 790 },
55+
tablet: { width: 600, height: 800 },
5656
desktop: { width: 800, height: 600 },
5757
browser: { width: 800, height: 600 },
5858
watch: { width: 198, height: 242 },
@@ -273,17 +273,20 @@ server.tool("create_line", "Create a line shape in Frame0.", {
273273
.optional()
274274
.default("#000000")
275275
.describe("Stroke color in hex code of the line shape. (e.g., black) - temp string type"),
276-
}, async ({ name, parentId, x1, y1, x2, y2, strokeColor, }) => {
276+
}, async ({ name, parentId, x1, y1, x2, y2, strokeColor }) => {
277277
try {
278278
const shapeId = await command(apiPort, "shape:create-shape", {
279279
type: "Line",
280280
shapeProps: {
281281
name,
282-
path: [[x1, y1], [x2, y2]],
282+
path: [
283+
[x1, y1],
284+
[x2, y2],
285+
],
283286
tailEndType: "flat",
284287
headEndType: "flat",
285288
strokeColor,
286-
lineType: "straight"
289+
lineType: "straight",
287290
},
288291
parentId,
289292
});
@@ -325,10 +328,11 @@ server.tool("create_polygon", "Create a polygon or polyline shape in Frame0.", {
325328
.optional()
326329
.default("#000000")
327330
.describe("Stroke color in hex code of the line shape. (e.g., black) - temp string type"),
328-
}, async ({ name, parentId, points, closed, strokeColor, }) => {
331+
}, async ({ name, parentId, points, closed, strokeColor }) => {
329332
try {
330333
const path = points.map((point) => [point.x, point.y]);
331-
const pathClosed = path[0][0] === path[path.length - 1][0] && path[0][1] === path[path.length - 1][1];
334+
const pathClosed = path[0][0] === path[path.length - 1][0] &&
335+
path[0][1] === path[path.length - 1][1];
332336
if (closed && !pathClosed)
333337
path.push(path[0]);
334338
const shapeId = await command(apiPort, "shape:create-shape", {
@@ -339,7 +343,7 @@ server.tool("create_polygon", "Create a polygon or polyline shape in Frame0.", {
339343
tailEndType: "flat",
340344
headEndType: "flat",
341345
strokeColor,
342-
lineType: "straight"
346+
lineType: "straight",
343347
},
344348
parentId,
345349
});
@@ -493,7 +497,10 @@ server.tool("update_shape", "Update properties of a shape in Frame0.", {
493497
name: z.string().optional().describe("Name of the shape."),
494498
width: z.number().optional().describe("Width of the shape."),
495499
height: z.number().optional().describe("Height of the shape."),
496-
fillColor: z.string().optional().describe("Fill color in hex code of the shape."),
500+
fillColor: z
501+
.string()
502+
.optional()
503+
.describe("Fill color in hex code of the shape."),
497504
strokeColor: z
498505
.string()
499506
.optional()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frame0-mcp-server",
3-
"version": "0.11.1",
3+
"version": "0.11.2",
44
"type": "module",
55
"description": "",
66
"bin": {

src/index.ts

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ server.tool(
6666
};
6767
const FRAME_SIZE = {
6868
phone: { width: 320, height: 690 },
69-
tablet: { width: 520, height: 790 },
69+
tablet: { width: 600, height: 800 },
7070
desktop: { width: 800, height: 600 },
7171
browser: { width: 800, height: 600 },
7272
watch: { width: 198, height: 242 },
@@ -382,25 +382,20 @@ server.tool(
382382
"Stroke color in hex code of the line shape. (e.g., black) - temp string type"
383383
),
384384
},
385-
async ({
386-
name,
387-
parentId,
388-
x1,
389-
y1,
390-
x2,
391-
y2,
392-
strokeColor,
393-
}) => {
385+
async ({ name, parentId, x1, y1, x2, y2, strokeColor }) => {
394386
try {
395387
const shapeId = await command(apiPort, "shape:create-shape", {
396388
type: "Line",
397389
shapeProps: {
398390
name,
399-
path: [[x1, y1], [x2, y2]],
391+
path: [
392+
[x1, y1],
393+
[x2, y2],
394+
],
400395
tailEndType: "flat",
401396
headEndType: "flat",
402397
strokeColor,
403-
lineType: "straight"
398+
lineType: "straight",
404399
},
405400
parentId,
406401
});
@@ -447,7 +442,9 @@ server.tool(
447442
.string()
448443
.optional()
449444
.default("#ffffff")
450-
.describe("Fill color in hex code of the polygon shape. (e.g., white) - temp string type"),
445+
.describe(
446+
"Fill color in hex code of the polygon shape. (e.g., white) - temp string type"
447+
),
451448
strokeColor: z
452449
.string()
453450
.optional()
@@ -456,16 +453,12 @@ server.tool(
456453
"Stroke color in hex code of the line shape. (e.g., black) - temp string type"
457454
),
458455
},
459-
async ({
460-
name,
461-
parentId,
462-
points,
463-
closed,
464-
strokeColor,
465-
}) => {
456+
async ({ name, parentId, points, closed, strokeColor }) => {
466457
try {
467458
const path = points.map((point) => [point.x, point.y]);
468-
const pathClosed = path[0][0] === path[path.length - 1][0] && path[0][1] === path[path.length - 1][1];
459+
const pathClosed =
460+
path[0][0] === path[path.length - 1][0] &&
461+
path[0][1] === path[path.length - 1][1];
469462
if (closed && !pathClosed) path.push(path[0]);
470463
const shapeId = await command(apiPort, "shape:create-shape", {
471464
type: "Line",
@@ -475,7 +468,7 @@ server.tool(
475468
tailEndType: "flat",
476469
headEndType: "flat",
477470
strokeColor,
478-
lineType: "straight"
471+
lineType: "straight",
479472
},
480473
parentId,
481474
});
@@ -688,7 +681,10 @@ server.tool(
688681
name: z.string().optional().describe("Name of the shape."),
689682
width: z.number().optional().describe("Width of the shape."),
690683
height: z.number().optional().describe("Height of the shape."),
691-
fillColor: z.string().optional().describe("Fill color in hex code of the shape."),
684+
fillColor: z
685+
.string()
686+
.optional()
687+
.describe("Fill color in hex code of the shape."),
692688
strokeColor: z
693689
.string()
694690
.optional()

0 commit comments

Comments
 (0)