@popcraft/cli 0.38.4 → 0.38.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.
Files changed (2) hide show
  1. package/dist/popcraft.mjs +20 -10
  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.4"}`, ...opts.headers };
1199
+ const headers = { "user-agent": `popcraft-cli/${"0.38.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 {
@@ -261981,6 +261981,17 @@ function storePlatform() {
261981
261981
  if (/Android/.test(navigator.userAgent)) return "android";
261982
261982
  return null;
261983
261983
  }
261984
+ async function shareFileNatively(blob, name2, print2 = false) {
261985
+ const t3 = tauri();
261986
+ 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
+ }
261994
+ }
261984
261995
  function invoke(cmd, args2) {
261985
261996
  const t3 = tauri();
261986
261997
  return t3 ? t3.core.invoke(cmd, args2) : Promise.reject(new Error("Not running in the desktop app"));
@@ -311222,6 +311233,11 @@ __export(download_exports, {
311222
311233
  downloadBlob: () => downloadBlob
311223
311234
  });
311224
311235
  function downloadBlob(blob, filename) {
311236
+ void shareFileNatively(blob, filename).then((shared) => {
311237
+ if (!shared) browserDownload(blob, filename);
311238
+ });
311239
+ }
311240
+ function browserDownload(blob, filename) {
311225
311241
  const url4 = URL.createObjectURL(blob);
311226
311242
  const a = window.document.createElement("a");
311227
311243
  a.href = url4;
@@ -311233,7 +311249,7 @@ function downloadBlob(blob, filename) {
311233
311249
  }
311234
311250
  var init_download = __esm({
311235
311251
  "lib/io/download.ts"() {
311236
- "use strict";
311252
+ init_tauri();
311237
311253
  }
311238
311254
  });
311239
311255
 
@@ -312115,7 +312131,6 @@ function applyTextPath(layout2, path, tp, rebase = true) {
312115
312131
  var defaultCircleRadius, ownsPath, mapPoint;
312116
312132
  var init_text_path = __esm({
312117
312133
  "lib/engine/text/text-path.ts"() {
312118
- "use strict";
312119
312134
  init_scene_graph();
312120
312135
  init_transform();
312121
312136
  init_shape_to_path();
@@ -312233,7 +312248,6 @@ function areaBounds(rings) {
312233
312248
  }
312234
312249
  var init_text_area = __esm({
312235
312250
  "lib/engine/text/text-area.ts"() {
312236
- "use strict";
312237
312251
  }
312238
312252
  });
312239
312253
 
@@ -317019,7 +317033,6 @@ function videoPixelSize(resolution, aspect) {
317019
317033
  var VIDEO_ASPECTS, VIDEO_RESOLUTIONS, SEEDANCE_ASPECTS, range, VIDEO_MODELS, DEFAULT_VIDEO_MODEL, videoModel, VIDEO_LIMITS;
317020
317034
  var init_video_models = __esm({
317021
317035
  "lib/ai/video-models.ts"() {
317022
- "use strict";
317023
317036
  VIDEO_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
317024
317037
  VIDEO_RESOLUTIONS = ["480p", "720p", "1080p"];
317025
317038
  SEEDANCE_ASPECTS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
@@ -327371,7 +327384,7 @@ var init_package = __esm({
327371
327384
  "packages/runtime/package.json"() {
327372
327385
  package_default = {
327373
327386
  name: "@popcraft/runtime",
327374
- version: "0.38.4",
327387
+ version: "0.38.5",
327375
327388
  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.",
327376
327389
  license: "MIT",
327377
327390
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -352037,7 +352050,6 @@ function exportsOf(source3) {
352037
352050
  var CODE_LIMITS, packageOf;
352038
352051
  var init_source2 = __esm({
352039
352052
  "lib/code/source.ts"() {
352040
- "use strict";
352041
352053
  CODE_LIMITS = { modules: 100, sourceLength: 2e5, packages: 12 };
352042
352054
  packageOf = (spec) => spec.split("/").slice(0, spec.startsWith("@") ? 2 : 1).join("/");
352043
352055
  }
@@ -352080,7 +352092,6 @@ function compileModule(module2) {
352080
352092
  var import_sucrase, BUILT_IN, memo4;
352081
352093
  var init_compile2 = __esm({
352082
352094
  "lib/code/compile.ts"() {
352083
- "use strict";
352084
352095
  import_sucrase = __toESM(require_dist2());
352085
352096
  init_source2();
352086
352097
  init_source2();
@@ -352158,7 +352169,6 @@ function hashOf2(text) {
352158
352169
  }
352159
352170
  var init_hash = __esm({
352160
352171
  "lib/code/hash.ts"() {
352161
- "use strict";
352162
352172
  }
352163
352173
  });
352164
352174
 
@@ -410975,7 +410985,7 @@ init_resources();
410975
410985
  init_desktop();
410976
410986
  init_hypery();
410977
410987
  import { createInterface } from "node:readline";
410978
- var VERSION2 = "0.38.4";
410988
+ var VERSION2 = "0.38.5";
410979
410989
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
410980
410990
 
410981
410991
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.38.4",
3
+ "version": "0.38.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.38.4"
37
+ "@popcraft/kit": "0.38.5"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",