@colixsystems/widget-sdk 0.145.0 → 0.146.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.
package/README.md CHANGED
@@ -71,7 +71,17 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
71
71
 
72
72
  ## Status
73
73
 
74
- `v0.145.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
74
+ `v0.146.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
75
+
76
+ ### What's new in 0.146.0 (contract 1.114.0)
77
+
78
+ **The chrome divider's width is bounded in the resolver, so both hosts agree (sc-7965).** `resolveFooterTokens` and `resolveSidebarTokens` returned `borderWidth` as any finite number. Only the export bounded it — on its way into the StyleSheet — so a stored `1e9` ruled a **billion-pixel border across the published web app** and a normal one in the exported app. The clamp moved into the shared resolver, where both hosts inherit it.
79
+
80
+ - **Clamped, not dropped.** A value past the end lands **on** the end (1–8), the idiom `tabRadiusOr` / `tabIndicatorOr` already use. This moves the EXPORT too for such a value: it used to *drop* out-of-range and fall back to the 1px hairline, and now renders 8px like the Player.
81
+ - **Zero clamps up**, matching what the export already rendered there — the divider's COLOUR is its switch, so a coloured 0px edge is a contradiction rather than "off".
82
+ - **Every legal 1–8 value is untouched**, and the write path has always refused anything else, so only a hand-edited or pre-coercer `theme_config` can hold a value this moves.
83
+
84
+ The site header was already bounded by its own resolver and is unchanged. The compiler keeps its own `coerceBorderWidth` as defence in depth over a blob `PUT /tenant/config` still stores verbatim; a test pins the two bounds to each other behaviourally, since the SDK cannot import the backend coercer.
75
85
 
76
86
  ### What's new in 0.145.0 (contract 1.113.0)
77
87
 
