@popcraft/cli 0.53.13 → 0.53.15

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.
Files changed (2) hide show
  1. package/dist/popcraft.mjs +43 -15
  2. package/package.json +2 -2
package/dist/popcraft.mjs CHANGED
@@ -1198,7 +1198,7 @@ function operations(spec = openapi) {
1198
1198
  }
1199
1199
  async function call(target2, method, path, opts = {}) {
1200
1200
  const qs = new URLSearchParams(opts.query ?? {}).toString();
1201
- const headers = { "user-agent": `popcraft-cli/${"0.53.13"}`, ...opts.headers };
1201
+ const headers = { "user-agent": `popcraft-cli/${"0.53.15"}`, ...opts.headers };
1202
1202
  if (target2.token) headers.authorization = `Bearer ${target2.token}`;
1203
1203
  if (opts.contentType) headers["content-type"] = opts.contentType;
1204
1204
  try {
@@ -94515,7 +94515,6 @@ function hasMessage(key5) {
94515
94515
  var current2, loading, listeners, formats, asts;
94516
94516
  var init_runtime = __esm({
94517
94517
  "lib/i18n/runtime.ts"() {
94518
- "use strict";
94519
94518
  init_intl_messageformat();
94520
94519
  init_icu_messageformat_parser();
94521
94520
  init_catalogs();
@@ -97583,6 +97582,7 @@ function relinkCopies(doc2, copies) {
97583
97582
  var TEXT_PATH_SOURCE_TYPES, isPathSource;
97584
97583
  var init_text_links = __esm({
97585
97584
  "lib/document/text-links.ts"() {
97585
+ "use strict";
97586
97586
  init_transform();
97587
97587
  TEXT_PATH_SOURCE_TYPES = ["VECTOR", "ELLIPSE", "RECTANGLE", "POLYGON", "STAR", "LINE", "ARROW", "FRAME"];
97588
97588
  isPathSource = (n) => !!n && TEXT_PATH_SOURCE_TYPES.includes(n.type);
@@ -252666,6 +252666,7 @@ function resizeWindow(doc2, target2, rect) {
252666
252666
  }
252667
252667
  var init_crop = __esm({
252668
252668
  "lib/editor/crop.ts"() {
252669
+ "use strict";
252669
252670
  init_dist_node();
252670
252671
  init_scene_graph();
252671
252672
  init_photo_frames();
@@ -257162,6 +257163,7 @@ function followPeers(peers) {
257162
257163
  var PALETTE, usePresence, awareness, CURSOR_SEND_MS, VIEWPORT_SEND_MS, cursorTimer, pendingCursor, sentCursor, EMOTE_MS, lastFollowCamera;
257163
257164
  var init_presence = __esm({
257164
257165
  "lib/collab/presence.ts"() {
257166
+ "use strict";
257165
257167
  init_esm();
257166
257168
  init_editor_store();
257167
257169
  init_status_announcements();
@@ -307006,6 +307008,7 @@ function decodeSource(key5, label3) {
307006
307008
  var DECODE_CACHE_BYTES, cache7, pending4, held, sizeOf, lengths, decodedLengths, DECODE_TIMEOUT_MS, decodedAudio, decodedSource, pcmOf;
307007
307009
  var init_audio_decode = __esm({
307008
307010
  "lib/motion/audio-decode.ts"() {
307011
+ "use strict";
307009
307012
  init_media_store();
307010
307013
  init_audio_plan();
307011
307014
  init_time_stretch();
@@ -311786,6 +311789,7 @@ function startCloudSync() {
311786
311789
  var status, readOnlyDoc, activeLink, statusListeners, notice, urlArmed, opening, syncStatus, canEdit, uploaded, MEDIA_UPLOAD_PARALLEL, pushTimer, pushing, dirty, pendingMedia, collab, collabSession, collabAnonymous, uploadedThumbs, thumbCheckedAt, THUMB_EVERY_MS, THUMB_MIN_GAP_MS, putThumbnail, openingFiles, mediaHealed, started2;
311787
311790
  var init_sync2 = __esm({
311788
311791
  "lib/client/cloud/sync.ts"() {
311792
+ "use strict";
311789
311793
  init_paint_repair();
311790
311794
  init_migrate();
311791
311795
  init_view();
@@ -313056,6 +313060,7 @@ function applyTextPath(layout2, path, tp, rebase = true) {
313056
313060
  var defaultCircleRadius, ownsPath, mapPoint;
313057
313061
  var init_text_path = __esm({
313058
313062
  "lib/engine/text/text-path.ts"() {
313063
+ "use strict";
313059
313064
  init_scene_graph();
313060
313065
  init_transform();
313061
313066
  init_shape_to_path();
@@ -313173,6 +313178,7 @@ function areaBounds(rings) {
313173
313178
  }
313174
313179
  var init_text_area = __esm({
313175
313180
  "lib/engine/text/text-area.ts"() {
313181
+ "use strict";
313176
313182
  }
313177
313183
  });
313178
313184
 
@@ -317609,6 +317615,7 @@ async function selectionReferenceImages(doc2, selection, opts = {}) {
317609
317615
  var FIT_QUALITIES, FIT_SCALES, blobToDataUrl;
317610
317616
  var init_reference_images = __esm({
317611
317617
  "lib/ai/reference-images.ts"() {
317618
+ "use strict";
317612
317619
  init_export();
317613
317620
  init_selection_bounds();
317614
317621
  init_renderer_registry();
@@ -318451,6 +318458,7 @@ function agentToolList() {
318451
318458
  var AGENT_CAPABILITIES, legacyCommandId, legacyTools, blobToDataUrl3, provided, legacyTool, legacyToolList;
318452
318459
  var init_agent = __esm({
318453
318460
  "lib/commands/agent.ts"() {
318461
+ "use strict";
318454
318462
  init_types5();
318455
318463
  init_registry();
318456
318464
  init_errors();
@@ -319300,7 +319308,7 @@ function placeSvgLayers(doc2, parentId, svg, place4) {
319300
319308
  }
319301
319309
  const minX = Math.min(...kids.map((k3) => k3.x)), minY = Math.min(...kids.map((k3) => k3.y));
319302
319310
  const maxX = Math.max(...kids.map((k3) => k3.x + k3.width)), maxY = Math.max(...kids.map((k3) => k3.y + k3.height));
319303
- for (const k3 of kids) nodes[k3.id] = { ...nodes[k3.id], x: k3.x - minX, y: k3.y - minY };
319311
+ for (const k3 of kids) nodes[k3.id] = { ...nodes[k3.id], x: k3.x - minX, y: k3.y - minY, constraints: { horizontal: "SCALE", vertical: "SCALE" } };
319304
319312
  let w = Math.max(1, maxX - minX), h = Math.max(1, maxY - minY);
319305
319313
  const f2 = place4.fit;
319306
319314
  const k2 = f2 && (f2.width || f2.height) ? Math.min(f2.width ? f2.width / w : Infinity, f2.height ? f2.height / h : Infinity) : 1;
@@ -319915,12 +319923,20 @@ var init_node = __esm({
319915
319923
  capped(args2.ids, "reparent");
319916
319924
  const parent = nodeOrThrow(doc2, args2.parentId);
319917
319925
  let next2 = doc2;
319918
- for (const id3 of args2.ids) {
319926
+ const stackIndex = (id3) => {
319927
+ const n = doc2.nodes[id3];
319928
+ const p2 = n?.parentId ? doc2.nodes[n.parentId] : void 0;
319929
+ return p2 ? p2.childIds.indexOf(id3) : 0;
319930
+ };
319931
+ const ordered2 = [...args2.ids].sort((a, b) => doc2.nodes[a]?.parentId === doc2.nodes[b]?.parentId ? stackIndex(a) - stackIndex(b) : 0);
319932
+ let insertAt = args2.index;
319933
+ for (const id3 of ordered2) {
319919
319934
  nodeOrThrow(doc2, id3);
319920
319935
  if (id3 === args2.parentId) throw new ToolError("A layer cannot be its own parent.");
319921
319936
  const placed2 = placementUnder(next2, id3, args2.parentId);
319922
319937
  if (placed2) next2 = updateNode(next2, id3, placed2);
319923
- next2 = reparentNode(next2, id3, args2.parentId, args2.index);
319938
+ next2 = reparentNode(next2, id3, args2.parentId, insertAt);
319939
+ if (insertAt !== void 0) insertAt = next2.nodes[args2.parentId].childIds.indexOf(id3) + 1;
319924
319940
  }
319925
319941
  ctx2.commit(applyInvariants(next2, [...args2.ids, args2.parentId]));
319926
319942
  return { summary: `Moved ${plural2(args2.ids.length, "layer")} into "${parent.name}"`, data: { ids: args2.ids, parentId: args2.parentId } };
@@ -319949,10 +319965,12 @@ var init_node = __esm({
319949
319965
  const box2 = localBox(doc2, ids2);
319950
319966
  const g = createGroup();
319951
319967
  const node2 = { ...g, name: args2.name ?? g.name, x: box2.minX, y: box2.minY, width: box2.maxX - box2.minX, height: box2.maxY - box2.minY };
319952
- const index2 = Math.min(...ids2.map((id3) => doc2.nodes[parentId].childIds.indexOf(id3)).filter((i2) => i2 >= 0));
319968
+ const siblings = doc2.nodes[parentId].childIds;
319969
+ const ordered2 = [...ids2].sort((a, b) => siblings.indexOf(a) - siblings.indexOf(b));
319970
+ const top = Math.max(...ordered2.map((id3) => siblings.indexOf(id3)));
319953
319971
  let next2 = addNode(doc2, node2, parentId);
319954
- next2 = reparentNode(next2, node2.id, parentId, index2);
319955
- for (const id3 of ids2) {
319972
+ next2 = reparentNode(next2, node2.id, parentId, top + 1);
319973
+ for (const id3 of ordered2) {
319956
319974
  const n = next2.nodes[id3];
319957
319975
  next2 = reparentNode(next2, id3, node2.id);
319958
319976
  next2 = updateNode(next2, id3, { x: n.x - box2.minX, y: n.y - box2.minY });
@@ -328825,7 +328843,7 @@ var init_package = __esm({
328825
328843
  "packages/runtime/package.json"() {
328826
328844
  package_default = {
328827
328845
  name: "@popcraft/runtime",
328828
- version: "0.53.13",
328846
+ version: "0.53.15",
328829
328847
  description: "What code exported from PopCraft shares: the meaning of expressions (operators and functions) and, as it grows, the parts of a design's behaviour that are common code rather than generated React.",
328830
328848
  license: "MIT",
328831
328849
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -353491,7 +353509,6 @@ function exportsOf(source3) {
353491
353509
  var CODE_LIMITS, packageOf;
353492
353510
  var init_source2 = __esm({
353493
353511
  "lib/code/source.ts"() {
353494
- "use strict";
353495
353512
  CODE_LIMITS = { modules: 100, sourceLength: 2e5, packages: 12 };
353496
353513
  packageOf = (spec) => spec.split("/").slice(0, spec.startsWith("@") ? 2 : 1).join("/");
353497
353514
  }
@@ -353534,7 +353551,6 @@ function compileModule(module2) {
353534
353551
  var import_sucrase, BUILT_IN, memo4;
353535
353552
  var init_compile2 = __esm({
353536
353553
  "lib/code/compile.ts"() {
353537
- "use strict";
353538
353554
  import_sucrase = __toESM(require_dist2());
353539
353555
  init_source2();
353540
353556
  init_source2();
@@ -360419,6 +360435,13 @@ var init_cell_text = __esm({
360419
360435
  }
360420
360436
  });
360421
360437
 
360438
+ // lib/document/resize-children.ts
360439
+ var init_resize_children = __esm({
360440
+ "lib/document/resize-children.ts"() {
360441
+ init_scale_geometry();
360442
+ }
360443
+ });
360444
+
360422
360445
  // lib/editor/pointer/move/snap.ts
360423
360446
  var init_snap = __esm({
360424
360447
  "lib/editor/pointer/move/snap.ts"() {
@@ -360430,6 +360453,7 @@ var init_snap = __esm({
360430
360453
  // lib/editor/pointer/move/group-resize.ts
360431
360454
  var init_group_resize = __esm({
360432
360455
  "lib/editor/pointer/move/group-resize.ts"() {
360456
+ init_resize_children();
360433
360457
  init_scene_graph();
360434
360458
  init_selection_bounds();
360435
360459
  init_snap();
@@ -409114,8 +409138,8 @@ var init_editor_store = __esm({
409114
409138
  let cosmetic = true;
409115
409139
  const touched = [];
409116
409140
  for (const u of updates) {
409117
- const lockOnly = Object.keys(u.props).every((k2) => k2 === "locked");
409118
- if (!lockOnly && isLocked(document2, u.id)) continue;
409141
+ const housekeeping = Object.keys(u.props).every((k2) => k2 === "locked" || k2 === "visible" || k2 === "name");
409142
+ if (!housekeeping && isLocked(document2, u.id)) continue;
409119
409143
  let props = u.props;
409120
409144
  if ("rotation" in props && !canRotate(document2, u.id)) {
409121
409145
  const { rotation: _dropped, ...rest } = props;
@@ -410280,8 +410304,12 @@ var init_editor_store = __esm({
410280
410304
  group2.width = maxX - minX;
410281
410305
  group2.height = maxY - minY;
410282
410306
  group2.name = "Group";
410307
+ const siblings = state.document.nodes[parentId]?.childIds ?? [];
410308
+ const ordered2 = [...state.selection].sort((a, b) => siblings.indexOf(a) - siblings.indexOf(b));
410309
+ const top = Math.max(...ordered2.map((id3) => siblings.indexOf(id3)));
410283
410310
  let doc2 = addNode(state.document, group2, parentId);
410284
- state.selection.forEach((id3) => {
410311
+ if (top >= 0) doc2 = reparentNode(doc2, group2.id, parentId, top + 1);
410312
+ ordered2.forEach((id3) => {
410285
410313
  doc2 = reparentNode(doc2, id3, group2.id);
410286
410314
  const child = doc2.nodes[id3];
410287
410315
  if (child) {
@@ -414420,7 +414448,7 @@ init_resources();
414420
414448
  init_desktop();
414421
414449
  init_hypery();
414422
414450
  import { createInterface } from "node:readline";
414423
- var VERSION2 = "0.53.13";
414451
+ var VERSION2 = "0.53.15";
414424
414452
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
414425
414453
 
414426
414454
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.53.13",
3
+ "version": "0.53.15",
4
4
  "description": "The PopCraft command line: edit .popcraft files headlessly, call the REST API, publish to the marketplace and manage the desktop app's local plugins, themes, fonts, skills and agents.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://popcraft.app/docs/api/cli",
@@ -34,7 +34,7 @@
34
34
  "esbuild": "0.28.2"
35
35
  },
36
36
  "dependencies": {
37
- "@popcraft/kit": "0.53.13"
37
+ "@popcraft/kit": "0.53.15"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",