@popcraft/cli 0.38.5 → 0.38.6

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 +26 -18
  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.38.5"}`, ...opts.headers };
1199
+ const headers = { "user-agent": `popcraft-cli/${"0.38.6"}`, ...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 {
@@ -96510,6 +96510,7 @@ function releaseMediaMemory(hash3) {
96510
96510
  var key2, peaksKey, objectUrls, sourceKey, remoteResolver, MEDIA_FETCH_TIMEOUT_MS, SHIPPED_MEDIA_PATH, notShipped, MEDIA_SCHEME, isImageDataUrl, memory, pendingLoads, sourceAliases, PAINT_KEYS, URL_KEYS;
96511
96511
  var init_media_store = __esm({
96512
96512
  "lib/storage/media-store.ts"() {
96513
+ "use strict";
96513
96514
  init_media_types();
96514
96515
  init_idb();
96515
96516
  init_media_hash();
@@ -261984,13 +261985,16 @@ function storePlatform() {
261984
261985
  async function shareFileNatively(blob, name2, print2 = false) {
261985
261986
  const t3 = tauri();
261986
261987
  if (!t3 || storePlatform() !== "ios") return false;
261987
- try {
261988
- await t3.core.invoke("share_file", new Uint8Array(await blob.arrayBuffer()), { headers: { "x-name": encodeURIComponent(name2), "x-print": print2 ? "1" : "0" } });
261989
- return true;
261990
- } catch (e) {
261991
- console.warn("[share_file]", e);
261992
- return false;
261993
- }
261988
+ await t3.core.invoke("share_file", { name: name2, print: print2, data: await blobToBase64(blob) });
261989
+ return true;
261990
+ }
261991
+ function blobToBase64(blob) {
261992
+ return new Promise((resolve6, reject) => {
261993
+ const reader = new FileReader();
261994
+ reader.onload = () => resolve6(String(reader.result).slice(String(reader.result).indexOf(",") + 1));
261995
+ reader.onerror = () => reject(reader.error ?? new Error("Could not read the file"));
261996
+ reader.readAsDataURL(blob);
261997
+ });
261994
261998
  }
261995
261999
  function invoke(cmd, args2) {
261996
262000
  const t3 = tauri();
@@ -311073,7 +311077,6 @@ async function dispatchShaped(key5, options) {
311073
311077
  var onViolation;
311074
311078
  var init_dispatch = __esm({
311075
311079
  "lib/commands/dispatch.ts"() {
311076
- "use strict";
311077
311080
  init_errors();
311078
311081
  init_registry();
311079
311082
  init_confirm();
@@ -311233,9 +311236,12 @@ __export(download_exports, {
311233
311236
  downloadBlob: () => downloadBlob
311234
311237
  });
311235
311238
  function downloadBlob(blob, filename) {
311236
- void shareFileNatively(blob, filename).then((shared) => {
311237
- if (!shared) browserDownload(blob, filename);
311238
- });
311239
+ shareFileNatively(blob, filename).then(
311240
+ (shared) => {
311241
+ if (!shared) browserDownload(blob, filename);
311242
+ },
311243
+ (e) => console.error("[share_file]", e)
311244
+ );
311239
311245
  }
311240
311246
  function browserDownload(blob, filename) {
311241
311247
  const url4 = URL.createObjectURL(blob);
@@ -311249,6 +311255,7 @@ function browserDownload(blob, filename) {
311249
311255
  }
311250
311256
  var init_download = __esm({
311251
311257
  "lib/io/download.ts"() {
311258
+ "use strict";
311252
311259
  init_tauri();
311253
311260
  }
311254
311261
  });
@@ -312131,6 +312138,7 @@ function applyTextPath(layout2, path, tp, rebase = true) {
312131
312138
  var defaultCircleRadius, ownsPath, mapPoint;
312132
312139
  var init_text_path = __esm({
312133
312140
  "lib/engine/text/text-path.ts"() {
312141
+ "use strict";
312134
312142
  init_scene_graph();
312135
312143
  init_transform();
312136
312144
  init_shape_to_path();
@@ -312248,6 +312256,7 @@ function areaBounds(rings) {
312248
312256
  }
312249
312257
  var init_text_area = __esm({
312250
312258
  "lib/engine/text/text-area.ts"() {
312259
+ "use strict";
312251
312260
  }
312252
312261
  });
312253
312262
 
@@ -317033,6 +317042,7 @@ function videoPixelSize(resolution, aspect) {
317033
317042
  var VIDEO_ASPECTS, VIDEO_RESOLUTIONS, SEEDANCE_ASPECTS, range, VIDEO_MODELS, DEFAULT_VIDEO_MODEL, videoModel, VIDEO_LIMITS;
317034
317043
  var init_video_models = __esm({
317035
317044
  "lib/ai/video-models.ts"() {
317045
+ "use strict";
317036
317046
  VIDEO_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
317037
317047
  VIDEO_RESOLUTIONS = ["480p", "720p", "1080p"];
317038
317048
  SEEDANCE_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
@@ -327384,7 +327394,7 @@ var init_package = __esm({
327384
327394
  "packages/runtime/package.json"() {
327385
327395
  package_default = {
327386
327396
  name: "@popcraft/runtime",
327387
- version: "0.38.5",
327397
+ version: "0.38.6",
327388
327398
  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.",
327389
327399
  license: "MIT",
327390
327400
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -352092,6 +352102,7 @@ function compileModule(module2) {
352092
352102
  var import_sucrase, BUILT_IN, memo4;
352093
352103
  var init_compile2 = __esm({
352094
352104
  "lib/code/compile.ts"() {
352105
+ "use strict";
352095
352106
  import_sucrase = __toESM(require_dist2());
352096
352107
  init_source2();
352097
352108
  init_source2();
@@ -352169,6 +352180,7 @@ function hashOf2(text) {
352169
352180
  }
352170
352181
  var init_hash = __esm({
352171
352182
  "lib/code/hash.ts"() {
352183
+ "use strict";
352172
352184
  }
352173
352185
  });
352174
352186
 
@@ -361114,7 +361126,6 @@ var init_delete_current_file = __esm({
361114
361126
  var storeOpsSeam;
361115
361127
  var init_seams = __esm({
361116
361128
  "lib/commands/seams.ts"() {
361117
- "use strict";
361118
361129
  storeOpsSeam = (st) => ({
361119
361130
  booleanOperation: (op4) => st().booleanOperation(op4),
361120
361131
  flatten: () => st().flattenSelection(),
@@ -398190,7 +398201,6 @@ function record(source, namespaces, globals, limits) {
398190
398201
  var HELPER_NAMES;
398191
398202
  var init_helper_names = __esm({
398192
398203
  "lib/agent/design-script/helper-names.ts"() {
398193
- "use strict";
398194
398204
  HELPER_NAMES = ["draw", "marks", "fit", "motion", "captions", "overlays", "texture", "pointer", "windows", "devices", "type", "beat", "web", "social", "video", "site", "effects"];
398195
398205
  }
398196
398206
  });
@@ -398573,7 +398583,6 @@ function designRecorder() {
398573
398583
  var installed;
398574
398584
  var init_recorders = __esm({
398575
398585
  "lib/agent/design-script/recorders.ts"() {
398576
- "use strict";
398577
398586
  installed = null;
398578
398587
  }
398579
398588
  });
@@ -403407,7 +403416,6 @@ function registerBuiltinCommands() {
403407
403416
  var builtinCommands, uiOnlyCommands;
403408
403417
  var init_builtin4 = __esm({
403409
403418
  "lib/commands/builtin.ts"() {
403410
- "use strict";
403411
403419
  init_registry();
403412
403420
  init_node();
403413
403421
  init_node();
@@ -410985,7 +410993,7 @@ init_resources();
410985
410993
  init_desktop();
410986
410994
  init_hypery();
410987
410995
  import { createInterface } from "node:readline";
410988
- var VERSION2 = "0.38.5";
410996
+ var VERSION2 = "0.38.6";
410989
410997
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
410990
410998
 
410991
410999
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.38.5",
3
+ "version": "0.38.6",
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.38.5"
37
+ "@popcraft/kit": "0.38.6"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",