package/dist/contract.cjs CHANGED
@@ -4054,7 +4054,17 @@ const CONTRACT = deepFreeze({
4054
4054
  // and the inherited colours are hex-guarded on the way out as well as in.
4055
4055
  // Every colour still falls back to the sidebar's: an untouched workspace is
4056
4056
  // unchanged.
4057
- version: "1.113.0",
4057
+ // 1.114.0: behaviour (sc-7965) — `resolveFooterTokens` / `resolveSidebarTokens`
4058
+ // now return a `borderWidth` CLAMPED to 1-8 instead of any finite number.
4059
+ // The bound lived only in the export (`coerceBorderWidth(...) ?? 1`), so a
4060
+ // stored `1e9` ruled a billion-pixel divider across the web Player and a
4061
+ // 1px one in the exported app. Clamped rather than dropped, like the tab
4062
+ // measurements beside it: a value past the end lands ON the end, which also
4063
+ // moves the EXPORT for such a value (it used to drop to the 1px hairline).
4064
+ // Zero clamps up for the same reason the export already rendered 1 there —
4065
+ // the divider's COLOUR is its switch. Every legal 1-8 value is unchanged,
4066
+ // and only a hand-edited or pre-coercer blob can hold anything else.
4067
+ version: "1.114.0",
4058
4068
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4059
4069
  hooks: HOOKS,
4060
4070
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -4050,7 +4050,17 @@ const CONTRACT = deepFreeze({
4050
4050
  // and the inherited colours are hex-guarded on the way out as well as in.
4051
4051
  // Every colour still falls back to the sidebar's: an untouched workspace is
4052
4052
  // unchanged.
4053
- version: "1.113.0",
4053
+ // 1.114.0: behaviour (sc-7965) — `resolveFooterTokens` / `resolveSidebarTokens`
4054
+ // now return a `borderWidth` CLAMPED to 1-8 instead of any finite number.
4055
+ // The bound lived only in the export (`coerceBorderWidth(...) ?? 1`), so a
4056
+ // stored `1e9` ruled a billion-pixel divider across the web Player and a
4057
+ // 1px one in the exported app. Clamped rather than dropped, like the tab
4058
+ // measurements beside it: a value past the end lands ON the end, which also
4059
+ // moves the EXPORT for such a value (it used to drop to the 1px hairline).
4060
+ // Zero clamps up for the same reason the export already rendered 1 there —
4061
+ // the divider's COLOUR is its switch. Every legal 1-8 value is unchanged,
4062
+ // and only a hand-edited or pre-coercer blob can hold anything else.
4063
+ version: "1.114.0",
4054
4064
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4055
4065
  hooks: HOOKS,
4056
4066
  primitives: PRIMITIVES,
@@ -365,11 +365,28 @@ function resolveTopBarTokens(theme) {
365
365
  };
366
366
  }
367
367
 
368
+ // REQ-THEME-LOOK: the divider's width in px, bounded HERE so both hosts inherit
369
+ // one range. The export clamped it on its way into the StyleSheet
370
+ // (`coerceBorderWidth(...) ?? 1`) where the Player passed any finite number
371
+ // straight to a style object, so a stored `1e9` ruled a billion-pixel border
372
+ // across the published web app and a 1px one in the exported one (sc-7965).
373
+ //
374
+ // Clamped rather than dropped, like the tab measurements above: a value past
375
+ // the end lands on the end instead of reverting to the hairline. Zero clamps up
376
+ // for the same reason the export already turned it into one — the divider's
377
+ // COLOUR is its switch, so a coloured 0px edge is a contradiction, not "off".
378
+ const BORDER_WIDTH_MIN = 1;
379
+ const BORDER_WIDTH_MAX = 8;
368
380
  function borderWidthOr(...values) {
369
381
  for (const value of values) {
370
- if (typeof value === "number" && Number.isFinite(value)) return value;
382
+ if (typeof value === "number" && Number.isFinite(value)) {
383
+ return Math.min(
384
+ Math.max(Math.round(value), BORDER_WIDTH_MIN),
385
+ BORDER_WIDTH_MAX,
386
+ );
387
+ }
371
388
  }
372
- return 1;
389
+ return BORDER_WIDTH_MIN;
373
390
  }
374
391
 
375
392
  module.exports = { normaliseNavigation, menuItemCap, resolveFooterTokens, resolveSidebarTokens, resolveTopBarTokens };
@@ -356,9 +356,26 @@ export function resolveTopBarTokens(theme) {
356
356
  };
357
357
  }
358
358
 
359
+ // REQ-THEME-LOOK: the divider's width in px, bounded HERE so both hosts inherit
360
+ // one range. The export clamped it on its way into the StyleSheet
361
+ // (`coerceBorderWidth(...) ?? 1`) where the Player passed any finite number
362
+ // straight to a style object, so a stored `1e9` ruled a billion-pixel border
363
+ // across the published web app and a 1px one in the exported one (sc-7965).
364
+ //
365
+ // Clamped rather than dropped, like the tab measurements above: a value past
366
+ // the end lands on the end instead of reverting to the hairline. Zero clamps up
367
+ // for the same reason the export already turned it into one — the divider's
368
+ // COLOUR is its switch, so a coloured 0px edge is a contradiction, not "off".
369
+ const BORDER_WIDTH_MIN = 1;
370
+ const BORDER_WIDTH_MAX = 8;
359
371
  function borderWidthOr(...values) {
360
372
  for (const value of values) {
361
- if (typeof value === "number" && Number.isFinite(value)) return value;
373
+ if (typeof value === "number" && Number.isFinite(value)) {
374
+ return Math.min(
375
+ Math.max(Math.round(value), BORDER_WIDTH_MIN),
376
+ BORDER_WIDTH_MAX,
377
+ );
378
+ }
362
379
  }
363
- return 1;
380
+ return BORDER_WIDTH_MIN;
364
381
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.145.0",
3
+ "version": "0.146.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "homepage": "https://github.com/Colix-AB/AppStudio",
6
6
  "type": "module",