@popcraft/cli 0.53.5 → 0.53.7
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 +26 -20
- 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.7"}`, ...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 {
|
|
@@ -94510,6 +94510,7 @@ function hasMessage(key5) {
|
|
|
94510
94510
|
var current2, loading, listeners, formats, asts;
|
|
94511
94511
|
var init_runtime = __esm({
|
|
94512
94512
|
"lib/i18n/runtime.ts"() {
|
|
94513
|
+
"use strict";
|
|
94513
94514
|
init_intl_messageformat();
|
|
94514
94515
|
init_icu_messageformat_parser();
|
|
94515
94516
|
init_catalogs();
|
|
@@ -96212,6 +96213,7 @@ function repairDocumentPaints(doc2) {
|
|
|
96212
96213
|
var broken;
|
|
96213
96214
|
var init_paint_repair = __esm({
|
|
96214
96215
|
"lib/document/paint-repair.ts"() {
|
|
96216
|
+
"use strict";
|
|
96215
96217
|
init_shader_graph();
|
|
96216
96218
|
broken = (p2) => {
|
|
96217
96219
|
if (!p2 || typeof p2 !== "object") return false;
|
|
@@ -252660,7 +252662,6 @@ function resizeWindow(doc2, target2, rect) {
|
|
|
252660
252662
|
}
|
|
252661
252663
|
var init_crop = __esm({
|
|
252662
252664
|
"lib/editor/crop.ts"() {
|
|
252663
|
-
"use strict";
|
|
252664
252665
|
init_dist_node();
|
|
252665
252666
|
init_scene_graph();
|
|
252666
252667
|
init_photo_frames();
|
|
@@ -256193,7 +256194,6 @@ fn shade(uv: vec2<f32>, res: vec2<f32>, tm: f32) -> vec4<f32> {
|
|
|
256193
256194
|
var SHADER_PRESETS, shaderPreset, legacyPresetOf, DEFAULT_SHADER_PRESET, DEFAULT_TEXTURE_PARAMS, f, vec4, NOISE_LIB;
|
|
256194
256195
|
var init_shader_presets = __esm({
|
|
256195
256196
|
"lib/engine/shader-presets.ts"() {
|
|
256196
|
-
"use strict";
|
|
256197
256197
|
init_shader_graph();
|
|
256198
256198
|
init_shader_graph_presets();
|
|
256199
256199
|
init_shader_presets_legacy();
|
|
@@ -262784,6 +262784,7 @@ function formatLimit(key5, max3) {
|
|
|
262784
262784
|
var formatBytes;
|
|
262785
262785
|
var init_limits2 = __esm({
|
|
262786
262786
|
"lib/billing/limits.ts"() {
|
|
262787
|
+
"use strict";
|
|
262787
262788
|
init_format();
|
|
262788
262789
|
init_plans();
|
|
262789
262790
|
formatBytes = formatFileSize;
|
|
@@ -263317,6 +263318,7 @@ function planEntryAction({ home }) {
|
|
|
263317
263318
|
var STORAGE_KEY2, useHyperyTeam, TEAM_PROMPT_ENABLED, TEAM_PROMPTED_KEY, PROMPTED_KEY, useTeamPrompt, started;
|
|
263318
263319
|
var init_team = __esm({
|
|
263319
263320
|
"lib/client/cloud/team.ts"() {
|
|
263321
|
+
"use strict";
|
|
263320
263322
|
init_esm();
|
|
263321
263323
|
init_api4();
|
|
263322
263324
|
init_session();
|
|
@@ -311780,6 +311782,7 @@ function startCloudSync() {
|
|
|
311780
311782
|
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;
|
|
311781
311783
|
var init_sync2 = __esm({
|
|
311782
311784
|
"lib/client/cloud/sync.ts"() {
|
|
311785
|
+
"use strict";
|
|
311783
311786
|
init_paint_repair();
|
|
311784
311787
|
init_migrate();
|
|
311785
311788
|
init_view();
|
|
@@ -317142,15 +317145,14 @@ function paperFill(root2, doc2) {
|
|
|
317142
317145
|
const f2 = fills.length ? fills[fills.length - 1] : void 0;
|
|
317143
317146
|
return f2 && f2.type === "SOLID" && f2.color ? { kind: "solid", color: f2.color, alpha: (f2.opacity ?? 1) * (f2.color.a ?? 1) } : null;
|
|
317144
317147
|
};
|
|
317145
|
-
const
|
|
317146
|
-
|
|
317147
|
-
|
|
317148
|
-
const c2 = doc2.nodes[id3];
|
|
317148
|
+
const ids2 = root2.childIds ?? [];
|
|
317149
|
+
for (let i2 = ids2.length - 1; i2 >= 0; i2--) {
|
|
317150
|
+
const c2 = doc2.nodes[ids2[i2]];
|
|
317149
317151
|
if (!c2 || !c2.visible || c2.x > 0.5 || c2.y > 0.5 || c2.x + c2.width < root2.width - 0.5 || c2.y + c2.height < root2.height - 0.5) continue;
|
|
317150
317152
|
const f2 = solid5(c2);
|
|
317151
317153
|
if (f2 && f2.alpha >= 0.999) return f2;
|
|
317152
317154
|
}
|
|
317153
|
-
return
|
|
317155
|
+
return solid5(root2);
|
|
317154
317156
|
}
|
|
317155
317157
|
function pageBox(node2, doc2, opts) {
|
|
317156
317158
|
const bounds2 = getWorldRenderBounds(doc2, node2.id);
|
|
@@ -317264,20 +317266,21 @@ async function exportNodesToPDF(renderer, nodes, scaleOrOpts, doc2, styles) {
|
|
|
317264
317266
|
for (const sl of slots2) {
|
|
317265
317267
|
const vp = sl.page;
|
|
317266
317268
|
const node2 = roots[vp.index];
|
|
317267
|
-
const
|
|
317269
|
+
const bleedOut = single ? Math.max(geo.bleed.maxX - geo.trim.maxX, geo.trim.minX - geo.bleed.minX, geo.bleed.maxY - geo.trim.maxY, geo.trim.minY - geo.bleed.minY) : 0;
|
|
317270
|
+
const ir = buildExportIR(bleedOut > 0 ? { ...node2, clipsContent: false } : node2, ctx2);
|
|
317268
317271
|
if (!ir) continue;
|
|
317269
317272
|
const m = sl.matrix;
|
|
317270
317273
|
const s2 = vp.scale;
|
|
317274
|
+
const ox = vp.offset.x - bleedOut * s2, oy = vp.offset.y - bleedOut * s2;
|
|
317271
317275
|
const place4 = [
|
|
317272
317276
|
m[0] * s2,
|
|
317273
317277
|
m[1] * s2,
|
|
317274
317278
|
m[2] * s2,
|
|
317275
317279
|
m[3] * s2,
|
|
317276
|
-
m[4] + m[0] *
|
|
317277
|
-
m[5] + m[1] *
|
|
317280
|
+
m[4] + m[0] * ox + m[2] * oy,
|
|
317281
|
+
m[5] + m[1] * ox + m[3] * oy
|
|
317278
317282
|
];
|
|
317279
317283
|
const inner = { t: "group", name: "page", local: [1, 0, 0, 1, -node2.x - vp.crop.x, -node2.y - vp.crop.y], opacity: 1, blend: "NORMAL", clip: null, children: [ir] };
|
|
317280
|
-
const bleedOut = single ? Math.max(geo.bleed.maxX - geo.trim.maxX, geo.trim.minX - geo.bleed.minX, geo.bleed.maxY - geo.trim.maxY, geo.trim.minY - geo.bleed.minY) : 0;
|
|
317281
317284
|
cb.emit({
|
|
317282
317285
|
t: "group",
|
|
317283
317286
|
name: "slot",
|
|
@@ -328800,7 +328803,7 @@ var init_package = __esm({
|
|
|
328800
328803
|
"packages/runtime/package.json"() {
|
|
328801
328804
|
package_default = {
|
|
328802
328805
|
name: "@popcraft/runtime",
|
|
328803
|
-
version: "0.53.
|
|
328806
|
+
version: "0.53.7",
|
|
328804
328807
|
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.",
|
|
328805
328808
|
license: "MIT",
|
|
328806
328809
|
homepage: "https://popcraft.app/docs/exporting/nextjs",
|
|
@@ -353466,6 +353469,7 @@ function exportsOf(source3) {
|
|
|
353466
353469
|
var CODE_LIMITS, packageOf;
|
|
353467
353470
|
var init_source2 = __esm({
|
|
353468
353471
|
"lib/code/source.ts"() {
|
|
353472
|
+
"use strict";
|
|
353469
353473
|
CODE_LIMITS = { modules: 100, sourceLength: 2e5, packages: 12 };
|
|
353470
353474
|
packageOf = (spec) => spec.split("/").slice(0, spec.startsWith("@") ? 2 : 1).join("/");
|
|
353471
353475
|
}
|
|
@@ -353508,6 +353512,7 @@ function compileModule(module2) {
|
|
|
353508
353512
|
var import_sucrase, BUILT_IN, memo4;
|
|
353509
353513
|
var init_compile2 = __esm({
|
|
353510
353514
|
"lib/code/compile.ts"() {
|
|
353515
|
+
"use strict";
|
|
353511
353516
|
import_sucrase = __toESM(require_dist2());
|
|
353512
353517
|
init_source2();
|
|
353513
353518
|
init_source2();
|
|
@@ -399236,7 +399241,7 @@ async function runPlugin(pluginId, commandId, opts = {}) {
|
|
|
399236
399241
|
downloadBlob(new Blob([file2.bytes], { type: file2.mimeType || "application/octet-stream" }), name2);
|
|
399237
399242
|
return { name: name2, byteLength: file2.bytes.byteLength };
|
|
399238
399243
|
},
|
|
399239
|
-
exportNode: async (nodes, format, scale) => {
|
|
399244
|
+
exportNode: async (nodes, format, scale, bleed) => {
|
|
399240
399245
|
const renderer = getActiveRenderer();
|
|
399241
399246
|
if (!renderer) throw new Error("Renderer is not ready");
|
|
399242
399247
|
const st = useEditorStore.getState();
|
|
@@ -399245,7 +399250,7 @@ async function runPlugin(pluginId, commandId, opts = {}) {
|
|
|
399245
399250
|
const { exportNodesToPDF: exportNodesToPDF2 } = await Promise.resolve().then(() => (init_pdf(), pdf_exports));
|
|
399246
399251
|
const { jobPageSize: jobPageSize2 } = await Promise.resolve().then(() => (init_print_pages(), print_pages_exports));
|
|
399247
399252
|
const { loadFullBleed: loadFullBleed2 } = await Promise.resolve().then(() => (init_print_prefs(), print_prefs_exports));
|
|
399248
|
-
const blob2 = await exportNodesToPDF2(renderer, nodes, { dpi: 300, bleed: !loadFullBleed2(), marks: false, splitSpreads: true, pageSize: jobPageSize2(st.document) }, st.document, st.document.styles);
|
|
399253
|
+
const blob2 = await exportNodesToPDF2(renderer, nodes, { dpi: 300, bleed: bleed ?? !loadFullBleed2(), marks: false, splitSpreads: true, pageSize: jobPageSize2(st.document) }, st.document, st.document.styles);
|
|
399249
399254
|
if (!blob2) throw new Error("PDF export failed");
|
|
399250
399255
|
return new Uint8Array(await blob2.arrayBuffer());
|
|
399251
399256
|
}
|
|
@@ -399632,7 +399637,10 @@ var init_plugin = __esm({
|
|
|
399632
399637
|
format: external_exports.unknown().transform((v) => String(v ?? "PNG").toUpperCase()).refine((f2) => f2 in MIME2, { error: (iss) => `Unsupported format ${String(iss.input)}` }).optional(),
|
|
399633
399638
|
// Clamped, not rejected: the legacy switch clamped, and a plugin asking for scale 20 should get
|
|
399634
399639
|
// an 8× image rather than an exception it never handled.
|
|
399635
|
-
scale: external_exports.unknown().transform((v) => Math.max(0.1, Math.min(8, Number(v) || 1))).optional()
|
|
399640
|
+
scale: external_exports.unknown().transform((v) => Math.max(0.1, Math.min(8, Number(v) || 1))).optional(),
|
|
399641
|
+
// PDF only. true: 0.125 in of bleed outside the trim, what a commercial printer needs. false: the
|
|
399642
|
+
// page is the trim. Left out, it follows the person's Print setting.
|
|
399643
|
+
bleed: external_exports.boolean().optional()
|
|
399636
399644
|
}).optional()
|
|
399637
399645
|
}),
|
|
399638
399646
|
effect: "none",
|
|
@@ -399654,7 +399662,7 @@ var init_plugin = __esm({
|
|
|
399654
399662
|
if (nodes.length > 1 && format !== "PDF") {
|
|
399655
399663
|
throw new PluginApiError("Several nodes can only be exported as one PDF", "invalid_params");
|
|
399656
399664
|
}
|
|
399657
|
-
const data = await env.effects.exportNode(nodes, format, p2.options?.scale ?? 1);
|
|
399665
|
+
const data = await env.effects.exportNode(nodes, format, p2.options?.scale ?? 1, p2.options?.bleed);
|
|
399658
399666
|
return { summary: nodes.length > 1 ? `Exported ${nodes.length} pages` : `Exported ${nodes[0].name ?? nodes[0].id}`, data };
|
|
399659
399667
|
}
|
|
399660
399668
|
}),
|
|
@@ -401612,7 +401620,6 @@ function placeDesign(doc2, built, source3, size6, name2, at4) {
|
|
|
401612
401620
|
var DESIGN_NAMESPACES, DERIVED2, templateOfBuild;
|
|
401613
401621
|
var init_build3 = __esm({
|
|
401614
401622
|
"lib/agent/design-script/build.ts"() {
|
|
401615
|
-
"use strict";
|
|
401616
401623
|
init_hash();
|
|
401617
401624
|
init_scene_graph();
|
|
401618
401625
|
init_libraries();
|
|
@@ -401642,7 +401649,6 @@ function designFrameOf(doc2, id3) {
|
|
|
401642
401649
|
}
|
|
401643
401650
|
var init_locate = __esm({
|
|
401644
401651
|
"lib/agent/design-script/locate.ts"() {
|
|
401645
|
-
"use strict";
|
|
401646
401652
|
}
|
|
401647
401653
|
});
|
|
401648
401654
|
|
|
@@ -414390,7 +414396,7 @@ init_resources();
|
|
|
414390
414396
|
init_desktop();
|
|
414391
414397
|
init_hypery();
|
|
414392
414398
|
import { createInterface } from "node:readline";
|
|
414393
|
-
var VERSION2 = "0.53.
|
|
414399
|
+
var VERSION2 = "0.53.7";
|
|
414394
414400
|
var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
|
|
414395
414401
|
|
|
414396
414402
|
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.7",
|
|
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.7"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "node build.mjs",
|