@snowcone-app/sdk 0.24.0 → 0.24.2

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.24.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3131](https://github.com/snowcone-app/snowcone-monorepo/pull/3131) [`84f6ac3`](https://github.com/snowcone-app/snowcone-monorepo/commit/84f6ac38e54c57c483ff49c18548cd9ba832d30e) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Realtime `spreadCrops` pieces can carry `part: { index, count }`: a placement cut into strips that sit on different spread artboards is assembled server-side once every strip has arrived.
8
+
9
+ ## 0.24.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#2346](https://github.com/snowcone-app/snowcone-monorepo/pull/2346) [`1804866`](https://github.com/snowcone-app/snowcone-monorepo/commit/1804866916ee79bf7e3db0ea65ce803a1fc005b8) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Realtime: `onAllMockupsRendered` (and therefore `RenderSession.onMockups`) now receives the merged results — a ws-delivered binary frame's `blob:` `imageUrl` included — instead of the server's lean summary entries. A session whose frames rode the socket without a fallback `imageUrl` rendered but never showed: `Editor.Preview` stayed "rendering" forever.
14
+
3
15
  ## 0.24.0
4
16
 
5
17
  ### Minor Changes
@@ -349,7 +349,7 @@ var RealtimeMockupService = class {
349
349
  this.lastError = null;
350
350
  this.renderError = null;
351
351
  this.addLog(`\u{1F389} All mockups rendered: ${freshMockups.length} fresh (${data.mockups.length - freshMockups.length} stale filtered)`);
352
- this.callbacks.onAllMockupsRendered?.(freshMockups);
352
+ this.callbacks.onAllMockupsRendered?.(this.mockupResults);
353
353
  } else {
354
354
  this.addLog(`\u26A0\uFE0F all_mockups_rendered message dropped: missing 'mockups' array. Full data keys: [${Object.keys(data).join(", ")}]`);
355
355
  }
package/dist/index.cjs CHANGED
@@ -5349,7 +5349,7 @@ var RealtimeMockupService = class {
5349
5349
  this.lastError = null;
5350
5350
  this.renderError = null;
5351
5351
  this.addLog(`\u{1F389} All mockups rendered: ${freshMockups.length} fresh (${data.mockups.length - freshMockups.length} stale filtered)`);
5352
- this.callbacks.onAllMockupsRendered?.(freshMockups);
5352
+ this.callbacks.onAllMockupsRendered?.(this.mockupResults);
5353
5353
  } else {
5354
5354
  this.addLog(`\u26A0\uFE0F all_mockups_rendered message dropped: missing 'mockups' array. Full data keys: [${Object.keys(data).join(", ")}]`);
5355
5355
  }
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { createDevFetcher } from './dev-fetcher.cjs';
2
2
  import { PublicDesign, PublicFill, PublicOptions } from '@snowcone-app/mockup-url';
3
- 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-DXO35yrh.cjs';
4
- export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-DXO35yrh.cjs';
3
+ 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-BYnhkMSH.cjs';
4
+ export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-BYnhkMSH.cjs';
5
5
 
6
6
  interface CatalogProduct {
7
7
  id: string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { createDevFetcher } from './dev-fetcher.js';
2
2
  import { PublicDesign, PublicFill, PublicOptions } from '@snowcone-app/mockup-url';
3
- 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-DXO35yrh.js';
4
- export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-DXO35yrh.js';
3
+ 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-BYnhkMSH.js';
4
+ export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-BYnhkMSH.js';
5
5
 
6
6
  interface CatalogProduct {
7
7
  id: string;
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  REALTIME_WS_URL,
6
6
  RealtimeMockupService
7
- } from "./chunk-5DNY477E.js";
7
+ } from "./chunk-FQC2FPV7.js";
8
8
  import {
9
9
  buildMockupUrl,
10
10
  buildPublicMockupUrl,
package/dist/react.cjs CHANGED
@@ -383,7 +383,7 @@ var RealtimeMockupService = class {
383
383
  this.lastError = null;
384
384
  this.renderError = null;
385
385
  this.addLog(`\u{1F389} All mockups rendered: ${freshMockups.length} fresh (${data.mockups.length - freshMockups.length} stale filtered)`);
386
- this.callbacks.onAllMockupsRendered?.(freshMockups);
386
+ this.callbacks.onAllMockupsRendered?.(this.mockupResults);
387
387
  } else {
388
388
  this.addLog(`\u26A0\uFE0F all_mockups_rendered message dropped: missing 'mockups' array. Full data keys: [${Object.keys(data).join(", ")}]`);
389
389
  }
package/dist/react.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-DXO35yrh.cjs';
1
+ import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-BYnhkMSH.cjs';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
3
 
4
4
  interface UseRealtimeMockupOptions {
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-DXO35yrh.js';
1
+ import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-BYnhkMSH.js';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
3
 
4
4
  interface UseRealtimeMockupOptions {
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RealtimeMockupService
3
- } from "./chunk-5DNY477E.js";
3
+ } from "./chunk-FQC2FPV7.js";
4
4
 
5
5
  // src/realtime/react.ts
6
6
  import { useCallback, useEffect, useRef, useState } from "react";
@@ -235,7 +235,10 @@ interface WebSocketConfig {
235
235
  * spread/group artboards, each canvas_state render of that artboard is
236
236
  * cropped server-side into per-placement images by these bounds. Keyed by
237
237
  * artboard name; piece rects are in artboard units and `placement` must be
238
- * the product's placement label.
238
+ * the product's placement label. `part: { index, count }` marks the rect as
239
+ * strip `index` of `count` of a placement split across spreads (a printable
240
+ * piece cut into strips, e.g. a hoodie waistband): the server assembles the
241
+ * placement once every strip has arrived.
239
242
  */
240
243
  spreadCrops?: Record<string, {
241
244
  width: number;
@@ -246,6 +249,10 @@ interface WebSocketConfig {
246
249
  y: number;
247
250
  width: number;
248
251
  height: number;
252
+ part?: {
253
+ index: number;
254
+ count: number;
255
+ };
249
256
  }>;
250
257
  }>;
251
258
  /**
@@ -235,7 +235,10 @@ interface WebSocketConfig {
235
235
  * spread/group artboards, each canvas_state render of that artboard is
236
236
  * cropped server-side into per-placement images by these bounds. Keyed by
237
237
  * artboard name; piece rects are in artboard units and `placement` must be
238
- * the product's placement label.
238
+ * the product's placement label. `part: { index, count }` marks the rect as
239
+ * strip `index` of `count` of a placement split across spreads (a printable
240
+ * piece cut into strips, e.g. a hoodie waistband): the server assembles the
241
+ * placement once every strip has arrived.
239
242
  */
240
243
  spreadCrops?: Record<string, {
241
244
  width: number;
@@ -246,6 +249,10 @@ interface WebSocketConfig {
246
249
  y: number;
247
250
  width: number;
248
251
  height: number;
252
+ part?: {
253
+ index: number;
254
+ count: number;
255
+ };
249
256
  }>;
250
257
  }>;
251
258
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowcone-app/sdk",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "Snowcone SDK for product mockups and print-on-demand",
5
5
  "keywords": [
6
6
  "merch",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^18.3.1",
85
85
  "tsup": "^8.1.0",
86
86
  "typescript": "^5.5.4",
87
- "vitest": "^2.0.5",
87
+ "vitest": "^2.1.9",
88
88
  "@snowcone-app/mockup-url": "0.6.0"
89
89
  },
90
90
  "engines": {