@pixelvibing/cli 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -548,7 +548,15 @@ function createWebApi(fetcher = (input, init2) => fetch(input, init2), base = AP
548
548
  };
549
549
  return {
550
550
  projects: (before = null) => json2(`/projects${before === null ? "" : `?before=${id(before)}`}`),
551
- createProject: (name, idea) => paying2(() => json2("/projects", { method: "POST", body: { name, idea } })),
551
+ /** A new project from its name and idea, with its settings and its first map's size when chosen (specs/project-settings/ R1.2). */
552
+ createProject: (name, idea, settings, map) => paying2(
553
+ () => json2("/projects", {
554
+ method: "POST",
555
+ body: { name, idea, ...settings === void 0 ? {} : { settings }, ...map === void 0 ? {} : { map } }
556
+ })
557
+ ),
558
+ /** Change a project's camera, outline or sprite size (R2.1). */
559
+ changeSettings: (projectId, change) => json2(`/projects/${id(projectId)}/settings`, { method: "PUT", body: change }),
552
560
  project: (projectId) => json2(`/projects/${id(projectId)}`),
553
561
  renameProject: (projectId, name) => json2(`/projects/${id(projectId)}`, { method: "PATCH", body: { name } }),
554
562
  deleteProject: async (projectId) => {
@@ -3890,13 +3898,13 @@ function gridForCells(cols, rows, cellsPerTile = CELLS_PER_TILE) {
3890
3898
  for (let cell = MAX_CELL - 1; cell >= MIN_CELL; cell -= 1) if (drawn(cell) && unscaled(cell)) return canvas(cell);
3891
3899
  return null;
3892
3900
  }
3893
- function gridCanvas(footprint) {
3894
- return gridForCells(footprint.cols * CELLS_PER_TILE, footprint.rows * CELLS_PER_TILE);
3901
+ function gridCanvas(footprint, cellsPerTile = CELLS_PER_TILE) {
3902
+ return gridForCells(footprint.cols * cellsPerTile, footprint.rows * cellsPerTile, cellsPerTile);
3895
3903
  }
3896
- function gridProblem(footprint) {
3897
- if (gridCanvas(footprint) !== null) return null;
3898
- const side = Math.floor(ROUTE_MAX_EDGE / (CELLS_PER_TILE * MIN_CELL));
3899
- const area = Math.floor(ROUTE_MAX_PIXELS / (CELLS_PER_TILE * MIN_CELL) ** 2);
3904
+ function gridProblem(footprint, cellsPerTile = CELLS_PER_TILE) {
3905
+ if (gridCanvas(footprint, cellsPerTile) !== null) return null;
3906
+ const side = Math.floor(ROUTE_MAX_EDGE / (cellsPerTile * MIN_CELL));
3907
+ const area = Math.floor(ROUTE_MAX_PIXELS / (cellsPerTile * MIN_CELL) ** 2);
3900
3908
  return `a ${footprint.cols}×${footprint.rows} tile object is too large to draw on the grid: at most ${side} tiles on a side and ${area} tiles in all`;
3901
3909
  }
3902
3910
  function designCanvas(tiles) {
@@ -4587,7 +4595,7 @@ const move = {
4587
4595
  );
4588
4596
  }
4589
4597
  };
4590
- const version = "0.23.0";
4598
+ const version = "0.25.0";
4591
4599
  const manifest = {
4592
4600
  version
4593
4601
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelvibing/cli",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "PixelVibing: pixel art game assets from the command line, and the Skills that teach coding assistants to make them.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://pixelvibing.com",