@snowcone-app/ui 0.4.10 → 0.4.12

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1634](https://github.com/snowcone-app/snowcone-monorepo/pull/1634) [`b9d59e6`](https://github.com/snowcone-app/snowcone-monorepo/commit/b9d59e6c23540e73759ff33e1ad4347493aee017) Thanks [@kevinsproles](https://github.com/kevinsproles)! - RealtimeProvider: decode the frozen cropped-delivery background at seed time. With ws binary frame delivery the full frame's `imageUrl` is a live `blob:` URL the SDK revokes when the next frame for that mockup arrives; lazily loading it at composite time failed (`E_OVERLAY_FRAME_LOAD`), disabled cropped delivery for the session, and cost three extra full renders per edit.
8
+
9
+ - [#1634](https://github.com/snowcone-app/snowcone-monorepo/pull/1634) [`b9d59e6`](https://github.com/snowcone-app/snowcone-monorepo/commit/b9d59e6c23540e73759ff33e1ad4347493aee017) Thanks [@kevinsproles](https://github.com/kevinsproles)! - CanvasExportService: an empty design is sent to the realtime renderer once art has rendered in the session. Deleting or undoing the last element now re-renders the blank product instead of leaving the mockup showing art that is no longer in the design. A blank editor mount still sends nothing.
10
+
11
+ ## 0.4.11
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1632](https://github.com/snowcone-app/snowcone-monorepo/pull/1632) [`8a3b7e2`](https://github.com/snowcone-app/snowcone-monorepo/commit/8a3b7e26867257a22073dc5a55fb19d94ffded3f) Thanks [@kevinsproles](https://github.com/kevinsproles)! - RealtimeProvider: decode the frozen cropped-delivery background at seed time. With ws binary frame delivery the full frame's `imageUrl` is a live `blob:` URL the SDK revokes when the next frame for that mockup arrives; lazily loading it at composite time failed (`E_OVERLAY_FRAME_LOAD`), disabled cropped delivery for the session, and cost three extra full renders per edit.
16
+
3
17
  ## 0.4.10
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -6303,7 +6303,10 @@ function RealtimeProvider({
6303
6303
  if (isFullRect(result.cropRect)) {
6304
6304
  if (firstSight && sessionLive) {
6305
6305
  processedFrameRef.current.set(result.mockupId, result.imageUrl);
6306
- backgroundsRef.current.set(result.mockupId, { url: result.imageUrl });
6306
+ const imgPromise = loadImageElement(result.imageUrl);
6307
+ imgPromise.catch(() => {
6308
+ });
6309
+ backgroundsRef.current.set(result.mockupId, { url: result.imageUrl, imgPromise });
6307
6310
  }
6308
6311
  displayable.push(result);
6309
6312
  } else if (firstSight && sessionLive) {
@@ -8885,7 +8888,7 @@ var CanvasExportService = class _CanvasExportService {
8885
8888
  handleStateChange = (state) => {
8886
8889
  if (!state) return;
8887
8890
  const hasElements = state.elements?.length > 0;
8888
- if (!hasElements) return;
8891
+ if (!hasElements && !this.jsonModeSentSuccessfully) return;
8889
8892
  const hasLoadingImages = state.elements?.some(
8890
8893
  (el) => (el.type === "image" || el.transformType === "image") && el.imageLoadState === "loading"
8891
8894
  );
@@ -8973,6 +8976,8 @@ var CanvasExportService = class _CanvasExportService {
8973
8976
  this.stateChangeThrottleTimeout = null;
8974
8977
  }
8975
8978
  this.stateChangeLastSendTime = 0;
8979
+ this.jsonModeSentSuccessfully = false;
8980
+ this.pendingCanvasState = null;
8976
8981
  if (this.clearImageBitmapCache) {
8977
8982
  this.clearImageBitmapCache();
8978
8983
  }