@snowcone-app/ui 0.11.9 → 0.11.11

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/dist/index.js CHANGED
@@ -5737,6 +5737,12 @@ async function compositeCroppedFrame(args) {
5737
5737
  return blob;
5738
5738
  }
5739
5739
 
5740
+ // src/patterns/croppedDeliveryLimit.ts
5741
+ var CROPPED_DELIVERY_MAX_MOCKUPS = 5;
5742
+ function croppedDeliveryAllowed(mockupCount) {
5743
+ return mockupCount <= CROPPED_DELIVERY_MAX_MOCKUPS;
5744
+ }
5745
+
5740
5746
  // src/patterns/RealtimeProvider.tsx
5741
5747
  import { jsx as jsx52 } from "react/jsx-runtime";
5742
5748
  var DEFAULT_ARTBOARD_SIZE = 2e3;
@@ -6125,6 +6131,10 @@ function RealtimeProvider({
6125
6131
  const base = lastConfigBaseRef.current;
6126
6132
  if (!base) return;
6127
6133
  const ids = base.mockupIds ?? [];
6134
+ if (!croppedDeliveryAllowed(ids.length)) {
6135
+ console.log(`[RTP] Cropped delivery OFF: ${ids.length} mockups > ${CROPPED_DELIVERY_MAX_MOCKUPS} (#6369 stopgap, full-frame frames)`);
6136
+ return;
6137
+ }
6128
6138
  const seeded = new Set(backgroundsRef.current.keys());
6129
6139
  if (allBackgroundsSeeded(ids, seeded)) {
6130
6140
  console.log(`[RTP] Cropped delivery ON \u2014 all ${ids.length} mockup background(s) seeded`);
@@ -6184,6 +6194,7 @@ function RealtimeProvider({
6184
6194
  base.mockupIds = shape.mockupIds;
6185
6195
  base.width = shape.width;
6186
6196
  requestedMockupIdsRef.current = [...shape.mockupIds];
6197
+ if (croppedActiveRef.current && !croppedDeliveryAllowed(shape.mockupIds.length)) croppedActiveRef.current = false;
6187
6198
  sendConfigRaw({
6188
6199
  ...base,
6189
6200
  placementSettings: { ...placementSettingsOverridesRef.current },
@@ -6591,6 +6602,7 @@ function RealtimeProvider({
6591
6602
  }
6592
6603
  lastConfigBaseRef.current = configPayload;
6593
6604
  requestedMockupIdsRef.current = [...shape.mockupIds];
6605
+ if (croppedActiveRef.current && !croppedDeliveryAllowed(shape.mockupIds.length)) croppedActiveRef.current = false;
6594
6606
  sendConfigRaw(
6595
6607
  croppedActiveRef.current ? { ...configPayload, overlayCrop: "auto" } : configPayload
6596
6608
  );