@snowcone-app/sdk 0.30.0 → 0.31.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.
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-ATN2PYRL.js → chunk-KMDKCI4T.js} +1 -1
- package/dist/{chunk-5HX26XOJ.js → chunk-O6I5SJT5.js} +56 -4
- package/dist/index.cjs +57 -4
- package/dist/index.d.cts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +3 -2
- package/dist/react.cjs +44 -1
- package/dist/react.js +2 -2
- package/dist/server.cjs +44 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#5607](https://github.com/snowcone-app/snowcone-monorepo/pull/5607) [`6477622`](https://github.com/snowcone-app/snowcone-monorepo/commit/6477622b9a429a09aec41881db1ac1dd0b73dad2) Thanks [@kevinsproles](https://github.com/kevinsproles)! - getMockupUrl: `aspect` takes every mockup shape (16:9, 2:3, 3:4, 4:5, 1:1, 1.91:1, 9:16, 21:9, app-header) and a new `preset` picks a platform's shape and width by name (`"tiktok"`, `"instagram-feed"`, `"pinterest"`, …). A mockup that doesn't hold a shape answers E_MOCKUP_SHAPE_UNAVAILABLE with the shapes it gives.
|
|
8
|
+
|
|
3
9
|
## 0.30.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -15,7 +15,13 @@ var SNOWCONE_HOSTS = {
|
|
|
15
15
|
/** Content-addressed artwork store (ingest handles). */
|
|
16
16
|
raws: "https://raws.snowcone.app",
|
|
17
17
|
/** Developer docs. */
|
|
18
|
-
docs: "https://developers.snowcone.app"
|
|
18
|
+
docs: "https://developers.snowcone.app",
|
|
19
|
+
/** The storefront site; `/api/launch` says whether orders are open yet. */
|
|
20
|
+
site: "https://snowcone.app",
|
|
21
|
+
/** The hosted MCP endpoint; it also serves the photo upload page (`/upload/<token>`). */
|
|
22
|
+
mcp: "https://mcp.snowcone.app",
|
|
23
|
+
/** Where draft designs made for a search are stored (a draft's `image_url`). */
|
|
24
|
+
drafts: "https://agentdraft.storage.snowcone.app"
|
|
19
25
|
};
|
|
20
26
|
var SNOWCONE_REALTIME_WS_URL = `${SNOWCONE_HOSTS.cdn.replace(/^http/, "ws")}/realtime`;
|
|
21
27
|
var PARAMS = {
|
|
@@ -67,6 +73,51 @@ var PARAMS = {
|
|
|
67
73
|
seal: "seal"
|
|
68
74
|
};
|
|
69
75
|
var BG_TRANSPARENT = "transparent";
|
|
76
|
+
var MOCKUP_PRESETS = {
|
|
77
|
+
tiktok: { aspect: "9:16", width: 1200 },
|
|
78
|
+
// 1080x1920
|
|
79
|
+
"instagram-story": { aspect: "9:16", width: 1200 },
|
|
80
|
+
// 1080x1920 (and Reels)
|
|
81
|
+
"youtube-shorts": { aspect: "9:16", width: 1200 },
|
|
82
|
+
// 1080x1920
|
|
83
|
+
"instagram-feed": { aspect: "4:5", width: 1200 },
|
|
84
|
+
// 1080x1350
|
|
85
|
+
"instagram-square": { aspect: "1:1", width: 1200 },
|
|
86
|
+
// 1080x1080
|
|
87
|
+
"facebook-feed": { aspect: "4:5", width: 1200 },
|
|
88
|
+
// 1080x1350
|
|
89
|
+
"facebook-link": { aspect: "1.91:1", width: 1200 },
|
|
90
|
+
// 1200x628
|
|
91
|
+
"linkedin-link": { aspect: "1.91:1", width: 1200 },
|
|
92
|
+
// 1200x627
|
|
93
|
+
pinterest: { aspect: "2:3", width: 1e3 },
|
|
94
|
+
// 1000x1500
|
|
95
|
+
"youtube-thumbnail": { aspect: "16:9", width: 1400 },
|
|
96
|
+
// 1280x720
|
|
97
|
+
"x-post": { aspect: "16:9", width: 1600 },
|
|
98
|
+
// 1600x900
|
|
99
|
+
amazon: { aspect: "1:1", width: 2e3 },
|
|
100
|
+
// 2000x2000 main image
|
|
101
|
+
etsy: { aspect: "1:1", width: 2e3 },
|
|
102
|
+
// 2000x2000
|
|
103
|
+
shopify: { aspect: "1:1", width: 2e3 },
|
|
104
|
+
// 2048x2048 product image, nearest rung
|
|
105
|
+
"site-hero": { aspect: "16:9", width: 2500 },
|
|
106
|
+
// 2560x1440
|
|
107
|
+
"web-banner": { aspect: "21:9", width: 2500 },
|
|
108
|
+
// ultra-wide banner
|
|
109
|
+
"app-header": { aspect: "app-header", width: 1200 }
|
|
110
|
+
// the hero under a phone's status bar (8:9)
|
|
111
|
+
};
|
|
112
|
+
var MOCKUP_PRESET_NAMES = Object.keys(MOCKUP_PRESETS);
|
|
113
|
+
function resolvePreset(preset, aspect, width) {
|
|
114
|
+
const p = MOCKUP_PRESETS[preset];
|
|
115
|
+
if (!p) throw new Error(`[snowcone] E_PRESET_UNKNOWN: preset ${JSON.stringify(preset)}; the presets: ${MOCKUP_PRESET_NAMES.join(", ")}`);
|
|
116
|
+
if (aspect !== void 0 && aspect !== p.aspect) {
|
|
117
|
+
throw new Error(`[snowcone] E_PRESET_ASPECT_CONFLICT: preset "${preset}" is aspect ${p.aspect}, but aspect "${aspect}" was also given; drop one`);
|
|
118
|
+
}
|
|
119
|
+
return { aspect: p.aspect, width: width ?? p.width };
|
|
120
|
+
}
|
|
70
121
|
function normalizeBgColor(raw) {
|
|
71
122
|
const value = raw.trim().replace(/^#/, "").toLowerCase();
|
|
72
123
|
if (value === BG_TRANSPARENT) return BG_TRANSPARENT;
|
|
@@ -241,9 +292,10 @@ function buildPublicMockupUrl(options, cfg = {}) {
|
|
|
241
292
|
if (options.mockup !== void 0) {
|
|
242
293
|
parts.push(`${PARAMS.mockup}=${enc(options.mockup)}`);
|
|
243
294
|
}
|
|
244
|
-
|
|
245
|
-
if (
|
|
246
|
-
|
|
295
|
+
const shape = options.preset !== void 0 ? resolvePreset(options.preset, options.aspect, options.width) : { aspect: options.aspect, width: options.width };
|
|
296
|
+
if (shape.width !== void 0) parts.push(`${PARAMS.width}=${shape.width}`);
|
|
297
|
+
if (shape.aspect !== void 0 && shape.aspect !== "16:9") {
|
|
298
|
+
parts.push(`${PARAMS.aspect}=${enc(shape.aspect)}`);
|
|
247
299
|
}
|
|
248
300
|
if (options.bg) {
|
|
249
301
|
parts.push(`${PARAMS.bg}=${requireBgColor(options.bg)}`);
|
package/dist/index.cjs
CHANGED
|
@@ -277,7 +277,13 @@ var SNOWCONE_HOSTS = {
|
|
|
277
277
|
/** Content-addressed artwork store (ingest handles). */
|
|
278
278
|
raws: "https://raws.snowcone.app",
|
|
279
279
|
/** Developer docs. */
|
|
280
|
-
docs: "https://developers.snowcone.app"
|
|
280
|
+
docs: "https://developers.snowcone.app",
|
|
281
|
+
/** The storefront site; `/api/launch` says whether orders are open yet. */
|
|
282
|
+
site: "https://snowcone.app",
|
|
283
|
+
/** The hosted MCP endpoint; it also serves the photo upload page (`/upload/<token>`). */
|
|
284
|
+
mcp: "https://mcp.snowcone.app",
|
|
285
|
+
/** Where draft designs made for a search are stored (a draft's `image_url`). */
|
|
286
|
+
drafts: "https://agentdraft.storage.snowcone.app"
|
|
281
287
|
};
|
|
282
288
|
var SNOWCONE_REALTIME_WS_URL = `${SNOWCONE_HOSTS.cdn.replace(/^http/, "ws")}/realtime`;
|
|
283
289
|
var PARAMS = {
|
|
@@ -329,6 +335,51 @@ var PARAMS = {
|
|
|
329
335
|
seal: "seal"
|
|
330
336
|
};
|
|
331
337
|
var BG_TRANSPARENT = "transparent";
|
|
338
|
+
var MOCKUP_PRESETS = {
|
|
339
|
+
tiktok: { aspect: "9:16", width: 1200 },
|
|
340
|
+
// 1080x1920
|
|
341
|
+
"instagram-story": { aspect: "9:16", width: 1200 },
|
|
342
|
+
// 1080x1920 (and Reels)
|
|
343
|
+
"youtube-shorts": { aspect: "9:16", width: 1200 },
|
|
344
|
+
// 1080x1920
|
|
345
|
+
"instagram-feed": { aspect: "4:5", width: 1200 },
|
|
346
|
+
// 1080x1350
|
|
347
|
+
"instagram-square": { aspect: "1:1", width: 1200 },
|
|
348
|
+
// 1080x1080
|
|
349
|
+
"facebook-feed": { aspect: "4:5", width: 1200 },
|
|
350
|
+
// 1080x1350
|
|
351
|
+
"facebook-link": { aspect: "1.91:1", width: 1200 },
|
|
352
|
+
// 1200x628
|
|
353
|
+
"linkedin-link": { aspect: "1.91:1", width: 1200 },
|
|
354
|
+
// 1200x627
|
|
355
|
+
pinterest: { aspect: "2:3", width: 1e3 },
|
|
356
|
+
// 1000x1500
|
|
357
|
+
"youtube-thumbnail": { aspect: "16:9", width: 1400 },
|
|
358
|
+
// 1280x720
|
|
359
|
+
"x-post": { aspect: "16:9", width: 1600 },
|
|
360
|
+
// 1600x900
|
|
361
|
+
amazon: { aspect: "1:1", width: 2e3 },
|
|
362
|
+
// 2000x2000 main image
|
|
363
|
+
etsy: { aspect: "1:1", width: 2e3 },
|
|
364
|
+
// 2000x2000
|
|
365
|
+
shopify: { aspect: "1:1", width: 2e3 },
|
|
366
|
+
// 2048x2048 product image, nearest rung
|
|
367
|
+
"site-hero": { aspect: "16:9", width: 2500 },
|
|
368
|
+
// 2560x1440
|
|
369
|
+
"web-banner": { aspect: "21:9", width: 2500 },
|
|
370
|
+
// ultra-wide banner
|
|
371
|
+
"app-header": { aspect: "app-header", width: 1200 }
|
|
372
|
+
// the hero under a phone's status bar (8:9)
|
|
373
|
+
};
|
|
374
|
+
var MOCKUP_PRESET_NAMES = Object.keys(MOCKUP_PRESETS);
|
|
375
|
+
function resolvePreset(preset, aspect, width) {
|
|
376
|
+
const p = MOCKUP_PRESETS[preset];
|
|
377
|
+
if (!p) throw new Error(`[snowcone] E_PRESET_UNKNOWN: preset ${JSON.stringify(preset)}; the presets: ${MOCKUP_PRESET_NAMES.join(", ")}`);
|
|
378
|
+
if (aspect !== void 0 && aspect !== p.aspect) {
|
|
379
|
+
throw new Error(`[snowcone] E_PRESET_ASPECT_CONFLICT: preset "${preset}" is aspect ${p.aspect}, but aspect "${aspect}" was also given; drop one`);
|
|
380
|
+
}
|
|
381
|
+
return { aspect: p.aspect, width: width ?? p.width };
|
|
382
|
+
}
|
|
332
383
|
function normalizeBgColor(raw) {
|
|
333
384
|
const value = raw.trim().replace(/^#/, "").toLowerCase();
|
|
334
385
|
if (value === BG_TRANSPARENT) return BG_TRANSPARENT;
|
|
@@ -503,9 +554,10 @@ function buildPublicMockupUrl(options, cfg = {}) {
|
|
|
503
554
|
if (options.mockup !== void 0) {
|
|
504
555
|
parts.push(`${PARAMS.mockup}=${enc(options.mockup)}`);
|
|
505
556
|
}
|
|
506
|
-
|
|
507
|
-
if (
|
|
508
|
-
|
|
557
|
+
const shape = options.preset !== void 0 ? resolvePreset(options.preset, options.aspect, options.width) : { aspect: options.aspect, width: options.width };
|
|
558
|
+
if (shape.width !== void 0) parts.push(`${PARAMS.width}=${shape.width}`);
|
|
559
|
+
if (shape.aspect !== void 0 && shape.aspect !== "16:9") {
|
|
560
|
+
parts.push(`${PARAMS.aspect}=${enc(shape.aspect)}`);
|
|
509
561
|
}
|
|
510
562
|
if (options.bg) {
|
|
511
563
|
parts.push(`${PARAMS.bg}=${requireBgColor(options.bg)}`);
|
|
@@ -1033,6 +1085,7 @@ function getMockupUrl(a, b, c) {
|
|
|
1033
1085
|
...opts.options ? { options: opts.options } : {},
|
|
1034
1086
|
...opts.width !== void 0 ? { width: opts.width } : {},
|
|
1035
1087
|
...opts.aspect !== void 0 ? { aspect: opts.aspect } : {},
|
|
1088
|
+
...opts.preset !== void 0 ? { preset: opts.preset } : {},
|
|
1036
1089
|
...opts.bg !== void 0 ? { bg: opts.bg } : {},
|
|
1037
1090
|
...opts.mockup ?? opts.view ? { mockup: opts.mockup ?? opts.view } : {},
|
|
1038
1091
|
...opts.variant !== void 0 ? { variant: opts.variant } : {},
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createDevFetcher } from './dev-fetcher.cjs';
|
|
2
|
-
import { PublicDesign, PublicFill, PublicOptions } from '@snowcone-app/mockup-url';
|
|
2
|
+
import { PublicDesign, PublicFill, PublicOptions, MockupAspect, MockupPreset } from '@snowcone-app/mockup-url';
|
|
3
3
|
export { SNOWCONE_HOSTS, SNOWCONE_REALTIME_WS_URL, SnowconeHostRole } from '@snowcone-app/mockup-url';
|
|
4
4
|
export { GalleryReason, GalleryStanding, MockupRole, OrdinaryMockups, PDP_GALLERY_LIMIT, SIZE_PICTURE, gallerySizePicture, galleryStanding, mockupRole, ordinaryMockups, pictureForVariant, primaryMockup } from './mockup-role.cjs';
|
|
5
5
|
import { O as OptionAttribute, a as OptionSelection, C as Combination, F as FrameworkAdapter, b as ComponentProps, c as ComponentDescriptor, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, g as FrameworkUtilities, P as PlacementSettings, M as MockupResult, R as RealtimeRenderError, h as RealtimeMockupService } from './websocket-CvN0UU2j.cjs';
|
|
@@ -239,8 +239,9 @@ interface ProductSpec {
|
|
|
239
239
|
interface Effects {
|
|
240
240
|
grain?: 1 | 2;
|
|
241
241
|
}
|
|
242
|
-
/**
|
|
243
|
-
|
|
242
|
+
/** Picture shapes (`aspect=`): the same list as @snowcone-app/mockup-url MOCKUP_ASPECTS. A mockup gives 16:9 + 2:3,
|
|
243
|
+
* or the shapes its plate holds; asking another answers E_MOCKUP_SHAPE_UNAVAILABLE with its list. */
|
|
244
|
+
type AspectRatio = '16:9' | '2:3' | '3:4' | '4:5' | '1:1' | '1.91:1' | '9:16' | '21:9' | 'app-header';
|
|
244
245
|
/**
|
|
245
246
|
* Blend configuration for mockup masks
|
|
246
247
|
* Controls how artwork blends with the background texture
|
|
@@ -383,12 +384,17 @@ interface GetMockupUrlOptions {
|
|
|
383
384
|
/** Specific placement label override (only meaningful with a single `asset`). */
|
|
384
385
|
placement?: string;
|
|
385
386
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* dimensions; measure or crop client-side with `object-fit: cover`.
|
|
387
|
+
* The picture's shape (MOCKUP_ASPECTS). `"16:9"` (or omitting it) is the mockup's default picture; `"2:3"` the
|
|
388
|
+
* centre portrait. Other shapes (`"9:16"`, `"1:1"`, `"app-header"`, …) come only from mockups made for them; a mockup
|
|
389
|
+
* that doesn't hold one answers E_MOCKUP_SHAPE_UNAVAILABLE with its list. Don't assume output dimensions: measure.
|
|
390
390
|
*/
|
|
391
|
-
aspect?:
|
|
391
|
+
aspect?: MockupAspect;
|
|
392
|
+
/**
|
|
393
|
+
* A platform preset (`"tiktok"`, `"instagram-feed"`, `"pinterest"`, `"app-header"`, … : MOCKUP_PRESETS in
|
|
394
|
+
* @snowcone-app/mockup-url): sets `aspect` and `width` for that platform. An explicit `width` wins; an `aspect` that
|
|
395
|
+
* disagrees throws (E_PRESET_ASPECT_CONFLICT). Never in the URL: two presets of one shape share one cached image.
|
|
396
|
+
*/
|
|
397
|
+
preset?: MockupPreset;
|
|
392
398
|
/**
|
|
393
399
|
* Background color painted behind the mockup (6-hex, `#` optional — e.g.
|
|
394
400
|
* `"f5f0ea"` or `"#F5F0EA"`), or `"transparent"` to force the raw cutout by
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createDevFetcher } from './dev-fetcher.js';
|
|
2
|
-
import { PublicDesign, PublicFill, PublicOptions } from '@snowcone-app/mockup-url';
|
|
2
|
+
import { PublicDesign, PublicFill, PublicOptions, MockupAspect, MockupPreset } from '@snowcone-app/mockup-url';
|
|
3
3
|
export { SNOWCONE_HOSTS, SNOWCONE_REALTIME_WS_URL, SnowconeHostRole } from '@snowcone-app/mockup-url';
|
|
4
4
|
export { GalleryReason, GalleryStanding, MockupRole, OrdinaryMockups, PDP_GALLERY_LIMIT, SIZE_PICTURE, gallerySizePicture, galleryStanding, mockupRole, ordinaryMockups, pictureForVariant, primaryMockup } from './mockup-role.js';
|
|
5
5
|
import { O as OptionAttribute, a as OptionSelection, C as Combination, F as FrameworkAdapter, b as ComponentProps, c as ComponentDescriptor, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, g as FrameworkUtilities, P as PlacementSettings, M as MockupResult, R as RealtimeRenderError, h as RealtimeMockupService } from './websocket-CvN0UU2j.js';
|
|
@@ -239,8 +239,9 @@ interface ProductSpec {
|
|
|
239
239
|
interface Effects {
|
|
240
240
|
grain?: 1 | 2;
|
|
241
241
|
}
|
|
242
|
-
/**
|
|
243
|
-
|
|
242
|
+
/** Picture shapes (`aspect=`): the same list as @snowcone-app/mockup-url MOCKUP_ASPECTS. A mockup gives 16:9 + 2:3,
|
|
243
|
+
* or the shapes its plate holds; asking another answers E_MOCKUP_SHAPE_UNAVAILABLE with its list. */
|
|
244
|
+
type AspectRatio = '16:9' | '2:3' | '3:4' | '4:5' | '1:1' | '1.91:1' | '9:16' | '21:9' | 'app-header';
|
|
244
245
|
/**
|
|
245
246
|
* Blend configuration for mockup masks
|
|
246
247
|
* Controls how artwork blends with the background texture
|
|
@@ -383,12 +384,17 @@ interface GetMockupUrlOptions {
|
|
|
383
384
|
/** Specific placement label override (only meaningful with a single `asset`). */
|
|
384
385
|
placement?: string;
|
|
385
386
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* dimensions; measure or crop client-side with `object-fit: cover`.
|
|
387
|
+
* The picture's shape (MOCKUP_ASPECTS). `"16:9"` (or omitting it) is the mockup's default picture; `"2:3"` the
|
|
388
|
+
* centre portrait. Other shapes (`"9:16"`, `"1:1"`, `"app-header"`, …) come only from mockups made for them; a mockup
|
|
389
|
+
* that doesn't hold one answers E_MOCKUP_SHAPE_UNAVAILABLE with its list. Don't assume output dimensions: measure.
|
|
390
390
|
*/
|
|
391
|
-
aspect?:
|
|
391
|
+
aspect?: MockupAspect;
|
|
392
|
+
/**
|
|
393
|
+
* A platform preset (`"tiktok"`, `"instagram-feed"`, `"pinterest"`, `"app-header"`, … : MOCKUP_PRESETS in
|
|
394
|
+
* @snowcone-app/mockup-url): sets `aspect` and `width` for that platform. An explicit `width` wins; an `aspect` that
|
|
395
|
+
* disagrees throws (E_PRESET_ASPECT_CONFLICT). Never in the URL: two presets of one shape share one cached image.
|
|
396
|
+
*/
|
|
397
|
+
preset?: MockupPreset;
|
|
392
398
|
/**
|
|
393
399
|
* Background color painted behind the mockup (6-hex, `#` optional — e.g.
|
|
394
400
|
* `"f5f0ea"` or `"#F5F0EA"`), or `"transparent"` to force the raw cutout by
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REALTIME_WS_URL,
|
|
3
3
|
RealtimeMockupService
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KMDKCI4T.js";
|
|
5
5
|
import {
|
|
6
6
|
createDevFetcher
|
|
7
7
|
} from "./chunk-7VO4EL2V.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
canonicalForSig,
|
|
14
14
|
normalizeDesignElements,
|
|
15
15
|
normalizeWidth
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-O6I5SJT5.js";
|
|
17
17
|
import {
|
|
18
18
|
PDP_GALLERY_LIMIT,
|
|
19
19
|
SIZE_PICTURE,
|
|
@@ -579,6 +579,7 @@ function getMockupUrl(a, b, c) {
|
|
|
579
579
|
...opts.options ? { options: opts.options } : {},
|
|
580
580
|
...opts.width !== void 0 ? { width: opts.width } : {},
|
|
581
581
|
...opts.aspect !== void 0 ? { aspect: opts.aspect } : {},
|
|
582
|
+
...opts.preset !== void 0 ? { preset: opts.preset } : {},
|
|
582
583
|
...opts.bg !== void 0 ? { bg: opts.bg } : {},
|
|
583
584
|
...opts.mockup ?? opts.view ? { mockup: opts.mockup ?? opts.view } : {},
|
|
584
585
|
...opts.variant !== void 0 ? { variant: opts.variant } : {},
|
package/dist/react.cjs
CHANGED
|
@@ -49,7 +49,13 @@ var SNOWCONE_HOSTS = {
|
|
|
49
49
|
/** Content-addressed artwork store (ingest handles). */
|
|
50
50
|
raws: "https://raws.snowcone.app",
|
|
51
51
|
/** Developer docs. */
|
|
52
|
-
docs: "https://developers.snowcone.app"
|
|
52
|
+
docs: "https://developers.snowcone.app",
|
|
53
|
+
/** The storefront site; `/api/launch` says whether orders are open yet. */
|
|
54
|
+
site: "https://snowcone.app",
|
|
55
|
+
/** The hosted MCP endpoint; it also serves the photo upload page (`/upload/<token>`). */
|
|
56
|
+
mcp: "https://mcp.snowcone.app",
|
|
57
|
+
/** Where draft designs made for a search are stored (a draft's `image_url`). */
|
|
58
|
+
drafts: "https://agentdraft.storage.snowcone.app"
|
|
53
59
|
};
|
|
54
60
|
var SNOWCONE_REALTIME_WS_URL = `${SNOWCONE_HOSTS.cdn.replace(/^http/, "ws")}/realtime`;
|
|
55
61
|
var PARAMS = {
|
|
@@ -100,6 +106,43 @@ var PARAMS = {
|
|
|
100
106
|
signature: "signature",
|
|
101
107
|
seal: "seal"
|
|
102
108
|
};
|
|
109
|
+
var MOCKUP_PRESETS = {
|
|
110
|
+
tiktok: { aspect: "9:16", width: 1200 },
|
|
111
|
+
// 1080x1920
|
|
112
|
+
"instagram-story": { aspect: "9:16", width: 1200 },
|
|
113
|
+
// 1080x1920 (and Reels)
|
|
114
|
+
"youtube-shorts": { aspect: "9:16", width: 1200 },
|
|
115
|
+
// 1080x1920
|
|
116
|
+
"instagram-feed": { aspect: "4:5", width: 1200 },
|
|
117
|
+
// 1080x1350
|
|
118
|
+
"instagram-square": { aspect: "1:1", width: 1200 },
|
|
119
|
+
// 1080x1080
|
|
120
|
+
"facebook-feed": { aspect: "4:5", width: 1200 },
|
|
121
|
+
// 1080x1350
|
|
122
|
+
"facebook-link": { aspect: "1.91:1", width: 1200 },
|
|
123
|
+
// 1200x628
|
|
124
|
+
"linkedin-link": { aspect: "1.91:1", width: 1200 },
|
|
125
|
+
// 1200x627
|
|
126
|
+
pinterest: { aspect: "2:3", width: 1e3 },
|
|
127
|
+
// 1000x1500
|
|
128
|
+
"youtube-thumbnail": { aspect: "16:9", width: 1400 },
|
|
129
|
+
// 1280x720
|
|
130
|
+
"x-post": { aspect: "16:9", width: 1600 },
|
|
131
|
+
// 1600x900
|
|
132
|
+
amazon: { aspect: "1:1", width: 2e3 },
|
|
133
|
+
// 2000x2000 main image
|
|
134
|
+
etsy: { aspect: "1:1", width: 2e3 },
|
|
135
|
+
// 2000x2000
|
|
136
|
+
shopify: { aspect: "1:1", width: 2e3 },
|
|
137
|
+
// 2048x2048 product image, nearest rung
|
|
138
|
+
"site-hero": { aspect: "16:9", width: 2500 },
|
|
139
|
+
// 2560x1440
|
|
140
|
+
"web-banner": { aspect: "21:9", width: 2500 },
|
|
141
|
+
// ultra-wide banner
|
|
142
|
+
"app-header": { aspect: "app-header", width: 1200 }
|
|
143
|
+
// the hero under a phone's status bar (8:9)
|
|
144
|
+
};
|
|
145
|
+
var MOCKUP_PRESET_NAMES = Object.keys(MOCKUP_PRESETS);
|
|
103
146
|
var MAX_RENDER_URL_LENGTH = 12 * 1024;
|
|
104
147
|
var INGEST_HANDLE_BASE = `${SNOWCONE_HOSTS.raws}/art-ingest/`;
|
|
105
148
|
var DEFAULT_PUBLIC_BASE_URL = SNOWCONE_HOSTS.img;
|
package/dist/react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REALTIME_WS_URL,
|
|
3
3
|
RealtimeMockupService
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-KMDKCI4T.js";
|
|
5
|
+
import "./chunk-O6I5SJT5.js";
|
|
6
6
|
|
|
7
7
|
// src/realtime/react.ts
|
|
8
8
|
import { useCallback, useEffect, useRef, useState } from "react";
|
package/dist/server.cjs
CHANGED
|
@@ -48,7 +48,13 @@ var SNOWCONE_HOSTS = {
|
|
|
48
48
|
/** Content-addressed artwork store (ingest handles). */
|
|
49
49
|
raws: "https://raws.snowcone.app",
|
|
50
50
|
/** Developer docs. */
|
|
51
|
-
docs: "https://developers.snowcone.app"
|
|
51
|
+
docs: "https://developers.snowcone.app",
|
|
52
|
+
/** The storefront site; `/api/launch` says whether orders are open yet. */
|
|
53
|
+
site: "https://snowcone.app",
|
|
54
|
+
/** The hosted MCP endpoint; it also serves the photo upload page (`/upload/<token>`). */
|
|
55
|
+
mcp: "https://mcp.snowcone.app",
|
|
56
|
+
/** Where draft designs made for a search are stored (a draft's `image_url`). */
|
|
57
|
+
drafts: "https://agentdraft.storage.snowcone.app"
|
|
52
58
|
};
|
|
53
59
|
var SNOWCONE_REALTIME_WS_URL = `${SNOWCONE_HOSTS.cdn.replace(/^http/, "ws")}/realtime`;
|
|
54
60
|
var PARAMS = {
|
|
@@ -99,6 +105,43 @@ var PARAMS = {
|
|
|
99
105
|
signature: "signature",
|
|
100
106
|
seal: "seal"
|
|
101
107
|
};
|
|
108
|
+
var MOCKUP_PRESETS = {
|
|
109
|
+
tiktok: { aspect: "9:16", width: 1200 },
|
|
110
|
+
// 1080x1920
|
|
111
|
+
"instagram-story": { aspect: "9:16", width: 1200 },
|
|
112
|
+
// 1080x1920 (and Reels)
|
|
113
|
+
"youtube-shorts": { aspect: "9:16", width: 1200 },
|
|
114
|
+
// 1080x1920
|
|
115
|
+
"instagram-feed": { aspect: "4:5", width: 1200 },
|
|
116
|
+
// 1080x1350
|
|
117
|
+
"instagram-square": { aspect: "1:1", width: 1200 },
|
|
118
|
+
// 1080x1080
|
|
119
|
+
"facebook-feed": { aspect: "4:5", width: 1200 },
|
|
120
|
+
// 1080x1350
|
|
121
|
+
"facebook-link": { aspect: "1.91:1", width: 1200 },
|
|
122
|
+
// 1200x628
|
|
123
|
+
"linkedin-link": { aspect: "1.91:1", width: 1200 },
|
|
124
|
+
// 1200x627
|
|
125
|
+
pinterest: { aspect: "2:3", width: 1e3 },
|
|
126
|
+
// 1000x1500
|
|
127
|
+
"youtube-thumbnail": { aspect: "16:9", width: 1400 },
|
|
128
|
+
// 1280x720
|
|
129
|
+
"x-post": { aspect: "16:9", width: 1600 },
|
|
130
|
+
// 1600x900
|
|
131
|
+
amazon: { aspect: "1:1", width: 2e3 },
|
|
132
|
+
// 2000x2000 main image
|
|
133
|
+
etsy: { aspect: "1:1", width: 2e3 },
|
|
134
|
+
// 2000x2000
|
|
135
|
+
shopify: { aspect: "1:1", width: 2e3 },
|
|
136
|
+
// 2048x2048 product image, nearest rung
|
|
137
|
+
"site-hero": { aspect: "16:9", width: 2500 },
|
|
138
|
+
// 2560x1440
|
|
139
|
+
"web-banner": { aspect: "21:9", width: 2500 },
|
|
140
|
+
// ultra-wide banner
|
|
141
|
+
"app-header": { aspect: "app-header", width: 1200 }
|
|
142
|
+
// the hero under a phone's status bar (8:9)
|
|
143
|
+
};
|
|
144
|
+
var MOCKUP_PRESET_NAMES = Object.keys(MOCKUP_PRESETS);
|
|
102
145
|
var MAX_RENDER_URL_LENGTH = 12 * 1024;
|
|
103
146
|
var INGEST_HANDLE_BASE = `${SNOWCONE_HOSTS.raws}/art-ingest/`;
|
|
104
147
|
var DEFAULT_PUBLIC_BASE_URL = SNOWCONE_HOSTS.img;
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowcone-app/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Snowcone SDK for product mockups and print-on-demand",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"merch",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"tsup": "^8.1.0",
|
|
92
92
|
"typescript": "^5.5.4",
|
|
93
93
|
"vitest": "^2.1.9",
|
|
94
|
-
"@snowcone-app/mockup-url": "0.6.
|
|
94
|
+
"@snowcone-app/mockup-url": "0.6.1"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=18"
|