@snowcone-app/ui 0.11.9 → 0.11.10
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 +9 -0
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/patterns/RealtimeProvider.tsx +10 -0
- package/src/patterns/__tests__/RealtimeProvider.blobLifecycle.test.tsx +5 -0
- package/src/patterns/__tests__/RealtimeProvider.croppedLimit.test.tsx +171 -0
- package/src/patterns/croppedDeliveryLimit.ts +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#6396](https://github.com/snowcone-app/snowcone-monorepo/pull/6396) [`bbd0cc4`](https://github.com/snowcone-app/snowcone-monorepo/commit/bbd0cc442607ee2fd2ebdb0007f32aa91bf72365) Thanks [@kevinsproles](https://github.com/kevinsproles)! - RealtimeProvider: a realtime session holding more than 5 mockups stays on full-frame delivery instead of turning on cropped delivery (`overlayCrop: "auto"`). A stopgap for #6369 (the render boxes stall on cropped renders from about 10 mockups a session); named in `croppedDeliveryLimit.ts` and removed once the box-side fix is rolled. Sessions of 5 or fewer mockups (phone pages) are unchanged.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`88db704`](https://github.com/snowcone-app/snowcone-monorepo/commit/88db7044a04c2d43b4de871adddc16411effeed5)]:
|
|
10
|
+
- @snowcone-app/sdk@0.31.15
|
|
11
|
+
|
|
3
12
|
## 0.11.9
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -6110,6 +6110,12 @@ async function compositeCroppedFrame(args) {
|
|
|
6110
6110
|
return blob;
|
|
6111
6111
|
}
|
|
6112
6112
|
|
|
6113
|
+
// src/patterns/croppedDeliveryLimit.ts
|
|
6114
|
+
var CROPPED_DELIVERY_MAX_MOCKUPS = 5;
|
|
6115
|
+
function croppedDeliveryAllowed(mockupCount) {
|
|
6116
|
+
return mockupCount <= CROPPED_DELIVERY_MAX_MOCKUPS;
|
|
6117
|
+
}
|
|
6118
|
+
|
|
6113
6119
|
// src/patterns/RealtimeProvider.tsx
|
|
6114
6120
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6115
6121
|
var DEFAULT_ARTBOARD_SIZE = 2e3;
|
|
@@ -6498,6 +6504,10 @@ function RealtimeProvider({
|
|
|
6498
6504
|
const base = lastConfigBaseRef.current;
|
|
6499
6505
|
if (!base) return;
|
|
6500
6506
|
const ids = base.mockupIds ?? [];
|
|
6507
|
+
if (!croppedDeliveryAllowed(ids.length)) {
|
|
6508
|
+
console.log(`[RTP] Cropped delivery OFF: ${ids.length} mockups > ${CROPPED_DELIVERY_MAX_MOCKUPS} (#6369 stopgap, full-frame frames)`);
|
|
6509
|
+
return;
|
|
6510
|
+
}
|
|
6501
6511
|
const seeded = new Set(backgroundsRef.current.keys());
|
|
6502
6512
|
if (allBackgroundsSeeded(ids, seeded)) {
|
|
6503
6513
|
console.log(`[RTP] Cropped delivery ON \u2014 all ${ids.length} mockup background(s) seeded`);
|
|
@@ -6557,6 +6567,7 @@ function RealtimeProvider({
|
|
|
6557
6567
|
base.mockupIds = shape.mockupIds;
|
|
6558
6568
|
base.width = shape.width;
|
|
6559
6569
|
requestedMockupIdsRef.current = [...shape.mockupIds];
|
|
6570
|
+
if (croppedActiveRef.current && !croppedDeliveryAllowed(shape.mockupIds.length)) croppedActiveRef.current = false;
|
|
6560
6571
|
sendConfigRaw({
|
|
6561
6572
|
...base,
|
|
6562
6573
|
placementSettings: { ...placementSettingsOverridesRef.current },
|
|
@@ -6964,6 +6975,7 @@ function RealtimeProvider({
|
|
|
6964
6975
|
}
|
|
6965
6976
|
lastConfigBaseRef.current = configPayload;
|
|
6966
6977
|
requestedMockupIdsRef.current = [...shape.mockupIds];
|
|
6978
|
+
if (croppedActiveRef.current && !croppedDeliveryAllowed(shape.mockupIds.length)) croppedActiveRef.current = false;
|
|
6967
6979
|
sendConfigRaw(
|
|
6968
6980
|
croppedActiveRef.current ? { ...configPayload, overlayCrop: "auto" } : configPayload
|
|
6969
6981
|
);
|