gatsby-matrix-theme 53.27.1 → 53.27.2

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,3 +1,13 @@
1
+ ## [53.27.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.27.1...v53.27.2) (2026-08-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **widget-heights:** reset the posted-height accumulator per rung so each width measures its own height ([fc49529](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/fc4952903f8394f529afa4abb1383ae46936df55))
7
+
8
+
9
+ * Merge branch 'fix/widget-heights-per-rung-measurement' into 'master' ([efc33ff](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/efc33ff80c2ed1bc13554d6a39463a11cc300841))
10
+
1
11
  ## [53.27.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.27.0...v53.27.1) (2026-08-10)
2
12
 
3
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "53.27.1",
3
+ "version": "53.27.2",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -1,2 +1 @@
1
- {"generatedAt":1786353491316,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"Gatsby","packageName":"gatsby","version":"5.13.6"},"monorepo":"Workspaces","packageManager":{"type":"yarn","version":"1.22.19"},"storybookVersion":"6.5.16","language":"javascript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/builder-webpack5":{"version":"6.5.16"},"@storybook/manager-webpack5":{"version":"6.5.16"},"@storybook/react":{"version":"6.5.16"}},"framework":{"name":"react"},"addons":{"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":"6.5.16"}}}
2
- don-measure":{"version":"6.5.16-alpha.0"},"@storybook/addon-outline":{"version":"6.5.16-alpha.0"},"@storybook/addon-storyshots":{"version":"6.5.16-alpha.0"},"@storybook/addon-storyshots-puppeteer":{"version":"6.5.16-alpha.0"},"@storybook/addon-storysource":{"version":"6.5.16-alpha.0"},"@storybook/addon-toolbars":{"version":"6.5.16-alpha.0"},"@storybook/addon-viewport":{"version":"6.5.16-alpha.0"},"@storybook/addons":{"version":"6.5.16-alpha.0"},"@storybook/angular":{"version":"6.5.16-alpha.0"},"@storybook/api":{"version":"6.5.16-alpha.0"},"@storybook/babel-plugin-require-context-hook":{"version":"1.0.1"},"@storybook/channel-postmessage":{"version":"6.5.16-alpha.0"},"@storybook/channel-websocket":{"version":"6.5.16-alpha.0"},"@storybook/channels":{"version":"6.5.16-alpha.0"},"@storybook/cli":{"version":"6.5.16-alpha.0"},"@storybook/client-api":{"version":"6.5.16-alpha.0"},"@storybook/client-logger":{"version":"6.5.16-alpha.0"},"@storybook/codemod":{"version":"6.5.16-alpha.0"},"@storybook/components":{"version":"6.5.16-alpha.0"},"@storybook/core":{"version":"6.5.16-alpha.0"},"@storybook/core-events":{"version":"6.5.16-alpha.0"},"@storybook/csf-tools":{"version":"6.5.16-alpha.0"},"@storybook/docs-tools":{"version":"6.5.16-alpha.0"},"@storybook/ember":{"version":"6.5.16-alpha.0"},"@storybook/eslint-config-storybook":{"version":"2.4.0"},"@storybook/html":{"version":"6.5.16-alpha.0"},"@storybook/instrumenter":{"version":"6.5.16-alpha.0"},"@storybook/jest":{"version":"0.0.5"},"@storybook/linter-config":{"version":"2.5.0"},"@storybook/node-logger":{"version":"6.5.16-alpha.0"},"@storybook/postinstall":{"version":"6.5.16-alpha.0"},"@storybook/preact":{"version":"6.5.16-alpha.0"},"@storybook/preview-web":{"version":"6.5.16-alpha.0"},"@storybook/react":{"version":"6.5.16-alpha.0"},"@storybook/router":{"version":"6.5.16-alpha.0"},"@storybook/semver":{"version":"7.3.2"},"@storybook/server":{"version":"6.5.16-alpha.0"},"@storybook/source-loader":{"version":"6.5.16-alpha.0"},"@storybook/store":{"version":"6.5.16-alpha.0"},"@storybook/svelte":{"version":"6.5.16-alpha.0"},"@storybook/telemetry":{"version":"6.5.16-alpha.0"},"@storybook/testing-library":{"version":"0.0.7"},"@storybook/theming":{"version":"6.5.16-alpha.0"},"@storybook/ui":{"version":"6.5.16-alpha.0"},"@storybook/vue":{"version":"6.5.16-alpha.0"},"@storybook/web-components":{"version":"6.5.16-alpha.0"},"eslint-plugin-storybook":{"version":"0.3.5"}},"framework":{"name":"angular"},"addons":{"@storybook/addon-links":{"version":"6.5.16-alpha.0"},"@storybook/addon-essentials":{"version":"6.5.16-alpha.0"}}}
1
+ {"generatedAt":1786438058415,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"Gatsby","packageName":"gatsby","version":"5.13.6"},"monorepo":"Workspaces","packageManager":{"type":"yarn","version":"1.22.19"},"storybookVersion":"6.5.16","language":"javascript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/builder-webpack5":{"version":"6.5.16"},"@storybook/manager-webpack5":{"version":"6.5.16"},"@storybook/react":{"version":"6.5.16"}},"framework":{"name":"react"},"addons":{"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":"6.5.16"}}}
@@ -140,17 +140,28 @@ async function browserMeasureUrl(url, cfg, reporter) {
140
140
  // PREFERRED signal — the height the widget POSTS via postMessage: the EXACT value the runtime
141
141
  // component applies to size the iframe, so reserving it means zero layout shift. The widget posts
142
142
  // to the top-level window, so a plain top-level load receives it — no embed/origin trickery.
143
- // Track the MAX positive value (mirrors the component resizer: data.height ?? data.frameHeight ??
144
- // data), not the latest, so a transient short post (skeleton/collapse) can't make us under-reserve.
145
143
  // No source check — build-time isn't a security boundary, so a nested-frame post still counts.
144
+ //
145
+ // Two accumulators, because the ladder measures several widths on ONE load:
146
+ // `max` — tallest post since the CURRENT rung began (reset before each resize below). Taking the
147
+ // max within a rung, not the latest, keeps a transient short post (skeleton/collapse)
148
+ // from making that rung under-reserve.
149
+ // `last` — most recent post, never reset. A widget that only posts when its height actually
150
+ // CHANGES goes quiet on a resize that doesn't move it; carrying `last` then reports the
151
+ // unchanged height rather than falling through to the scrollHeight guess.
152
+ // A single running max across the whole load (what this used to be) makes every rung report the
153
+ // tallest height seen so far, so measured ladders come back non-decreasing no matter how the widget
154
+ // actually reflows — which silently collapses every breakpoint onto the narrowest rung's height.
146
155
  await page.addInitScript(() => {
147
- window.whPostedHeight = 0;
156
+ window.whPosted = { max: 0, last: 0 };
148
157
  window.addEventListener('message', (e) => {
149
158
  const d = e.data;
150
159
  let h = d;
151
160
  if (d && typeof d === 'object') h = d.height != null ? d.height : d.frameHeight;
152
161
  const n = Number(h);
153
- if (Number.isFinite(n) && n > window.whPostedHeight) window.whPostedHeight = n;
162
+ if (!Number.isFinite(n) || n <= 0) return;
163
+ window.whPosted.last = n;
164
+ if (n > window.whPosted.max) window.whPosted.max = n;
154
165
  });
155
166
  });
156
167
  await page.goto(target, { waitUntil: 'networkidle', timeout: cfg.perUrlTimeoutMs });
@@ -159,7 +170,7 @@ async function browserMeasureUrl(url, cfg, reporter) {
159
170
  // so a fixed settle alone races it and misses the post, silently dropping to the scrollHeight
160
171
  // fallback. Only if it never posts within the window do we rely on scrollHeight.
161
172
  try {
162
- await page.waitForFunction(() => window.whPostedHeight > 0, null, {
173
+ await page.waitForFunction(() => window.whPosted.last > 0, null, {
163
174
  timeout: Math.min(cfg.perUrlTimeoutMs, 8000),
164
175
  });
165
176
  } catch {
@@ -168,14 +179,21 @@ async function browserMeasureUrl(url, cfg, reporter) {
168
179
 
169
180
  const heights = {};
170
181
  for (const w of cfg.ladder) {
171
- // Resize through the ladder on the ONE load; the widget re-posts on each reflow.
182
+ // Open a fresh measurement window for THIS rung, then resize; the widget re-posts on the reflow.
183
+ // Without the reset every rung would just re-report the tallest post from earlier, narrower rungs.
184
+ await page.evaluate(() => {
185
+ window.whPosted.max = 0;
186
+ });
172
187
  await page.setViewportSize({ width: w, height: VIEWPORT_H });
173
188
  await page.waitForTimeout(cfg.settleMs);
174
- // Prefer the posted height (exact runtime signal); fall back to body.scrollHeight at a full
175
- // viewport it OVER-reserves for a full-height widget (safe) rather than under-reserving.
176
- heights[w] = await page.evaluate(() =>
177
- (window.whPostedHeight > 0 ? window.whPostedHeight : document.body.scrollHeight)
178
- );
189
+ // Prefer this rung's own post; then the last post seen (widget didn't re-post height unchanged);
190
+ // then body.scrollHeight — at a full viewport it OVER-reserves for a full-height widget (safe)
191
+ // rather than under-reserving.
192
+ heights[w] = await page.evaluate(() => {
193
+ const { max, last } = window.whPosted;
194
+ if (max > 0) return max;
195
+ return last > 0 ? last : document.body.scrollHeight;
196
+ });
179
197
  }
180
198
 
181
199
  // Unmeasurable-page guard. If the widget NEVER posted AND every rung reports exactly the viewport
@@ -186,7 +204,7 @@ async function browserMeasureUrl(url, cfg, reporter) {
186
204
  // instead return null → the caller records a failure and the component uses its safe static default.
187
205
  // Log the page's title/text so a blocked page (empty/error) is distinguishable in the build log from
188
206
  // a merely-slow one (which would show real content but have missed the post window).
189
- const posted = await page.evaluate(() => window.whPostedHeight);
207
+ const posted = await page.evaluate(() => window.whPosted.last);
190
208
  if (!posted && cfg.ladder.every((w) => heights[w] === VIEWPORT_H)) {
191
209
  if (reporter && typeof reporter.warn === 'function') {
192
210
  const probe = await page