@popcraft/cli 0.53.4 → 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.
- package/dist/popcraft.mjs +68 -10
- 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.
|
|
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: [] };
|
|
@@ -97576,6 +97577,7 @@ function relinkCopies(doc2, copies) {
|
|
|
97576
97577
|
var TEXT_PATH_SOURCE_TYPES, isPathSource;
|
|
97577
97578
|
var init_text_links = __esm({
|
|
97578
97579
|
"lib/document/text-links.ts"() {
|
|
97580
|
+
"use strict";
|
|
97579
97581
|
init_transform();
|
|
97580
97582
|
TEXT_PATH_SOURCE_TYPES = ["VECTOR", "ELLIPSE", "RECTANGLE", "POLYGON", "STAR", "LINE", "ARROW", "FRAME"];
|
|
97581
97583
|
isPathSource = (n) => !!n && TEXT_PATH_SOURCE_TYPES.includes(n.type);
|
|
@@ -248024,7 +248026,6 @@ function repairCompositions(comps, nodes) {
|
|
|
248024
248026
|
var isObj5, finite6, optFinite, isVec2, TIMELINE_COLOR_IDS, TIMELINE_COLORS, UNITS, ORDERS, PROP_KEYS, ANIMATOR_ID, MOTION_TYPES, TRANSITIONS, isFraction, MEDIA_HASH;
|
|
248025
248027
|
var init_invariants = __esm({
|
|
248026
248028
|
"lib/motion/invariants.ts"() {
|
|
248027
|
-
"use strict";
|
|
248028
248029
|
init_easing();
|
|
248029
248030
|
init_properties();
|
|
248030
248031
|
init_markers();
|
|
@@ -252659,6 +252660,7 @@ function resizeWindow(doc2, target2, rect) {
|
|
|
252659
252660
|
}
|
|
252660
252661
|
var init_crop = __esm({
|
|
252661
252662
|
"lib/editor/crop.ts"() {
|
|
252663
|
+
"use strict";
|
|
252662
252664
|
init_dist_node();
|
|
252663
252665
|
init_scene_graph();
|
|
252664
252666
|
init_photo_frames();
|
|
@@ -253122,6 +253124,7 @@ function getActiveRenderer() {
|
|
|
253122
253124
|
var active;
|
|
253123
253125
|
var init_renderer_registry = __esm({
|
|
253124
253126
|
"lib/engine/renderer-registry.ts"() {
|
|
253127
|
+
"use strict";
|
|
253125
253128
|
active = null;
|
|
253126
253129
|
}
|
|
253127
253130
|
});
|
|
@@ -256190,6 +256193,7 @@ fn shade(uv: vec2<f32>, res: vec2<f32>, tm: f32) -> vec4<f32> {
|
|
|
256190
256193
|
var SHADER_PRESETS, shaderPreset, legacyPresetOf, DEFAULT_SHADER_PRESET, DEFAULT_TEXTURE_PARAMS, f, vec4, NOISE_LIB;
|
|
256191
256194
|
var init_shader_presets = __esm({
|
|
256192
256195
|
"lib/engine/shader-presets.ts"() {
|
|
256196
|
+
"use strict";
|
|
256193
256197
|
init_shader_graph();
|
|
256194
256198
|
init_shader_graph_presets();
|
|
256195
256199
|
init_shader_presets_legacy();
|
|
@@ -256740,6 +256744,7 @@ function mergeFonts(fonts, incoming) {
|
|
|
256740
256744
|
var fontWeightOf, fontStyleOf, sameSlot, hashOf, documentFontHashes;
|
|
256741
256745
|
var init_document_fonts = __esm({
|
|
256742
256746
|
"lib/fonts/document-fonts.ts"() {
|
|
256747
|
+
"use strict";
|
|
256743
256748
|
init_media_store();
|
|
256744
256749
|
init_media_hash();
|
|
256745
256750
|
fontWeightOf = (f2) => f2.weight ?? 400;
|
|
@@ -258064,6 +258069,7 @@ function onTabMessage(fn) {
|
|
|
258064
258069
|
var EDITOR_HOME, localDocPath, cloudFilePath, CHANNEL2, channel2;
|
|
258065
258070
|
var init_tab_mode = __esm({
|
|
258066
258071
|
"lib/desktop/tab-mode.ts"() {
|
|
258072
|
+
"use strict";
|
|
258067
258073
|
EDITOR_HOME = "/home";
|
|
258068
258074
|
localDocPath = (docId) => `${EDITOR_HOME}?doc=${encodeURIComponent(docId)}`;
|
|
258069
258075
|
cloudFilePath = (key5) => `/pop/${encodeURIComponent(key5)}`;
|
|
@@ -260744,6 +260750,7 @@ function retuneShaderAudio(node2, fillId) {
|
|
|
260744
260750
|
}
|
|
260745
260751
|
var init_shader_audio = __esm({
|
|
260746
260752
|
"lib/motion/shader-audio.ts"() {
|
|
260753
|
+
"use strict";
|
|
260747
260754
|
init_shader_params();
|
|
260748
260755
|
init_modifier_edit();
|
|
260749
260756
|
init_keys();
|
|
@@ -262757,6 +262764,7 @@ function formatDate(date5, opts = { month: "short", day: "numeric", year: "numer
|
|
|
262757
262764
|
var cache5, nf;
|
|
262758
262765
|
var init_format = __esm({
|
|
262759
262766
|
"lib/i18n/format.ts"() {
|
|
262767
|
+
"use strict";
|
|
262760
262768
|
init_runtime();
|
|
262761
262769
|
cache5 = /* @__PURE__ */ new Map();
|
|
262762
262770
|
nf = (opts) => cached2("n", opts, (l) => new Intl.NumberFormat(l, opts));
|
|
@@ -262776,7 +262784,6 @@ function formatLimit(key5, max3) {
|
|
|
262776
262784
|
var formatBytes;
|
|
262777
262785
|
var init_limits2 = __esm({
|
|
262778
262786
|
"lib/billing/limits.ts"() {
|
|
262779
|
-
"use strict";
|
|
262780
262787
|
init_format();
|
|
262781
262788
|
init_plans();
|
|
262782
262789
|
formatBytes = formatFileSize;
|
|
@@ -263310,7 +263317,6 @@ function planEntryAction({ home }) {
|
|
|
263310
263317
|
var STORAGE_KEY2, useHyperyTeam, TEAM_PROMPT_ENABLED, TEAM_PROMPTED_KEY, PROMPTED_KEY, useTeamPrompt, started;
|
|
263311
263318
|
var init_team = __esm({
|
|
263312
263319
|
"lib/client/cloud/team.ts"() {
|
|
263313
|
-
"use strict";
|
|
263314
263320
|
init_esm();
|
|
263315
263321
|
init_api4();
|
|
263316
263322
|
init_session();
|
|
@@ -311774,7 +311780,6 @@ function startCloudSync() {
|
|
|
311774
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;
|
|
311775
311781
|
var init_sync2 = __esm({
|
|
311776
311782
|
"lib/client/cloud/sync.ts"() {
|
|
311777
|
-
"use strict";
|
|
311778
311783
|
init_paint_repair();
|
|
311779
311784
|
init_migrate();
|
|
311780
311785
|
init_view();
|
|
@@ -312383,6 +312388,7 @@ function creditLine(c2) {
|
|
|
312383
312388
|
var MAX_PHOTO_PAGE, MAX_PHOTO_QUERY, UUID, isPhotoId, photoImagePath;
|
|
312384
312389
|
var init_stock = __esm({
|
|
312385
312390
|
"lib/photos/stock.ts"() {
|
|
312391
|
+
"use strict";
|
|
312386
312392
|
MAX_PHOTO_PAGE = 12;
|
|
312387
312393
|
MAX_PHOTO_QUERY = 200;
|
|
312388
312394
|
UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -313044,6 +313050,7 @@ function applyTextPath(layout2, path, tp, rebase = true) {
|
|
|
313044
313050
|
var defaultCircleRadius, ownsPath, mapPoint;
|
|
313045
313051
|
var init_text_path = __esm({
|
|
313046
313052
|
"lib/engine/text/text-path.ts"() {
|
|
313053
|
+
"use strict";
|
|
313047
313054
|
init_scene_graph();
|
|
313048
313055
|
init_transform();
|
|
313049
313056
|
init_shape_to_path();
|
|
@@ -313161,6 +313168,7 @@ function areaBounds(rings) {
|
|
|
313161
313168
|
}
|
|
313162
313169
|
var init_text_area = __esm({
|
|
313163
313170
|
"lib/engine/text/text-area.ts"() {
|
|
313171
|
+
"use strict";
|
|
313164
313172
|
}
|
|
313165
313173
|
});
|
|
313166
313174
|
|
|
@@ -317505,6 +317513,7 @@ async function exportSettingFile(renderer, node2, setting, doc2, styles) {
|
|
|
317505
317513
|
var MIME, DEFAULT_EXPORT, exportSettingsOf;
|
|
317506
317514
|
var init_export = __esm({
|
|
317507
317515
|
"lib/io/export.ts"() {
|
|
317516
|
+
"use strict";
|
|
317508
317517
|
init_download();
|
|
317509
317518
|
init_scene_graph();
|
|
317510
317519
|
init_codecs();
|
|
@@ -317596,7 +317605,6 @@ async function selectionReferenceImages(doc2, selection, opts = {}) {
|
|
|
317596
317605
|
var FIT_QUALITIES, FIT_SCALES, blobToDataUrl;
|
|
317597
317606
|
var init_reference_images = __esm({
|
|
317598
317607
|
"lib/ai/reference-images.ts"() {
|
|
317599
|
-
"use strict";
|
|
317600
317608
|
init_export();
|
|
317601
317609
|
init_selection_bounds();
|
|
317602
317610
|
init_renderer_registry();
|
|
@@ -319349,7 +319357,7 @@ function normalizePaints(v, key5) {
|
|
|
319349
319357
|
return out;
|
|
319350
319358
|
});
|
|
319351
319359
|
}
|
|
319352
|
-
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;
|
|
319353
319361
|
var init_node = __esm({
|
|
319354
319362
|
"lib/commands/node.ts"() {
|
|
319355
319363
|
"use strict";
|
|
@@ -319361,6 +319369,7 @@ var init_node = __esm({
|
|
|
319361
319369
|
init_scene_graph();
|
|
319362
319370
|
init_types();
|
|
319363
319371
|
init_svg_import();
|
|
319372
|
+
init_print_pages();
|
|
319364
319373
|
init_errors();
|
|
319365
319374
|
init_scale_geometry();
|
|
319366
319375
|
init_plugin_shim();
|
|
@@ -320441,6 +320450,52 @@ var init_node = __esm({
|
|
|
320441
320450
|
return { summary: `Rotated ${plural2(ids2.length, "layer")}`, data: { ids: ids2 } };
|
|
320442
320451
|
}
|
|
320443
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
|
+
});
|
|
320444
320499
|
}
|
|
320445
320500
|
});
|
|
320446
320501
|
|
|
@@ -328745,7 +328800,7 @@ var init_package = __esm({
|
|
|
328745
328800
|
"packages/runtime/package.json"() {
|
|
328746
328801
|
package_default = {
|
|
328747
328802
|
name: "@popcraft/runtime",
|
|
328748
|
-
version: "0.53.
|
|
328803
|
+
version: "0.53.5",
|
|
328749
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.",
|
|
328750
328805
|
license: "MIT",
|
|
328751
328806
|
homepage: "https://popcraft.app/docs/exporting/nextjs",
|
|
@@ -401557,6 +401612,7 @@ function placeDesign(doc2, built, source3, size6, name2, at4) {
|
|
|
401557
401612
|
var DESIGN_NAMESPACES, DERIVED2, templateOfBuild;
|
|
401558
401613
|
var init_build3 = __esm({
|
|
401559
401614
|
"lib/agent/design-script/build.ts"() {
|
|
401615
|
+
"use strict";
|
|
401560
401616
|
init_hash();
|
|
401561
401617
|
init_scene_graph();
|
|
401562
401618
|
init_libraries();
|
|
@@ -401586,6 +401642,7 @@ function designFrameOf(doc2, id3) {
|
|
|
401586
401642
|
}
|
|
401587
401643
|
var init_locate = __esm({
|
|
401588
401644
|
"lib/agent/design-script/locate.ts"() {
|
|
401645
|
+
"use strict";
|
|
401589
401646
|
}
|
|
401590
401647
|
});
|
|
401591
401648
|
|
|
@@ -406842,6 +406899,7 @@ var init_builtin4 = __esm({
|
|
|
406842
406899
|
nodeRename,
|
|
406843
406900
|
nodeDuplicate,
|
|
406844
406901
|
nodeImportSvg,
|
|
406902
|
+
nodeMakePrintPage,
|
|
406845
406903
|
componentCreate,
|
|
406846
406904
|
componentCreateInstance,
|
|
406847
406905
|
styleCreate,
|
|
@@ -414332,7 +414390,7 @@ init_resources();
|
|
|
414332
414390
|
init_desktop();
|
|
414333
414391
|
init_hypery();
|
|
414334
414392
|
import { createInterface } from "node:readline";
|
|
414335
|
-
var VERSION2 = "0.53.
|
|
414393
|
+
var VERSION2 = "0.53.5";
|
|
414336
414394
|
var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
|
|
414337
414395
|
|
|
414338
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
|
+
"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.
|
|
37
|
+
"@popcraft/kit": "0.53.5"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "node build.mjs",
|