@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 +14 -0
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/patterns/RealtimeProvider.tsx +13 -2
- package/src/patterns/__tests__/RealtimeProvider.cropDelivery.test.tsx +21 -0
- package/src/services/CanvasExportService.ts +10 -1
- package/src/services/__tests__/CanvasExportService.emptyState.test.ts +48 -0
package/dist/index.js
CHANGED
|
@@ -5945,7 +5945,10 @@ function RealtimeProvider({
|
|
|
5945
5945
|
if (isFullRect(result.cropRect)) {
|
|
5946
5946
|
if (firstSight && sessionLive) {
|
|
5947
5947
|
processedFrameRef.current.set(result.mockupId, result.imageUrl);
|
|
5948
|
-
|
|
5948
|
+
const imgPromise = loadImageElement(result.imageUrl);
|
|
5949
|
+
imgPromise.catch(() => {
|
|
5950
|
+
});
|
|
5951
|
+
backgroundsRef.current.set(result.mockupId, { url: result.imageUrl, imgPromise });
|
|
5949
5952
|
}
|
|
5950
5953
|
displayable.push(result);
|
|
5951
5954
|
} else if (firstSight && sessionLive) {
|
|
@@ -8535,7 +8538,7 @@ var CanvasExportService = class _CanvasExportService {
|
|
|
8535
8538
|
handleStateChange = (state) => {
|
|
8536
8539
|
if (!state) return;
|
|
8537
8540
|
const hasElements = state.elements?.length > 0;
|
|
8538
|
-
if (!hasElements) return;
|
|
8541
|
+
if (!hasElements && !this.jsonModeSentSuccessfully) return;
|
|
8539
8542
|
const hasLoadingImages = state.elements?.some(
|
|
8540
8543
|
(el) => (el.type === "image" || el.transformType === "image") && el.imageLoadState === "loading"
|
|
8541
8544
|
);
|
|
@@ -8623,6 +8626,8 @@ var CanvasExportService = class _CanvasExportService {
|
|
|
8623
8626
|
this.stateChangeThrottleTimeout = null;
|
|
8624
8627
|
}
|
|
8625
8628
|
this.stateChangeLastSendTime = 0;
|
|
8629
|
+
this.jsonModeSentSuccessfully = false;
|
|
8630
|
+
this.pendingCanvasState = null;
|
|
8626
8631
|
if (this.clearImageBitmapCache) {
|
|
8627
8632
|
this.clearImageBitmapCache();
|
|
8628
8633
|
}
|