@malloy-publisher/server 0.2.6 → 0.3.0

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.
Files changed (27) hide show
  1. package/dist/app/api-doc.yaml +39 -1
  2. package/dist/app/assets/{EnvironmentPage-BAegPFOF.js → EnvironmentPage-D6kQraU3.js} +1 -1
  3. package/dist/app/assets/{HomePage-DpDWLD0m.js → HomePage-BZbuE5jv.js} +1 -1
  4. package/dist/app/assets/{LightMode-CAFl4Cvr.js → LightMode-BxZdPcNr.js} +1 -1
  5. package/dist/app/assets/{MainPage-DBHZF__d.js → MainPage-DrczCw4J.js} +2 -2
  6. package/dist/app/assets/{MaterializationsPage-DS5Wrhkc.js → MaterializationsPage-BFLHLEuk.js} +1 -1
  7. package/dist/app/assets/ModelPage-CFnfQ6BL.js +1 -0
  8. package/dist/app/assets/{PackagePage-D5gz7Abx.js → PackagePage-DHsVf_mP.js} +1 -1
  9. package/dist/app/assets/{RouteError-BE1pcxrx.js → RouteError-CHq8ubhy.js} +1 -1
  10. package/dist/app/assets/{ThemeEditorPage-CiRxkL1D.js → ThemeEditorPage-B2y8Y64Y.js} +1 -1
  11. package/dist/app/assets/core-B8oMW4sm.es-hOkwvru5.js +148 -0
  12. package/dist/app/assets/index-BVv6KQ93.js +557 -0
  13. package/dist/app/assets/{index-73xxtSWr.js → index-Bqrhk3ff.js} +1 -1
  14. package/dist/app/assets/{index-C22pKyUm.js → index-By-g8wiC.js} +1 -1
  15. package/dist/app/assets/{index-BVkVGR63.js → index-CawCwLK3.js} +1 -1
  16. package/dist/app/assets/index-DUqldpo0.css +1 -0
  17. package/dist/app/index.html +2 -2
  18. package/dist/instrumentation.mjs +62738 -42960
  19. package/dist/package_load_worker.mjs +1653 -1557
  20. package/dist/runtime/publisher.js +60 -14
  21. package/dist/server.mjs +61680 -40017
  22. package/package.json +1 -1
  23. package/dist/app/assets/ModelPage-BE19OgP9.js +0 -1
  24. package/dist/app/assets/WorkbookPage-Czc9IG0b.js +0 -1
  25. package/dist/app/assets/core-xdZbLgaF.es-BGrT15Sy.js +0 -148
  26. package/dist/app/assets/index-5eLCcNmP.css +0 -1
  27. package/dist/app/assets/index-DcYLvDJ2.js +0 -632
@@ -251,27 +251,73 @@
251
251
  var pad = parseFloat(bodyStyle.paddingBottom) || 0;
252
252
  return Math.ceil(maxBottom + scrollTop + pad);
253
253
  }
254
- function postSize() {
254
+ // Smallest SHRINK worth reporting. measureContentHeight already ceils,
255
+ // so nothing sub-pixel reaches here; what this absorbs is a 1-2px
256
+ // rounding flip-flop between two layout passes, which the host cannot
257
+ // act on without the resize itself becoming a layout change inside this
258
+ // frame — the feedback loop.
259
+ //
260
+ // Applied to shrinks ONLY, deliberately. A frame a few pixels too tall
261
+ // shows dead space; a few pixels too short CLIPS, and the frame has no
262
+ // internal scrollbar. The asymmetry also stops the two sides' bands
263
+ // compounding: the host runs its own epsilon against ITS height, which
264
+ // its MIN clamp guarantees can differ from lastHeight here, so two
265
+ // symmetric 8px bands leave a dead zone wider than either. Growing at
266
+ // 1px precision keeps the host's band the only one that applies.
267
+ var RESIZE_EPSILON = 8;
268
+ var resizePending = false;
269
+
270
+ function emitSize() {
255
271
  var h = measureContentHeight();
256
- if (h !== lastHeight) {
257
- lastHeight = h;
258
- try {
259
- window.parent.postMessage(
260
- { type: "publisher:resize", height: h },
261
- "*",
262
- );
263
- } catch (_e) {
264
- /* ignore */
265
- }
272
+ if (h < lastHeight && lastHeight - h < RESIZE_EPSILON) return;
273
+ if (h === lastHeight) return;
274
+ lastHeight = h;
275
+ try {
276
+ window.parent.postMessage(
277
+ { type: "publisher:resize", height: h },
278
+ "*",
279
+ );
280
+ } catch (_e) {
281
+ /* ignore */
266
282
  }
267
283
  }
284
+
285
+ // Coalesce a burst into one message per frame.
286
+ //
287
+ // ResizeObserver on documentElement fires on EVERY layout change, so a
288
+ // dashboard whose tiles resolve one by one used to post a height per
289
+ // tile. The host resized on each, which is what made an embedded app
290
+ // visibly jitter while it loaded. Same `pending`-flag idiom as the SSE
291
+ // reload debounce below; rAF rather than a timeout because the next
292
+ // paint is exactly when a coalesced layout is worth measuring.
293
+ //
294
+ // Trailing edge, not leading: the last measurement in a burst is the
295
+ // settled one, and reporting the first would send a stale height.
296
+ function postSize() {
297
+ if (resizePending) return;
298
+ resizePending = true;
299
+ var schedule =
300
+ typeof requestAnimationFrame === "function"
301
+ ? requestAnimationFrame
302
+ : function (fn) {
303
+ setTimeout(fn, 16);
304
+ };
305
+ schedule(function () {
306
+ resizePending = false;
307
+ emitSize();
308
+ });
309
+ }
268
310
  // Initial + observe content changes
311
+ // The first report goes out synchronously: the host shows a
312
+ // MIN_EMBED_HEIGHT placeholder until one arrives, so deferring it by a
313
+ // frame would leave a collapsed frame for no benefit. Only the bursts
314
+ // that follow need coalescing.
269
315
  if (document.readyState === "loading") {
270
- document.addEventListener("DOMContentLoaded", postSize);
316
+ document.addEventListener("DOMContentLoaded", emitSize);
271
317
  } else {
272
- postSize();
318
+ emitSize();
273
319
  }
274
- window.addEventListener("load", postSize);
320
+ window.addEventListener("load", emitSize);
275
321
  if (typeof ResizeObserver !== "undefined") {
276
322
  var ro = new ResizeObserver(postSize);
277
323
  // Observe documentElement so we catch any layout change