@popcraft/cli 0.23.2 → 0.24.0

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 +57 -22
  2. 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.23.2"}`, ...opts.headers };
1191
+ const headers = { "user-agent": `popcraft-cli/${"0.24.0"}`, ...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 {
@@ -34897,7 +34897,7 @@ var init_en2 = __esm({
34897
34897
  "planDialog.isOnThePlan": "{teamName} is on the {value} plan.",
34898
34898
  "planDialog.largestUpload": "Largest upload",
34899
34899
  "planDialog.loadingPlans": "Loading plans\u2026",
34900
- "planDialog.mediaStorage": "Media storage",
34900
+ "planDialog.mediaStorage": "Storage (media and websites)",
34901
34901
  "planDialog.mo": "mo",
34902
34902
  "planDialog.namedVersionsPerFile": "Named versions per file",
34903
34903
  "planDialog.noPlanFor": "No plan for {teamName}.",
@@ -34916,6 +34916,7 @@ var init_en2 = __esm({
34916
34916
  "planDialog.renews": "Renews",
34917
34917
  "planDialog.resumePlan": "Resume plan",
34918
34918
  "planDialog.signInAgain": "Sign in again",
34919
+ "planDialog.storageSites": "{size} of it is published websites",
34919
34920
  "planDialog.studioIsForTeamsSwitch": "Studio is for teams \u2014 it appears here for a team's files.",
34920
34921
  "planDialog.subscribe": "Subscribe",
34921
34922
  "planDialog.switchTeamsInTheAccount": "Your role in this team can't change its plan.",
@@ -35659,8 +35660,12 @@ var init_en2 = __esm({
35659
35660
  "shareImage.frameHint": "Drawn at 1200\xD7630 each time you publish. A 1200\xD7630 link-preview frame fits exactly; a frame of another shape is shown from its top.",
35660
35661
  "shareImage.frameOption": "{name} ({width}\xD7{height})",
35661
35662
  "shareImage.nothing": "There is nothing to draw: the page has no screens.",
35663
+ "shareImage.pageFrameHint": "Links to this page show this frame, drawn at 1200\xD7630 each time you publish.",
35664
+ "shareImage.pageSiteHint": "Links to this page show the site's share image.",
35665
+ "shareImage.pageTitle": "Page share image",
35662
35666
  "shareImage.preview": "Preview",
35663
35667
  "shareImage.previewAlt": "The picture a shared link to the site shows",
35668
+ "shareImage.sameAsSite": "Same as the site",
35664
35669
  "shareImage.title": "Share image",
35665
35670
  "shareImage.tooLarge": "That picture is over 1 MB: link previews may skip it.",
35666
35671
  "shareImage.upload": "Upload",
@@ -36629,6 +36634,10 @@ var init_en2 = __esm({
36629
36634
  "webExportDialog.format": "Format",
36630
36635
  "webExportDialog.pictures": "Pictures",
36631
36636
  "webExportDialog.separateFilesInAZip": "Separate files, in a zip",
36637
+ "webExportDialog.siteAddress": "Site address (optional)",
36638
+ "webExportDialog.siteAddressHint": "Where the site will be served from. Link previews need it: without it, the share image and page addresses are written from the site's root.",
36639
+ "webExportDialog.siteAddressInvalid": "Enter a full address, starting with https://",
36640
+ "webExportDialog.siteAddressPlaceholder": "https://example.com",
36632
36641
  "webExportDialog.someMailClientsRefuseEmbedded": "Some mail clients refuse embedded pictures. For a real send, export them as separate files and host them.",
36633
36642
  "webhooksDialog.active": "Active",
36634
36643
  "webhooksDialog.addAnEndpoint": "Add an endpoint",
@@ -246471,6 +246480,7 @@ function resyncText(doc2, ids2) {
246471
246480
  var isVirtualId;
246472
246481
  var init_invariants2 = __esm({
246473
246482
  "lib/document/invariants.ts"() {
246483
+ "use strict";
246474
246484
  init_auto_layout();
246475
246485
  init_scene_graph();
246476
246486
  init_text_bounds();
@@ -260684,7 +260694,7 @@ var init_plans = __esm({
260684
260694
  LIMIT_TEXT = {
260685
260695
  cloudDocuments: (n) => `${n} cloud file${n === 1 ? "" : "s"}`,
260686
260696
  pagesPerDocument: (n) => `${n} page${n === 1 ? "" : "s"} per file`,
260687
- storageBytes: (n) => `${formatLimit("storageBytes", n)} of media storage`,
260697
+ storageBytes: (n) => `${formatLimit("storageBytes", n)} of storage (media and published websites)`,
260688
260698
  maxUploadBytes: (n) => `uploads up to ${formatLimit("maxUploadBytes", n)}`,
260689
260699
  versionHistoryDays: (n) => `${formatLimit("versionHistoryDays", n)} of version history`,
260690
260700
  namedVersionsPerDocument: (n) => `${n} named version${n === 1 ? "" : "s"} per file`,
@@ -261022,6 +261032,7 @@ function planEntryAction({ home }) {
261022
261032
  var STORAGE_KEY2, useHyperyTeam, TEAM_PROMPT_ENABLED, TEAM_PROMPTED_KEY, PROMPTED_KEY, useTeamPrompt, started;
261023
261033
  var init_team = __esm({
261024
261034
  "lib/client/cloud/team.ts"() {
261035
+ "use strict";
261025
261036
  init_esm();
261026
261037
  init_api4();
261027
261038
  init_session();
@@ -309263,7 +309274,7 @@ function startCloudSync() {
309263
309274
  notice("View only \u2014 ask the owner for edit access");
309264
309275
  return;
309265
309276
  }
309266
- if (!activeLink || collab?.isApplyingRemote() || doc2.nodes === prev.nodes && doc2.compositions === prev.compositions) return;
309277
+ if (!activeLink || collab?.isApplyingRemote() || doc2.nodes === prev.nodes && doc2.compositions === prev.compositions && doc2.site === prev.site) return;
309267
309278
  let found = false;
309268
309279
  if (doc2.compositions !== prev.compositions) {
309269
309280
  for (const h of mediaHashes(doc2.compositions ?? {})) if (!uploaded.get(activeLink.key)?.has(h) && !pendingMedia.has(h)) {
@@ -309271,6 +309282,12 @@ function startCloudSync() {
309271
309282
  found = true;
309272
309283
  }
309273
309284
  }
309285
+ if (doc2.site !== prev.site) {
309286
+ for (const h of mediaHashes(doc2.site ?? {})) if (!uploaded.get(activeLink.key)?.has(h) && !pendingMedia.has(h)) {
309287
+ pendingMedia.add(h);
309288
+ found = true;
309289
+ }
309290
+ }
309274
309291
  for (const id3 in doc2.nodes) {
309275
309292
  const n = doc2.nodes[id3];
309276
309293
  if (prev.nodes[id3] === n) continue;
@@ -312706,19 +312723,26 @@ function textItems(node2, ctx2, raw = node2) {
312706
312723
  }
312707
312724
  const outlineCmds = (gs) => ctx2.textCurves ? glyphCmds(gs) : ringsCmds(glyphInstancesToRings(gs));
312708
312725
  const glyphRule = ctx2.textCurves ? "nonzero" : "evenodd";
312726
+ const outlineStroke = textOutlineStroke(resolved);
312727
+ const placeOutline = (outlineItems) => {
312728
+ if (!outlineStroke || !outlineItems.length) return;
312729
+ if (outlineStroke.behind) items.unshift(...outlineItems);
312730
+ else items.push(...outlineItems);
312731
+ };
312709
312732
  if (ctx2.glyphGroups && node2.textAnimators?.length) {
312710
312733
  const poser = textGlyphPoser(raw, resolved, layout2, -node2.width / 2, -node2.height / 2);
312711
312734
  const cx = node2.width / 2, cy = node2.height / 2;
312735
+ const localOf = (m) => m ? [m[0], m[1], m[2], m[3], m[4] + cx - (m[0] * cx + m[2] * cy), m[5] + cy - (m[1] * cx + m[3] * cy)] : IDENTITY;
312736
+ const nameOf = (g) => g.index !== void 0 ? String(resolved.characters?.[g.index] ?? "") : "";
312712
312737
  outline.forEach((g, i2) => {
312713
312738
  const cmds = outlineCmds([g]);
312714
312739
  if (!cmds.length) return;
312715
312740
  const pose = poser?.(g) ?? null;
312716
- const m = pose?.m;
312717
- const local = m ? [m[0], m[1], m[2], m[3], m[4] + cx - (m[0] * cx + m[2] * cy), m[5] + cy - (m[1] * cx + m[3] * cy)] : IDENTITY;
312741
+ const local = localOf(pose?.m);
312718
312742
  const [r, gg, b] = pose ? posedColor([color4.r, color4.g, color4.b, 1], { ...pose, alpha: 1 }) : [color4.r, color4.g, color4.b];
312719
312743
  items.push({
312720
312744
  t: "group",
312721
- name: g.index !== void 0 ? String(resolved.characters?.[g.index] ?? "") : "",
312745
+ name: nameOf(g),
312722
312746
  key: `g${g.index ?? `i${i2}`}`,
312723
312747
  local,
312724
312748
  opacity: pose?.alpha ?? 1,
@@ -312727,17 +312751,28 @@ function textItems(node2, ctx2, raw = node2) {
312727
312751
  children: [{ t: "path", cmds, fillRule: glyphRule, fills: [{ kind: "solid", color: { r, g: gg, b, a: color4.a ?? 1 }, alpha: alpha2 }], strokes: [] }]
312728
312752
  });
312729
312753
  });
312754
+ if (outlineStroke) placeOutline(layout2.instances.flatMap((g, i2) => {
312755
+ if (g.emoji) return [];
312756
+ const cmds = outlineCmds([g]);
312757
+ if (!cmds.length) return [];
312758
+ const pose = poser?.(g) ?? null;
312759
+ return [{
312760
+ t: "group",
312761
+ name: `${nameOf(g)} outline`,
312762
+ key: `o${g.index ?? `i${i2}`}`,
312763
+ local: localOf(pose?.m),
312764
+ opacity: pose?.alpha ?? 1,
312765
+ blend: "NORMAL",
312766
+ clip: null,
312767
+ children: [{ t: "path", cmds, fillRule: glyphRule, fills: [], strokes: [outlineStroke.stroke] }]
312768
+ }];
312769
+ }));
312730
312770
  } else {
312731
312771
  const cmds = outlineCmds(outline);
312732
312772
  if (cmds.length) items.push({ t: "path", cmds, fillRule: glyphRule, fills: [{ kind: "solid", color: color4, alpha: alpha2 }], strokes: [] });
312733
- }
312734
- const outlineStroke = textOutlineStroke(resolved);
312735
- if (outlineStroke) {
312736
- const cmds = outlineCmds(layout2.instances.filter((g) => !g.emoji));
312737
- if (cmds.length) {
312738
- const item = { t: "path", cmds, fillRule: glyphRule, fills: [], strokes: [outlineStroke.stroke] };
312739
- if (outlineStroke.behind) items.unshift(item);
312740
- else items.push(item);
312773
+ if (outlineStroke) {
312774
+ const strokeCmds = outlineCmds(layout2.instances.filter((g) => !g.emoji));
312775
+ if (strokeCmds.length) placeOutline([{ t: "path", cmds: strokeCmds, fillRule: glyphRule, fills: [], strokes: [outlineStroke.stroke] }]);
312741
312776
  }
312742
312777
  }
312743
312778
  for (const dec of layout2.decorations || []) {
@@ -315440,7 +315475,6 @@ function videoPixelSize(resolution, aspect) {
315440
315475
  var VIDEO_ASPECTS, VIDEO_RESOLUTIONS, SEEDANCE_ASPECTS, range, VIDEO_MODELS, DEFAULT_VIDEO_MODEL, videoModel, VIDEO_LIMITS;
315441
315476
  var init_video_models = __esm({
315442
315477
  "lib/ai/video-models.ts"() {
315443
- "use strict";
315444
315478
  VIDEO_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
315445
315479
  VIDEO_RESOLUTIONS = ["480p", "720p", "1080p"];
315446
315480
  SEEDANCE_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
@@ -325778,7 +325812,7 @@ var init_package = __esm({
325778
325812
  "packages/runtime/package.json"() {
325779
325813
  package_default = {
325780
325814
  name: "@popcraft/runtime",
325781
- version: "0.23.2",
325815
+ version: "0.24.0",
325782
325816
  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.",
325783
325817
  license: "MIT",
325784
325818
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -351398,7 +351432,7 @@ function shareFrameOf(doc2, site, choice) {
351398
351432
  const home = site.pages.find((p2) => p2.id === site.home) ?? site.pages.find((p2) => !p2.notFound) ?? site.pages[0];
351399
351433
  return home ? home.screen ?? home.id : null;
351400
351434
  }
351401
- async function drawFrame(doc2, frameId) {
351435
+ async function drawShareFrame(doc2, frameId) {
351402
351436
  const [{ getActiveRenderer: getActiveRenderer2 }, { encodeImageData: encodeImageData2 }, { documentForExport: documentForExport2 }] = await Promise.all([
351403
351437
  Promise.resolve().then(() => (init_renderer_registry(), renderer_registry_exports)),
351404
351438
  Promise.resolve().then(() => (init_export(), export_exports)),
@@ -351434,7 +351468,7 @@ async function shareImageFiles(doc2, site, under = "") {
351434
351468
  }
351435
351469
  if (!site.share) {
351436
351470
  const frameId = shareFrameOf(doc2, site, choice);
351437
- const drawn = frameId ? await drawFrame(doc2, frameId) : null;
351471
+ const drawn = frameId ? await drawShareFrame(doc2, frameId) : null;
351438
351472
  if (drawn) {
351439
351473
  const path = `${SHARE_DIR}og.${drawn.ext}`;
351440
351474
  files.push({ path: under + path, content: drawn.bytes });
@@ -351446,7 +351480,7 @@ async function shareImageFiles(doc2, site, under = "") {
351446
351480
  const own2 = doc2.nodes[page.screen ?? page.id]?.route?.shareImage;
351447
351481
  if (!own2 || !doc2.nodes[own2]) continue;
351448
351482
  if (!drawnFor.has(own2)) {
351449
- const drawn = await drawFrame(doc2, own2);
351483
+ const drawn = await drawShareFrame(doc2, own2);
351450
351484
  const path2 = drawn ? `${SHARE_DIR}${own2.replace(/[^\w-]/g, "_")}.${drawn.ext}` : null;
351451
351485
  if (drawn && path2) files.push({ path: under + path2, content: drawn.bytes });
351452
351486
  drawnFor.set(own2, path2);
@@ -351500,6 +351534,7 @@ __export(project_exports, {
351500
351534
  appAssetPaths: () => appAssetPaths,
351501
351535
  bytesOf: () => bytesOf,
351502
351536
  completeSite: () => completeSite,
351537
+ drawShareFrame: () => drawShareFrame,
351503
351538
  externalizeBitmaps: () => externalizeBitmaps,
351504
351539
  nextFilesOf: () => nextFilesOf,
351505
351540
  nextProjectFiles: () => nextProjectFiles,
@@ -396248,6 +396283,7 @@ function designRecorder() {
396248
396283
  var installed;
396249
396284
  var init_recorders = __esm({
396250
396285
  "lib/agent/design-script/recorders.ts"() {
396286
+ "use strict";
396251
396287
  installed = null;
396252
396288
  }
396253
396289
  });
@@ -401054,7 +401090,6 @@ function registerBuiltinCommands() {
401054
401090
  var builtinCommands, uiOnlyCommands;
401055
401091
  var init_builtin4 = __esm({
401056
401092
  "lib/commands/builtin.ts"() {
401057
- "use strict";
401058
401093
  init_registry();
401059
401094
  init_node();
401060
401095
  init_node();
@@ -408551,7 +408586,7 @@ init_resources();
408551
408586
  init_desktop();
408552
408587
  init_hypery();
408553
408588
  import { createInterface } from "node:readline";
408554
- var VERSION2 = "0.23.2";
408589
+ var VERSION2 = "0.24.0";
408555
408590
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
408556
408591
 
408557
408592
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.23.2",
3
+ "version": "0.24.0",
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.23.2"
37
+ "@popcraft/kit": "0.24.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",