@colixsystems/widget-sdk 0.183.0 → 0.184.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
@@ -74,7 +74,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
74
74
 
75
75
  ## Status
76
76
 
77
- `v0.183.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**.
77
+ `v0.184.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**.
78
+
79
+ ### What's new in 0.184.0 (contract 1.145.0)
80
+
81
+ **A page's top navigation bar can put its tabs on the left, in the centre or on the right.** The tab row always started at the left edge, which looks wrong under a centred or right-aligned brand. `resolveTopBarTokens` now returns **`tabAlignment`** (`"left"` | `"center"` | `"right"`), read from `theme_config.topBar.tabAlignment`; anything else, including unset, resolves to `"left"`, so an app that never chose is unchanged. It also returns **`tabRowWidth`** (`"full"` | `"content"`, default `"full"`): the column the tabs sit in. `content` gives the tabs the page content's width and inset, so they line up with it, while the bar's own surface still spans the full width. Both hosts place the tabs with flexible spacers either side rather than by centring the row, so a row with more tabs than fit still scrolls sideways from its first tab instead of cutting it off. Host-integration surface only — no author-facing hook, prop, primitive, or manifest field changed.
78
82
 
79
83
  ### What's new in 0.183.0 (contract 1.144.0)
80
84
 
package/dist/contract.cjs CHANGED
@@ -4803,7 +4803,11 @@ const CONTRACT = deepFreeze({
4803
4803
  // `send_invitation`; `false` stores the invite unsent. Invite rows gain
4804
4804
  // `sent_at` and the `not_sent` status, and `useInvites().resend` is its
4805
4805
  // first send. Omitting the flag emails at once, as before.
4806
- version: "1.144.0",
4806
+ // 1.145.0: additive (sc-10123) — `resolveTopBarTokens` returns
4807
+ // `tabAlignment` ("left" | "center" | "right"), where a local top bar's
4808
+ // tabs sit across the row, and `tabRowWidth` ("full" | "content"), the
4809
+ // column they sit in. Unset resolves to "left" / "full", as before.
4810
+ version: "1.145.0",
4807
4811
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4808
4812
  hooks: HOOKS,
4809
4813
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -4799,7 +4799,11 @@ const CONTRACT = deepFreeze({
4799
4799
  // `send_invitation`; `false` stores the invite unsent. Invite rows gain
4800
4800
  // `sent_at` and the `not_sent` status, and `useInvites().resend` is its
4801
4801
  // first send. Omitting the flag emails at once, as before.
4802
- version: "1.144.0",
4802
+ // 1.145.0: additive (sc-10123) — `resolveTopBarTokens` returns
4803
+ // `tabAlignment` ("left" | "center" | "right"), where a local top bar's
4804
+ // tabs sit across the row, and `tabRowWidth` ("full" | "content"), the
4805
+ // column they sit in. Unset resolves to "left" / "full", as before.
4806
+ version: "1.145.0",
4803
4807
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4804
4808
  hooks: HOOKS,
4805
4809
  primitives: PRIMITIVES,
package/dist/host.d.ts CHANGED
@@ -291,6 +291,11 @@ export interface TopBarTokens {
291
291
  * bar's surface behind an indicator; `attached` cuts the bar away under the
292
292
  * current tab so the page shows through it. */
293
293
  tabStyle: "underline" | "attached";
294
+ /** Where the row's tabs sit across its width; `left` unless authored. */
295
+ tabAlignment: "left" | "center" | "right";
296
+ /** The column the tabs sit in: the whole bar, or the page content's. The
297
+ * bar's surface spans the full width either way. */
298
+ tabRowWidth: "full" | "content";
294
299
  /** Under `attached`, the colour the PANEL behind the row paints — the
295
300
  * authored `tabActiveBackgroundColor`, alpha kept — or null for the page's
296
301
  * own wash. The current tab paints nothing itself. */
@@ -535,6 +535,9 @@ function resolveTopStripeLayout(theme) {
535
535
  };
536
536
  }
537
537
 
538
+ const TAB_ALIGNMENTS = ["left", "center", "right"];
539
+ const TAB_ROW_WIDTHS = ["full", "content"];
540
+
538
541
  function resolveTopBarTokens(theme) {
539
542
  const config = isPlainObject(theme) ? theme : {};
540
543
  const topBar = isPlainObject(config.topBar) ? config.topBar : {};
@@ -566,6 +569,18 @@ function resolveTopBarTokens(theme) {
566
569
  // surface and meets the page beneath it, so the two read as one plane. Meaningless on a shape that draws no tab row — a host
567
570
  // reads it only where it has tabs to draw.
568
571
  tabStyle: topBar.tabStyle === "attached" ? "attached" : "underline",
572
+ // sc-10123: where the row's tabs sit across its width. Both hosts place
573
+ // them with flexible spacers rather than centring the row, so a row that
574
+ // overflows still scrolls from its first tab instead of clipping it.
575
+ tabAlignment: TAB_ALIGNMENTS.includes(topBar.tabAlignment)
576
+ ? topBar.tabAlignment
577
+ : "left",
578
+ // sc-10123: the column the tabs sit in. `full` spans the bar; `content`
579
+ // shares the page content's width and inset, so the tabs line up with it.
580
+ // The bar's surface always spans.
581
+ tabRowWidth: TAB_ROW_WIDTHS.includes(topBar.tabRowWidth)
582
+ ? topBar.tabRowWidth
583
+ : "full",
569
584
  // The surface the PANEL behind an `attached` row paints — the authored
570
585
  // active colour, alpha and all, or nothing. Under `attached` the current
571
586
  // tab itself paints NOTHING: it is a hole in the bar, and what shows
@@ -526,6 +526,9 @@ export function resolveTopStripeLayout(theme) {
526
526
  };
527
527
  }
528
528
 
529
+ const TAB_ALIGNMENTS = ["left", "center", "right"];
530
+ const TAB_ROW_WIDTHS = ["full", "content"];
531
+
529
532
  export function resolveTopBarTokens(theme) {
530
533
  const config = isPlainObject(theme) ? theme : {};
531
534
  const topBar = isPlainObject(config.topBar) ? config.topBar : {};
@@ -557,6 +560,18 @@ export function resolveTopBarTokens(theme) {
557
560
  // surface and meets the page beneath it, so the two read as one plane. Meaningless on a shape that draws no tab row — a host
558
561
  // reads it only where it has tabs to draw.
559
562
  tabStyle: topBar.tabStyle === "attached" ? "attached" : "underline",
563
+ // sc-10123: where the row's tabs sit across its width. Both hosts place
564
+ // them with flexible spacers rather than centring the row, so a row that
565
+ // overflows still scrolls from its first tab instead of clipping it.
566
+ tabAlignment: TAB_ALIGNMENTS.includes(topBar.tabAlignment)
567
+ ? topBar.tabAlignment
568
+ : "left",
569
+ // sc-10123: the column the tabs sit in. `full` spans the bar; `content`
570
+ // shares the page content's width and inset, so the tabs line up with it.
571
+ // The bar's surface always spans.
572
+ tabRowWidth: TAB_ROW_WIDTHS.includes(topBar.tabRowWidth)
573
+ ? topBar.tabRowWidth
574
+ : "full",
560
575
  // The surface the PANEL behind an `attached` row paints — the authored
561
576
  // active colour, alpha and all, or nothing. Under `attached` the current
562
577
  // tab itself paints NOTHING: it is a hole in the bar, and what shows
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.183.0",
3
+ "version": "0.184.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",