@popcraft/cli 0.3.0 → 0.4.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 +41 -27
  2. package/package.json +2 -2
package/dist/popcraft.mjs CHANGED
@@ -85218,7 +85218,6 @@ function repairDocumentPaints(doc2) {
85218
85218
  var broken;
85219
85219
  var init_paint_repair = __esm({
85220
85220
  "lib/document/paint-repair.ts"() {
85221
- "use strict";
85222
85221
  init_shader_graph();
85223
85222
  broken = (p2) => {
85224
85223
  if (!p2 || typeof p2 !== "object") return false;
@@ -87154,6 +87153,7 @@ function isAutoLayout(node2) {
87154
87153
  }
87155
87154
  var init_auto_layout = __esm({
87156
87155
  "lib/document/auto-layout.ts"() {
87156
+ "use strict";
87157
87157
  init_instance_layout();
87158
87158
  setLayoutEngine(applyAutoLayout);
87159
87159
  }
@@ -89958,6 +89958,7 @@ 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";
89961
89962
  init_node_delta();
89962
89963
  init_instances();
89963
89964
  init_scene_graph();
@@ -234410,6 +234411,7 @@ function repairCompositions(comps, nodes) {
234410
234411
  var isObj5, finite6, optFinite, isVec2, TIMELINE_COLOR_IDS, TIMELINE_COLORS, UNITS, ORDERS, PROP_KEYS, ANIMATOR_ID, MOTION_TYPES, TRANSITIONS, isFraction, MEDIA_HASH;
234411
234412
  var init_invariants = __esm({
234412
234413
  "lib/motion/invariants.ts"() {
234414
+ "use strict";
234413
234415
  init_easing();
234414
234416
  init_properties();
234415
234417
  init_markers();
@@ -238934,6 +238936,7 @@ function resizeWindow(doc2, target2, rect) {
238934
238936
  }
238935
238937
  var init_crop = __esm({
238936
238938
  "lib/editor/crop.ts"() {
238939
+ "use strict";
238937
238940
  init_dist_node();
238938
238941
  init_scene_graph();
238939
238942
  init_photo_frames();
@@ -258922,6 +258925,7 @@ function facetsOf(meta3) {
258922
258925
  var TEMPLATE_CATEGORIES, FACET_KEYS;
258923
258926
  var init_vocabulary = __esm({
258924
258927
  "lib/templates/vocabulary.ts"() {
258928
+ "use strict";
258925
258929
  init_markers();
258926
258930
  init_groups();
258927
258931
  init_format();
@@ -258932,6 +258936,34 @@ var init_vocabulary = __esm({
258932
258936
  }
258933
258937
  });
258934
258938
 
258939
+ // lib/templates/upload.ts
258940
+ function templateUploadBody(t3, opts = {}) {
258941
+ const m = t3.meta;
258942
+ return {
258943
+ meta: {
258944
+ localId: m.id,
258945
+ name: m.name,
258946
+ description: m.description,
258947
+ kind: m.kind,
258948
+ category: m.category,
258949
+ tags: m.tags,
258950
+ sizes: t3.payload.variants.map((v) => v.sizeId),
258951
+ fonts: m.fonts,
258952
+ brandSlots: m.brandSlots,
258953
+ media: t3.payload.media,
258954
+ thumbnail: m.thumbnail,
258955
+ ...opts.workspaceId ? { workspaceId: opts.workspaceId } : {},
258956
+ ...facetsOf(m)
258957
+ },
258958
+ payload: t3.payload
258959
+ };
258960
+ }
258961
+ var init_upload = __esm({
258962
+ "lib/templates/upload.ts"() {
258963
+ init_vocabulary();
258964
+ }
258965
+ });
258966
+
258935
258967
  // lib/templates/card.ts
258936
258968
  var cardPayload, marketplaceTemplateCard;
258937
258969
  var init_card = __esm({
@@ -295215,25 +295247,7 @@ async function refreshCloudTemplates() {
295215
295247
  }
295216
295248
  }
295217
295249
  async function saveTemplateToCloud(t3, opts = {}) {
295218
- const m = t3.meta;
295219
- const body = {
295220
- meta: {
295221
- localId: m.id,
295222
- name: m.name,
295223
- description: m.description,
295224
- kind: m.kind,
295225
- category: m.category,
295226
- tags: m.tags,
295227
- sizes: t3.payload.variants.map((v) => v.sizeId),
295228
- fonts: m.fonts,
295229
- brandSlots: m.brandSlots,
295230
- media: t3.payload.media,
295231
- thumbnail: m.thumbnail,
295232
- workspaceId: opts.workspaceId,
295233
- ...facetsOf(m)
295234
- },
295235
- payload: t3.payload
295236
- };
295250
+ const body = templateUploadBody(t3, opts);
295237
295251
  const { template: template2 } = await api("/api/templates", { method: "POST", json: body });
295238
295252
  useCloudTemplates.setState((s) => ({ available: [template2, ...s.available.filter((x2) => x2.id !== template2.id)] }));
295239
295253
  return template2;
@@ -295297,7 +295311,7 @@ var init_templates = __esm({
295297
295311
  init_idb_keyval();
295298
295312
  init_api3();
295299
295313
  init_session();
295300
- init_vocabulary();
295314
+ init_upload();
295301
295315
  init_card();
295302
295316
  useCloudTemplates = create2(() => ({ available: [], loading: false, error: null, at: null }));
295303
295317
  CACHE_KEY = "popcraft-cloud-templates";
@@ -295418,6 +295432,7 @@ async function createFreshFileOrExplain(place3 = {}, seed2 = {}) {
295418
295432
  var online, goesLocal;
295419
295433
  var init_new_file = __esm({
295420
295434
  "lib/client/cloud/new-file.ts"() {
295435
+ "use strict";
295421
295436
  init_scene_graph();
295422
295437
  init_print_pages();
295423
295438
  init_page_presets();
@@ -295925,7 +295940,6 @@ function startCloudSync() {
295925
295940
  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;
295926
295941
  var init_sync2 = __esm({
295927
295942
  "lib/client/cloud/sync.ts"() {
295928
- "use strict";
295929
295943
  init_paint_repair();
295930
295944
  init_migrate();
295931
295945
  init_view();
@@ -315016,7 +315030,7 @@ var init_package = __esm({
315016
315030
  "packages/runtime/package.json"() {
315017
315031
  package_default = {
315018
315032
  name: "@popcraft/runtime",
315019
- version: "0.3.0",
315033
+ version: "0.4.0",
315020
315034
  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.",
315021
315035
  license: "MIT",
315022
315036
  homepage: "https://popcraft.app/docs/exporting/nextjs",
@@ -346732,7 +346746,7 @@ async function publishFiles(via, files, opts = {}) {
346732
346746
  }));
346733
346747
  return await via.manifest({ slug: opts.slug, files: manifest2, commit: true });
346734
346748
  }
346735
- var init_upload = __esm({
346749
+ var init_upload2 = __esm({
346736
346750
  "lib/sites/upload.ts"() {
346737
346751
  }
346738
346752
  });
@@ -346758,7 +346772,7 @@ var init_sites = __esm({
346758
346772
  "lib/client/cloud/sites.ts"() {
346759
346773
  "use strict";
346760
346774
  init_files();
346761
- init_upload();
346775
+ init_upload2();
346762
346776
  init_api3();
346763
346777
  siteStatus = (key5) => api(`/api/sites${key5 ? `/${key5}` : ""}?t=${Date.now()}`);
346764
346778
  setSiteVersion = (key5, version6) => api(`/api/sites/${key5}`, { method: "PATCH", json: { currentVersion: version6 } });
@@ -390813,7 +390827,7 @@ function operations(spec = openapi) {
390813
390827
  }
390814
390828
  async function call(target2, method, path, opts = {}) {
390815
390829
  const qs = new URLSearchParams(opts.query ?? {}).toString();
390816
- const headers = { "user-agent": `popcraft-cli/${"0.3.0"}`, ...opts.headers };
390830
+ const headers = { "user-agent": `popcraft-cli/${"0.4.0"}`, ...opts.headers };
390817
390831
  if (target2.token) headers.authorization = `Bearer ${target2.token}`;
390818
390832
  if (opts.contentType) headers["content-type"] = opts.contentType;
390819
390833
  try {
@@ -391773,7 +391787,7 @@ async function runPublish(root2, opts, target2, out) {
391773
391787
  // packages/cli/src/main.ts
391774
391788
  init_resources();
391775
391789
  init_hypery();
391776
- var VERSION2 = "0.3.0";
391790
+ var VERSION2 = "0.4.0";
391777
391791
  var HELP = `popcraft ${VERSION2} \u2014 the PopCraft command line
391778
391792
 
391779
391793
  Files (headless, on .popcraft files):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popcraft/cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.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.3.0"
37
+ "@popcraft/kit": "0.4.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node build.mjs",