@snowcone-app/ui 0.4.13 → 0.4.14

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1638](https://github.com/snowcone-app/snowcone-monorepo/pull/1638) [`045645a`](https://github.com/snowcone-app/snowcone-monorepo/commit/045645ae6d9d7683bc0cb8b487da9440af151ef2) Thanks [@kevinsproles](https://github.com/kevinsproles)! - CanvasExportService: the first canvas change after idle is sent to the realtime renderer immediately (leading edge) instead of waiting for the 300ms settle. Editor actions emit two state changes ~250ms apart, so the trailing-only debounce left ~550ms of dead time before anything was sent; the settled state still follows as before.
8
+
3
9
  ## 0.4.13
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -8919,6 +8919,16 @@ var CanvasExportService = class _CanvasExportService {
8919
8919
  this.sendStateNow(state);
8920
8920
  return;
8921
8921
  }
8922
+ const isIdle = !this.stateChangeThrottleTimeout && (!hasSentBefore || timeSinceLastSend >= settleMs);
8923
+ if (isIdle) {
8924
+ console.log(`[CES] handleStateChange #${callId}: LEADING send (idle ${hasSentBefore ? timeSinceLastSend : "forever"}ms)`);
8925
+ this.sendStateNow(state);
8926
+ this.stateChangeThrottleTimeout = setTimeout(() => {
8927
+ this.stateChangeThrottleTimeout = null;
8928
+ if (this.pendingCanvasState) this.sendStateNow(this.pendingCanvasState);
8929
+ }, settleMs);
8930
+ return;
8931
+ }
8922
8932
  if (this.stateChangeThrottleTimeout) {
8923
8933
  clearTimeout(this.stateChangeThrottleTimeout);
8924
8934
  }