@popcraft/cli 0.32.0 → 0.32.1
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 +41 -9
- package/package.json +2 -2
package/dist/popcraft.mjs
CHANGED
|
@@ -1188,7 +1188,7 @@ function operations(spec = openapi) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
async function call(target2, method, path, opts = {}) {
|
|
1190
1190
|
const qs = new URLSearchParams(opts.query ?? {}).toString();
|
|
1191
|
-
const headers = { "user-agent": `popcraft-cli/${"0.32.
|
|
1191
|
+
const headers = { "user-agent": `popcraft-cli/${"0.32.1"}`, ...opts.headers };
|
|
1192
1192
|
if (target2.token) headers.authorization = `Bearer ${target2.token}`;
|
|
1193
1193
|
if (opts.contentType) headers["content-type"] = opts.contentType;
|
|
1194
1194
|
try {
|
|
@@ -3872,7 +3872,6 @@ function paramLabel(name2) {
|
|
|
3872
3872
|
var AUDIO_SIGNAL_NAMES, XY, XYZ, RGB, RGBA, LAYOUT, TYPE_NAMES, roundUp, IDENT2, WHITE, numbers, MAX_SHADER_CHARS, reflections, isNum, EMPTY, packed, defaults;
|
|
3873
3873
|
var init_shader_params = __esm({
|
|
3874
3874
|
"lib/document/shader-params.ts"() {
|
|
3875
|
-
"use strict";
|
|
3876
3875
|
AUDIO_SIGNAL_NAMES = ["level", "bass", "mid", "treble", "beat", "onset", "spectrum"];
|
|
3877
3876
|
XY = ["x", "y"];
|
|
3878
3877
|
XYZ = ["x", "y", "z"];
|
|
@@ -6737,6 +6736,7 @@ __export(print_pages_exports, {
|
|
|
6737
6736
|
listMasterPages: () => listMasterPages,
|
|
6738
6737
|
listPrintPages: () => listPrintPages,
|
|
6739
6738
|
pagePosition: () => pagePosition,
|
|
6739
|
+
pagePositions: () => pagePositions,
|
|
6740
6740
|
placePrintPages: () => placePrintPages,
|
|
6741
6741
|
printPageOf: () => printPageOf,
|
|
6742
6742
|
reorderPrintPages: () => reorderPrintPages,
|
|
@@ -6814,6 +6814,36 @@ function pagePosition(index2, size6, facing) {
|
|
|
6814
6814
|
const right = index2 % 2 === 0;
|
|
6815
6815
|
return { x: right ? size6.width : 0, y: spread2 * (size6.height + gutter(size6.width)) };
|
|
6816
6816
|
}
|
|
6817
|
+
function pagePositions(sizes, page, facing) {
|
|
6818
|
+
if (!facing) {
|
|
6819
|
+
let x2 = 0;
|
|
6820
|
+
return sizes.map((s) => {
|
|
6821
|
+
const at4 = { x: x2, y: 0 };
|
|
6822
|
+
x2 += s.width + gutter(page.width);
|
|
6823
|
+
return at4;
|
|
6824
|
+
});
|
|
6825
|
+
}
|
|
6826
|
+
const row2 = page.height + gutter(page.width);
|
|
6827
|
+
let slot2 = 0;
|
|
6828
|
+
return sizes.map((s) => {
|
|
6829
|
+
if (isSpreadSheet(s.width, page)) {
|
|
6830
|
+
if (slot2 % 2 === 0) slot2++;
|
|
6831
|
+
const at5 = { x: 0, y: Math.ceil(slot2 / 2) * row2 };
|
|
6832
|
+
slot2 += 2;
|
|
6833
|
+
return at5;
|
|
6834
|
+
}
|
|
6835
|
+
const at4 = { x: slot2 % 2 === 0 ? page.width : 0, y: Math.ceil(slot2 / 2) * row2 };
|
|
6836
|
+
slot2++;
|
|
6837
|
+
return at4;
|
|
6838
|
+
});
|
|
6839
|
+
}
|
|
6840
|
+
function basePageSize(doc2, frames) {
|
|
6841
|
+
const preset = presetById(doc2.settings?.pageSize?.presetId);
|
|
6842
|
+
if (preset) return presetPx(preset);
|
|
6843
|
+
if (doc2.settings?.pageSize?.width && doc2.settings.pageSize.height) return { width: doc2.settings.pageSize.width, height: doc2.settings.pageSize.height };
|
|
6844
|
+
const first2 = frames[0];
|
|
6845
|
+
return first2 ? { width: first2.width, height: first2.height } : { width: 816, height: 1056 };
|
|
6846
|
+
}
|
|
6817
6847
|
function placePrintPages(doc2, pageId2) {
|
|
6818
6848
|
const patches = {};
|
|
6819
6849
|
const facing = doc2.settings?.facingPages;
|
|
@@ -6821,7 +6851,9 @@ function placePrintPages(doc2, pageId2) {
|
|
|
6821
6851
|
const p2 = at4(i2, f2);
|
|
6822
6852
|
if (f2.x !== p2.x || f2.y !== p2.y) patches[f2.id] = { ...patches[f2.id] ?? {}, ...p2 };
|
|
6823
6853
|
});
|
|
6824
|
-
|
|
6854
|
+
const pages2 = listPrintPages(doc2, pageId2);
|
|
6855
|
+
const positions = pagePositions(pages2, basePageSize(doc2, pages2), facing);
|
|
6856
|
+
place4(pages2, (i2) => positions[i2]);
|
|
6825
6857
|
place4(listMasterPages(doc2, pageId2), (i2, f2) => masterPosition(i2, f2));
|
|
6826
6858
|
return patches;
|
|
6827
6859
|
}
|
|
@@ -6842,7 +6874,7 @@ function createPrintPage(doc2, pageId2, opts = {}) {
|
|
|
6842
6874
|
const last3 = existing[existing.length - 1];
|
|
6843
6875
|
const frame2 = createFrame({
|
|
6844
6876
|
name: opts.name ?? `Page ${index2 + 1}`,
|
|
6845
|
-
...
|
|
6877
|
+
...pagePositions([...existing, size6], basePageSize(doc2, existing.length ? existing : [size6]), doc2.settings?.facingPages)[index2],
|
|
6846
6878
|
width: size6.width,
|
|
6847
6879
|
height: size6.height,
|
|
6848
6880
|
fills: [{ type: "SOLID", color: createColor(1, 1, 1), opacity: 1, visible: true }],
|
|
@@ -6950,7 +6982,7 @@ function documentFromPreset(name2, preset) {
|
|
|
6950
6982
|
if (guides.length) doc2.nodes[pageId2].guides = guides;
|
|
6951
6983
|
return doc2;
|
|
6952
6984
|
}
|
|
6953
|
-
var isFixedPageKind, isPrintPage, isMasterPage, ordered, edges, gutter, masterPosition, foldsOn, MASTER_NAMES;
|
|
6985
|
+
var isFixedPageKind, isPrintPage, isMasterPage, ordered, edges, gutter, isSpreadSheet, masterPosition, foldsOn, MASTER_NAMES;
|
|
6954
6986
|
var init_print_pages = __esm({
|
|
6955
6987
|
"lib/document/print-pages.ts"() {
|
|
6956
6988
|
"use strict";
|
|
@@ -6964,6 +6996,7 @@ var init_print_pages = __esm({
|
|
|
6964
6996
|
ordered = (frames) => frames.map((f2, i2) => ({ f: f2, i: i2 })).sort((a, b) => (a.f.print.index ?? Infinity) - (b.f.print.index ?? Infinity) || a.f.y - b.f.y || a.f.x - b.f.x || a.i - b.i).map((x2) => x2.f);
|
|
6965
6997
|
edges = (v) => ({ top: v, right: v, bottom: v, left: v });
|
|
6966
6998
|
gutter = (w) => Math.round(w * 0.15);
|
|
6999
|
+
isSpreadSheet = (w, page) => w > page.width * 1.5;
|
|
6967
7000
|
masterPosition = (index2, size6) => ({
|
|
6968
7001
|
x: index2 * (size6.width + gutter(size6.width)),
|
|
6969
7002
|
y: -(size6.height + 2 * gutter(size6.width))
|
|
@@ -310279,6 +310312,7 @@ function downloadBlob(blob, filename) {
|
|
|
310279
310312
|
}
|
|
310280
310313
|
var init_download = __esm({
|
|
310281
310314
|
"lib/io/download.ts"() {
|
|
310315
|
+
"use strict";
|
|
310282
310316
|
}
|
|
310283
310317
|
});
|
|
310284
310318
|
|
|
@@ -315622,7 +315656,6 @@ async function exportSettingFile(renderer, node2, setting, doc2, styles) {
|
|
|
315622
315656
|
var MIME, DEFAULT_EXPORT, exportSettingsOf;
|
|
315623
315657
|
var init_export = __esm({
|
|
315624
315658
|
"lib/io/export.ts"() {
|
|
315625
|
-
"use strict";
|
|
315626
315659
|
init_download();
|
|
315627
315660
|
init_scene_graph();
|
|
315628
315661
|
init_codecs();
|
|
@@ -326409,7 +326442,7 @@ var init_package = __esm({
|
|
|
326409
326442
|
"packages/runtime/package.json"() {
|
|
326410
326443
|
package_default = {
|
|
326411
326444
|
name: "@popcraft/runtime",
|
|
326412
|
-
version: "0.32.
|
|
326445
|
+
version: "0.32.1",
|
|
326413
326446
|
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.",
|
|
326414
326447
|
license: "MIT",
|
|
326415
326448
|
homepage: "https://popcraft.app/docs/exporting/nextjs",
|
|
@@ -397439,7 +397472,6 @@ function designRecorder() {
|
|
|
397439
397472
|
var installed;
|
|
397440
397473
|
var init_recorders = __esm({
|
|
397441
397474
|
"lib/agent/design-script/recorders.ts"() {
|
|
397442
|
-
"use strict";
|
|
397443
397475
|
installed = null;
|
|
397444
397476
|
}
|
|
397445
397477
|
});
|
|
@@ -409760,7 +409792,7 @@ init_resources();
|
|
|
409760
409792
|
init_desktop();
|
|
409761
409793
|
init_hypery();
|
|
409762
409794
|
import { createInterface } from "node:readline";
|
|
409763
|
-
var VERSION2 = "0.32.
|
|
409795
|
+
var VERSION2 = "0.32.1";
|
|
409764
409796
|
var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
|
|
409765
409797
|
|
|
409766
409798
|
Files (headless, on .popcraft files):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popcraft/cli",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.1",
|
|
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.32.
|
|
37
|
+
"@popcraft/kit": "0.32.1"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "node build.mjs",
|