@popcraft/cli 0.2.0 → 0.3.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 +19 -8
  2. package/package.json +2 -2
package/dist/popcraft.mjs CHANGED
@@ -85218,6 +85218,7 @@ function repairDocumentPaints(doc2) {
85218
85218
  var broken;
85219
85219
  var init_paint_repair = __esm({
85220
85220
  "lib/document/paint-repair.ts"() {
85221
+ "use strict";
85221
85222
  init_shader_graph();
85222
85223
  broken = (p2) => {
85223
85224
  if (!p2 || typeof p2 !== "object") return false;
@@ -87153,7 +87154,6 @@ function isAutoLayout(node2) {
87153
87154
  }
87154
87155
  var init_auto_layout = __esm({
87155
87156
  "lib/document/auto-layout.ts"() {
87156
- "use strict";
87157
87157
  init_instance_layout();
87158
87158
  setLayoutEngine(applyAutoLayout);
87159
87159
  }
@@ -89958,7 +89958,6 @@ function layerInputPatch(node2, name2, path) {
89958
89958
  var NO_RUNTIME, MAX_DEPTH, freshIndex, indexOf, isComponentLike, selfStarting, startedAt, endMemo, HOST_OWNS, rootTracksMemo, layerMemo, idle;
89959
89959
  var init_instances2 = __esm({
89960
89960
  "lib/motion/instances.ts"() {
89961
- "use strict";
89962
89961
  init_node_delta();
89963
89962
  init_instances();
89964
89963
  init_scene_graph();
@@ -234411,7 +234410,6 @@ function repairCompositions(comps, nodes) {
234411
234410
  var isObj5, finite6, optFinite, isVec2, TIMELINE_COLOR_IDS, TIMELINE_COLORS, UNITS, ORDERS, PROP_KEYS, ANIMATOR_ID, MOTION_TYPES, TRANSITIONS, isFraction, MEDIA_HASH;
234412
234411
  var init_invariants = __esm({
234413
234412
  "lib/motion/invariants.ts"() {
234414
- "use strict";
234415
234413
  init_easing();
234416
234414
  init_properties();
234417
234415
  init_markers();
@@ -238936,7 +238934,6 @@ function resizeWindow(doc2, target2, rect) {
238936
238934
  }
238937
238935
  var init_crop = __esm({
238938
238936
  "lib/editor/crop.ts"() {
238939
- "use strict";
238940
238937
  init_dist_node();
238941
238938
  init_scene_graph();
238942
238939
  init_photo_frames();
@@ -258877,6 +258874,7 @@ function loadEntitlements(workspaceId, opts = {}) {
258877
258874
  var import_react3, TTL_MS, cache6, lastResolved, cachedLimits;
258878
258875
  var init_entitlements = __esm({
258879
258876
  "lib/client/cloud/entitlements.ts"() {
258877
+ "use strict";
258880
258878
  import_react3 = __toESM(require_react());
258881
258879
  init_api3();
258882
258880
  init_config2();
@@ -295282,6 +295280,7 @@ async function searchTemplates(o = {}) {
295282
295280
  if (o.category) sp.set("category", o.category);
295283
295281
  if (o.animated) sp.set("animated", "1");
295284
295282
  if (o.scope) sp.set("scope", o.scope);
295283
+ if (o.sort) sp.set("sort", o.sort);
295285
295284
  if (o.cursor) sp.set("cursor", o.cursor);
295286
295285
  if (o.limit) sp.set("limit", String(o.limit));
295287
295286
  return api(`/api/templates?${sp}`);
@@ -295394,7 +295393,14 @@ async function createNewCloudFile(place3 = {}, seed2 = {}) {
295394
295393
  return { ok: true, key: key5, docId: doc2.id, name: doc2.name, path: cloudFilePath(key5) };
295395
295394
  }
295396
295395
  async function createNewFile(place3 = {}, seed2 = {}) {
295397
- return goesLocal() ? createNewLocalFile(seed2) : createNewCloudFile(place3, seed2);
295396
+ const result = await (goesLocal() ? createNewLocalFile(seed2) : createNewCloudFile(place3, seed2));
295397
+ const used = seed2.templateId ?? seed2.template?.meta.id;
295398
+ if (result.ok && !(result.local && result.reused) && used) countTemplateUse(used);
295399
+ return result;
295400
+ }
295401
+ function countTemplateUse(id3) {
295402
+ void Promise.resolve().then(() => (init_api3(), api_exports)).then(({ api: api3 }) => api3(`/api/templates/${encodeURIComponent(id3)}/installs`, { method: "POST" })).catch(() => {
295403
+ });
295398
295404
  }
295399
295405
  async function createNewFileOrExplain(place3 = {}, seed2 = {}) {
295400
295406
  const result = await createNewFile(place3, seed2);
@@ -295919,6 +295925,7 @@ function startCloudSync() {
295919
295925
  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, putThumbnail, openingFiles, mediaHealed, started;
295920
295926
  var init_sync2 = __esm({
295921
295927
  "lib/client/cloud/sync.ts"() {
295928
+ "use strict";
295922
295929
  init_paint_repair();
295923
295930
  init_migrate();
295924
295931
  init_view();
@@ -313989,6 +313996,7 @@ popcraftMount(document.querySelector('[data-pc="0"]'), ${JSON.stringify(spec)});
313989
313996
  var routeFile, routeUp, bytesOf;
313990
313997
  var init_files = __esm({
313991
313998
  "lib/io/web/project/files.ts"() {
313999
+ "use strict";
313992
314000
  routeFile = (route2) => route2 === "/" ? "index.html" : `${route2.replace(/^\//, "")}/index.html`;
313993
314001
  routeUp = (route2) => route2 === "/" ? "" : "../".repeat(route2.replace(/^\//, "").split("/").length);
313994
314002
  bytesOf = (f2) => typeof f2.content === "string" ? new TextEncoder().encode(f2.content) : f2.content;
@@ -315008,7 +315016,7 @@ var init_package = __esm({
315008
315016
  "packages/runtime/package.json"() {
315009
315017
  package_default = {
315010
315018
  name: "@popcraft/runtime",
315011
- version: "0.2.0",
315019
+ version: "0.3.0",
315012
315020
  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.",
315013
315021
  license: "MIT",
315014
315022
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -339861,6 +339869,7 @@ function fieldPart(nodes, id3) {
339861
339869
  var cleanName2;
339862
339870
  var init_controls = __esm({
339863
339871
  "lib/document/controls.ts"() {
339872
+ "use strict";
339864
339873
  cleanName2 = (raw) => raw.trim().replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
339865
339874
  }
339866
339875
  });
@@ -340804,6 +340813,7 @@ function routesOf(screens) {
340804
340813
  var slug2;
340805
340814
  var init_routes = __esm({
340806
340815
  "lib/document/routes.ts"() {
340816
+ "use strict";
340807
340817
  slug2 = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
340808
340818
  }
340809
340819
  });
@@ -346746,6 +346756,7 @@ function publishSite(key5, files, opts = {}) {
346746
346756
  var siteStatus, setSiteVersion, renameSite;
346747
346757
  var init_sites = __esm({
346748
346758
  "lib/client/cloud/sites.ts"() {
346759
+ "use strict";
346749
346760
  init_files();
346750
346761
  init_upload();
346751
346762
  init_api3();
@@ -390802,7 +390813,7 @@ function operations(spec = openapi) {
390802
390813
  }
390803
390814
  async function call(target2, method, path, opts = {}) {
390804
390815
  const qs = new URLSearchParams(opts.query ?? {}).toString();
390805
- const headers = { "user-agent": `popcraft-cli/${"0.2.0"}`, ...opts.headers };
390816
+ const headers = { "user-agent": `popcraft-cli/${"0.3.0"}`, ...opts.headers };
390806
390817
  if (target2.token) headers.authorization = `Bearer ${target2.token}`;
390807
390818
  if (opts.contentType) headers["content-type"] = opts.contentType;
390808
390819
  try {
@@ -391762,7 +391773,7 @@ async function runPublish(root2, opts, target2, out) {
391762
391773
  // packages/cli/src/main.ts
391763
391774
  init_resources();
391764
391775
  init_hypery();
391765
- var VERSION2 = "0.2.0";
391776
+ var VERSION2 = "0.3.0";
391766
391777
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
391767
391778
 
391768
391779
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.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.2.0"
37
+ "@popcraft/kit": "0.3.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",