@popcraft/cli 0.53.3 → 0.53.5

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 +62 -11
  2. package/package.json +2 -2
package/dist/popcraft.mjs CHANGED
@@ -1196,7 +1196,7 @@ function operations(spec = openapi) {
1196
1196
  }
1197
1197
  async function call(target2, method, path, opts = {}) {
1198
1198
  const qs = new URLSearchParams(opts.query ?? {}).toString();
1199
- const headers = { "user-agent": `popcraft-cli/${"0.53.3"}`, ...opts.headers };
1199
+ const headers = { "user-agent": `popcraft-cli/${"0.53.5"}`, ...opts.headers };
1200
1200
  if (target2.token) headers.authorization = `Bearer ${target2.token}`;
1201
1201
  if (opts.contentType) headers["content-type"] = opts.contentType;
1202
1202
  try {
@@ -32761,6 +32761,7 @@ var init_en2 = __esm({
32761
32761
  "command:node.flip#vertical": "Flip vertical",
32762
32762
  "command:node.group": "Group selection",
32763
32763
  "command:node.importSvg": "Import SVG",
32764
+ "command:node.makePrintPage": "Make print page",
32764
32765
  "command:node.order": "Order",
32765
32766
  "command:node.order#bottom": "Send to back",
32766
32767
  "command:node.order#down": "Send backward",
@@ -97321,7 +97322,7 @@ function detachInstances(nodes, ids2) {
97321
97322
  if (!inst || inst.type !== "INSTANCE" || !inst.mainComponentId || !nodes[inst.mainComponentId]) continue;
97322
97323
  const into = out ??= { ...nodes };
97323
97324
  const copy2 = (vid, parentId) => {
97324
- const drawn = resolveVirtualNode2(nodes, vid);
97325
+ const drawn = resolveVirtualNode2(nodes, vid, { layout: false });
97325
97326
  if (!drawn) return null;
97326
97327
  const newId3 = copyId(id3, vid);
97327
97328
  const node2 = { ...drawn, id: newId3, parentId, childIds: [] };
@@ -248025,7 +248026,6 @@ function repairCompositions(comps, nodes) {
248025
248026
  var isObj5, finite6, optFinite, isVec2, TIMELINE_COLOR_IDS, TIMELINE_COLORS, UNITS, ORDERS, PROP_KEYS, ANIMATOR_ID, MOTION_TYPES, TRANSITIONS, isFraction, MEDIA_HASH;
248026
248027
  var init_invariants = __esm({
248027
248028
  "lib/motion/invariants.ts"() {
248028
- "use strict";
248029
248029
  init_easing();
248030
248030
  init_properties();
248031
248031
  init_markers();
@@ -248122,7 +248122,6 @@ function resyncText(doc2, ids2) {
248122
248122
  var isVirtualId;
248123
248123
  var init_invariants2 = __esm({
248124
248124
  "lib/document/invariants.ts"() {
248125
- "use strict";
248126
248125
  init_auto_layout();
248127
248126
  init_scene_graph();
248128
248127
  init_text_bounds();
@@ -252661,6 +252660,7 @@ function resizeWindow(doc2, target2, rect) {
252661
252660
  }
252662
252661
  var init_crop = __esm({
252663
252662
  "lib/editor/crop.ts"() {
252663
+ "use strict";
252664
252664
  init_dist_node();
252665
252665
  init_scene_graph();
252666
252666
  init_photo_frames();
@@ -256744,6 +256744,7 @@ function mergeFonts(fonts, incoming) {
256744
256744
  var fontWeightOf, fontStyleOf, sameSlot, hashOf, documentFontHashes;
256745
256745
  var init_document_fonts = __esm({
256746
256746
  "lib/fonts/document-fonts.ts"() {
256747
+ "use strict";
256747
256748
  init_media_store();
256748
256749
  init_media_hash();
256749
256750
  fontWeightOf = (f2) => f2.weight ?? 400;
@@ -256889,6 +256890,7 @@ var init_apply2 = __esm({
256889
256890
  var HYPERY_CLIENT_ID, HYPERY_GATEWAY_URL, HYPERY_AI_SCOPES, plansEnabled, HYPERY_BILLING_SCOPES, HYPERY_AUDIO_SCOPES, HYPERY_SCOPES, cloudEnabled;
256890
256891
  var init_config2 = __esm({
256891
256892
  "lib/client/cloud/config.ts"() {
256893
+ "use strict";
256892
256894
  HYPERY_CLIENT_ID = process.env.NEXT_PUBLIC_HYPERY_CLIENT_ID ?? "";
256893
256895
  HYPERY_GATEWAY_URL = process.env.NEXT_PUBLIC_HYPERY_GATEWAY_URL ?? "https://hypery.ai";
256894
256896
  HYPERY_AI_SCOPES = ["ai:chat", "ai:completions", "ai:models", "ai:images"];
@@ -260748,6 +260750,7 @@ function retuneShaderAudio(node2, fillId) {
260748
260750
  }
260749
260751
  var init_shader_audio = __esm({
260750
260752
  "lib/motion/shader-audio.ts"() {
260753
+ "use strict";
260751
260754
  init_shader_params();
260752
260755
  init_modifier_edit();
260753
260756
  init_keys();
@@ -262781,7 +262784,6 @@ function formatLimit(key5, max3) {
262781
262784
  var formatBytes;
262782
262785
  var init_limits2 = __esm({
262783
262786
  "lib/billing/limits.ts"() {
262784
- "use strict";
262785
262787
  init_format();
262786
262788
  init_plans();
262787
262789
  formatBytes = formatFileSize;
@@ -263315,7 +263317,6 @@ function planEntryAction({ home }) {
263315
263317
  var STORAGE_KEY2, useHyperyTeam, TEAM_PROMPT_ENABLED, TEAM_PROMPTED_KEY, PROMPTED_KEY, useTeamPrompt, started;
263316
263318
  var init_team = __esm({
263317
263319
  "lib/client/cloud/team.ts"() {
263318
- "use strict";
263319
263320
  init_esm();
263320
263321
  init_api4();
263321
263322
  init_session();
@@ -311779,7 +311780,6 @@ function startCloudSync() {
311779
311780
  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;
311780
311781
  var init_sync2 = __esm({
311781
311782
  "lib/client/cloud/sync.ts"() {
311782
- "use strict";
311783
311783
  init_paint_repair();
311784
311784
  init_migrate();
311785
311785
  init_view();
@@ -313050,6 +313050,7 @@ function applyTextPath(layout2, path, tp, rebase = true) {
313050
313050
  var defaultCircleRadius, ownsPath, mapPoint;
313051
313051
  var init_text_path = __esm({
313052
313052
  "lib/engine/text/text-path.ts"() {
313053
+ "use strict";
313053
313054
  init_scene_graph();
313054
313055
  init_transform();
313055
313056
  init_shape_to_path();
@@ -313167,6 +313168,7 @@ function areaBounds(rings) {
313167
313168
  }
313168
313169
  var init_text_area = __esm({
313169
313170
  "lib/engine/text/text-area.ts"() {
313171
+ "use strict";
313170
313172
  }
313171
313173
  });
313172
313174
 
@@ -317511,6 +317513,7 @@ async function exportSettingFile(renderer, node2, setting, doc2, styles) {
317511
317513
  var MIME, DEFAULT_EXPORT, exportSettingsOf;
317512
317514
  var init_export = __esm({
317513
317515
  "lib/io/export.ts"() {
317516
+ "use strict";
317514
317517
  init_download();
317515
317518
  init_scene_graph();
317516
317519
  init_codecs();
@@ -317602,7 +317605,6 @@ async function selectionReferenceImages(doc2, selection, opts = {}) {
317602
317605
  var FIT_QUALITIES, FIT_SCALES, blobToDataUrl;
317603
317606
  var init_reference_images = __esm({
317604
317607
  "lib/ai/reference-images.ts"() {
317605
- "use strict";
317606
317608
  init_export();
317607
317609
  init_selection_bounds();
317608
317610
  init_renderer_registry();
@@ -318445,6 +318447,7 @@ function agentToolList() {
318445
318447
  var AGENT_CAPABILITIES, legacyCommandId, legacyTools, blobToDataUrl3, provided, legacyTool, legacyToolList;
318446
318448
  var init_agent = __esm({
318447
318449
  "lib/commands/agent.ts"() {
318450
+ "use strict";
318448
318451
  init_types5();
318449
318452
  init_registry();
318450
318453
  init_errors();
@@ -319354,7 +319357,7 @@ function normalizePaints(v, key5) {
319354
319357
  return out;
319355
319358
  });
319356
319359
  }
319357
- var nodeFind, nodeGet, nodeMeasure, docOutline, CREATABLE, nodeCreate, FORBIDDEN_PROPS, nodeUpdate, nodeDelete, nodeMove, nodeResize, nodeReparent, nodeGroup, nodeUngroup, nodeOrder, nodeAlign, nodeDistribute, nodeRename, nodeDuplicate, nodeImportSvg, nodeApplyAutoLayout, nodeSetLock, nodeSetVisibility, nodeFlip, nodeRotate;
319360
+ var nodeFind, nodeGet, nodeMeasure, docOutline, CREATABLE, nodeCreate, FORBIDDEN_PROPS, nodeUpdate, nodeDelete, nodeMove, nodeResize, nodeReparent, nodeGroup, nodeUngroup, nodeOrder, nodeAlign, nodeDistribute, nodeRename, nodeDuplicate, nodeImportSvg, nodeApplyAutoLayout, nodeSetLock, nodeSetVisibility, nodeFlip, nodeRotate, nodeMakePrintPage;
319358
319361
  var init_node = __esm({
319359
319362
  "lib/commands/node.ts"() {
319360
319363
  "use strict";
@@ -319366,6 +319369,7 @@ var init_node = __esm({
319366
319369
  init_scene_graph();
319367
319370
  init_types();
319368
319371
  init_svg_import();
319372
+ init_print_pages();
319369
319373
  init_errors();
319370
319374
  init_scale_geometry();
319371
319375
  init_plugin_shim();
@@ -320446,6 +320450,52 @@ var init_node = __esm({
320446
320450
  return { summary: `Rotated ${plural2(ids2.length, "layer")}`, data: { ids: ids2 } };
320447
320451
  }
320448
320452
  });
320453
+ nodeMakePrintPage = defineCommand({
320454
+ id: "node.makePrintPage",
320455
+ title: "Make print page",
320456
+ domain: "node",
320457
+ effect: "document",
320458
+ permission: "write",
320459
+ undoLabel: "Make print page",
320460
+ params: external_exports.object({ ids: external_exports.array(external_exports.string()).max(MAX_NODES).optional() }),
320461
+ expose: {
320462
+ ui: { label: "Make print page", keywords: ["print", "page", "sheet", "make page", "add page", "colophon"], enabled: needsSelection(1) },
320463
+ agent: {
320464
+ name: "make_print_page",
320465
+ description: "Turn top-level layers into print pages, so they are part of the printed document \u2014 numbered in Print \xB7 pages and included in export/PDF. A FRAME becomes a print page in place; anything else (an instance of a shared colophon, a group, an image) is wrapped in a page-sized print frame. An instance stays linked to its library, so the page both prints AND keeps syncing. New pages are added at the end of the sequence; use reorder_pages or move_nodes to place them. Defaults to the selection."
320466
+ }
320467
+ },
320468
+ run: (args2, ctx2) => {
320469
+ const { doc: doc2, ids: ids2 } = resolveTargets(ctx2, args2.ids, "make_print_page");
320470
+ const pageId2 = ctx2.pageId();
320471
+ let next2 = doc2;
320472
+ const made = [];
320473
+ for (const id3 of ids2) {
320474
+ const n = next2.nodes[id3];
320475
+ if (!n) continue;
320476
+ if (n.parentId !== pageId2) throw new ToolError(`"${n.name}" is not a top-level layer on this page; only top-level layers can become print pages.`);
320477
+ if (isPrintPage(n)) continue;
320478
+ if (n.type === "FRAME" && !n.print?.isMaster) {
320479
+ next2 = updateNode(next2, id3, { print: { isPrintPage: true, index: listPrintPages(next2, pageId2).length } });
320480
+ made.push(id3);
320481
+ } else {
320482
+ const frame3 = createPrintPage(next2, pageId2, { name: n.name });
320483
+ frame3.width = n.width;
320484
+ frame3.height = n.height;
320485
+ next2 = addNode(next2, frame3, pageId2);
320486
+ next2 = reparentNode(next2, id3, frame3.id);
320487
+ next2 = updateNode(next2, id3, { x: 0, y: 0 });
320488
+ made.push(frame3.id);
320489
+ }
320490
+ }
320491
+ if (!made.length) throw new ToolError("Those layers are already print pages.");
320492
+ const patches = placePrintPages(next2, pageId2);
320493
+ for (const pid in patches) next2 = updateNode(next2, pid, patches[pid]);
320494
+ ctx2.commit(applyInvariants(next2, [...made, ...Object.keys(patches)]));
320495
+ ctx2.setSelection(made);
320496
+ return { summary: `Made ${plural2(made.length, "print page", "print pages")}`, data: { ids: made } };
320497
+ }
320498
+ });
320449
320499
  }
320450
320500
  });
320451
320501
 
@@ -328750,7 +328800,7 @@ var init_package = __esm({
328750
328800
  "packages/runtime/package.json"() {
328751
328801
  package_default = {
328752
328802
  name: "@popcraft/runtime",
328753
- version: "0.53.3",
328803
+ version: "0.53.5",
328754
328804
  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.",
328755
328805
  license: "MIT",
328756
328806
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -406849,6 +406899,7 @@ var init_builtin4 = __esm({
406849
406899
  nodeRename,
406850
406900
  nodeDuplicate,
406851
406901
  nodeImportSvg,
406902
+ nodeMakePrintPage,
406852
406903
  componentCreate,
406853
406904
  componentCreateInstance,
406854
406905
  styleCreate,
@@ -414339,7 +414390,7 @@ init_resources();
414339
414390
  init_desktop();
414340
414391
  init_hypery();
414341
414392
  import { createInterface } from "node:readline";
414342
- var VERSION2 = "0.53.3";
414393
+ var VERSION2 = "0.53.5";
414343
414394
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
414344
414395
 
414345
414396
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.53.3",
3
+ "version": "0.53.5",
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.3"
37
+ "@popcraft/kit": "0.53.5"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",