@colixsystems/widget-sdk 0.130.0 → 0.132.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
@@ -70,11 +70,26 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
70
70
 
71
71
  ## Status
72
72
 
73
- `v0.130.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**.
73
+ `v0.132.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
+
75
+ ### What's new in 0.132.0 (contract 1.102.0)
76
+
77
+ **BREAKING: the top bar has no divider — `resolveTopBarTokens` drops `borderColor` and `borderWidth` (sc-7360).** The bar and its tab row are one surface; a line under the bar ruled it off from its own menu, and a line under the tabs ruled the menu off from the page it navigates. Neither host draws one any more, the Design page offers no colour or width for one, and `TopBarTokens` no longer carries the two fields. A stored `topBar.borderColor` / `borderWidth` is **inert, not migrated** — nothing reads it, and the theme coercer drops it from a saved look or a Mason `set_theme`. The rail's, footer's and site header's dividers are unchanged.
78
+
79
+ - `resolveSidebarTokens` / `resolveFooterTokens` are unchanged. No `CONTRACT` change.
80
+
81
+ ### What's new in 0.131.0 (contract 1.102.0)
82
+
83
+ **`styleGroup(name)` is deprecated and now inert (sc-7344).** The Widget Builder preview's click-to-select mode — the primitive's only reader — has been removed, so nothing maps a clicked element back to its style group any more. Style fields are edited through the whole-widget style editor the gear button opens.
84
+
85
+ - **No migration needed.** `styleGroup()` is still exported and still returns the same props, so existing `<View {...styleGroup("Card")}>` spreads keep building and rendering exactly as before — they are simply no-ops now. It was always a marker that changed nothing about how a widget renders.
86
+ - **Don't add it to new widgets.** The AI widget agent no longer emits it.
74
87
 
75
88
  ### What's new in 0.130.0 (contract 1.101.0)
76
89
 
77
- **New primitive `styleGroup(name)`mark which element a style group paints (sc-7282).** A widget's `styleSchema` already names the element each field belongs to via `ui.group` ("Card", "Title", "Value"), and the Studio renders those as labelled fieldsets. But a group name says which *fieldset* a control sits in, not which *element on screen* it moves — so clicking a button in the Widget Builder preview could only ever open the whole schema.
90
+ **~~New primitive `styleGroup(name)`~~superseded by 0.131.0, see above (sc-7282).** A widget's `styleSchema` already names the element each field belongs to via `ui.group` ("Card", "Title", "Value"), and the Studio renders those as labelled fieldsets. But a group name says which *fieldset* a control sits in, not which *element on screen* it moves — so clicking a button in the Widget Builder preview could only ever open the whole schema.
91
+
92
+ *(Historical — the guidance below no longer applies; see 0.131.0 above.)*
78
93
 
79
94
  - **Spread it on the element each non-Basics group paints:** `<View {...styleGroup("Card")}>`. Pass the EXACT `ui.group` string; a mismatch marks an element no group owns. Mark each group ONCE, on the outermost element an author would point at — never the `"Basics"` group (it paints the whole widget) and never a child of an already-marked element. On a list that repeats a marked element per row, mark every row.
80
95
  - **One module, both hosts.** It rides the existing `dataSet` prop: `react-native-web` maps it to a `data-*` attribute, and real react-native drops it, so the marker is inert on the device rather than a second implementation. It is a marker, not a style — it changes nothing about how a widget renders.
package/dist/contract.cjs CHANGED
@@ -1878,14 +1878,14 @@ const PRIMITIVES = [
1878
1878
  rnComponent: null,
1879
1879
  docsUrl: null,
1880
1880
  },
1881
- // sc-7282 — the element marker. A FUNCTION primitive like pressableLift: it
1882
- // returns props to spread, so ONE declaration marks the element on both
1883
- // hosts. Inert on native (react-native drops `dataSet`), so it costs the
1884
- // device nothing.
1881
+ // sc-7282 — the element marker. sc-7344 removed its only reader (the Widget
1882
+ // Builder preview's click-to-select), so it is now DEPRECATED and inert on
1883
+ // both hosts. Kept exported because it is published API: dropping it would
1884
+ // break widgets already spreading it, and it is a no-op marker either way.
1885
1885
  {
1886
1886
  name: "styleGroup",
1887
1887
  description:
1888
- "Marks WHICH rendered element a styleSchema `ui.group` paints. Spread it on the element: `<View {...styleGroup(\"Card\")}>`. Pass the EXACT group name from your styleSchema `ui.group` character for character, or the click resolves to nothing. The Widget Builder preview reads it to map a clicked element back to its group and show only that group's style fields. Mark the OUTERMOST element of each non-Basics group ONCE; never mark the \"Basics\" group (it paints the whole widget) and never mark a child of an already-marked element. On a list that repeats a marked element per row, mark EVERY row. It is a marker, not a style: it changes nothing about how the widget renders.",
1888
+ "DEPRECATED (sc-7344) do not add it to new widgets. It marked which rendered element a styleSchema `ui.group` painted, for a Widget Builder preview click-to-select that no longer exists. Nothing reads the marker now, so it has no effect on either host. It remains exported and safe: widgets that already spread it keep working the call is a no-op now so no migration is needed. Style fields are edited through the whole-widget style editor.",
1889
1889
  rnComponent: null,
1890
1890
  docsUrl: null,
1891
1891
  },
@@ -3841,7 +3841,17 @@ const CONTRACT = deepFreeze({
3841
3841
  // device — no §8 native-only case and no paired implementation. Purely a
3842
3842
  // marker: it changes nothing about how a widget renders. Minor bump on the
3843
3843
  // pre-1.0 channel.
3844
- version: "1.101.0",
3844
+ // 1.102.0: deprecation (sc-7344) — `styleGroup(name)` is now inert. Its only
3845
+ // reader, the Widget Builder preview's click-to-select mode (sc-7209) and
3846
+ // the per-element style narrowing it fed (sc-7282), is removed: two
3847
+ // controls opened one drawer, and arming the overlay stopped the author
3848
+ // exercising the widget they were previewing. The primitive stays
3849
+ // EXPORTED and unchanged — it is published API and a pure no-op marker, so
3850
+ // widgets already spreading it keep building with no migration (CLAUDE.md
3851
+ // §7: a breaking change to a shipped package needs a reason, and there is
3852
+ // none here). Only the MANDATE to emit it is gone, from the AI widget
3853
+ // agent prompt and the designer skill. Minor bump: nothing removed.
3854
+ version: "1.102.0",
3845
3855
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
3846
3856
  hooks: HOOKS,
3847
3857
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -1878,14 +1878,14 @@ const PRIMITIVES = [
1878
1878
  rnComponent: null,
1879
1879
  docsUrl: null,
1880
1880
  },
1881
- // sc-7282 — the element marker. A FUNCTION primitive like pressableLift: it
1882
- // returns props to spread, so ONE declaration marks the element on both
1883
- // hosts. Inert on native (react-native drops `dataSet`), so it costs the
1884
- // device nothing.
1881
+ // sc-7282 — the element marker. sc-7344 removed its only reader (the Widget
1882
+ // Builder preview's click-to-select), so it is now DEPRECATED and inert on
1883
+ // both hosts. Kept exported because it is published API: dropping it would
1884
+ // break widgets already spreading it, and it is a no-op marker either way.
1885
1885
  {
1886
1886
  name: "styleGroup",
1887
1887
  description:
1888
- "Marks WHICH rendered element a styleSchema `ui.group` paints. Spread it on the element: `<View {...styleGroup(\"Card\")}>`. Pass the EXACT group name from your styleSchema `ui.group` character for character, or the click resolves to nothing. The Widget Builder preview reads it to map a clicked element back to its group and show only that group's style fields. Mark the OUTERMOST element of each non-Basics group ONCE; never mark the \"Basics\" group (it paints the whole widget) and never mark a child of an already-marked element. On a list that repeats a marked element per row, mark EVERY row. It is a marker, not a style: it changes nothing about how the widget renders.",
1888
+ "DEPRECATED (sc-7344) do not add it to new widgets. It marked which rendered element a styleSchema `ui.group` painted, for a Widget Builder preview click-to-select that no longer exists. Nothing reads the marker now, so it has no effect on either host. It remains exported and safe: widgets that already spread it keep working the call is a no-op now so no migration is needed. Style fields are edited through the whole-widget style editor.",
1889
1889
  rnComponent: null,
1890
1890
  docsUrl: null,
1891
1891
  },
@@ -3841,7 +3841,17 @@ const CONTRACT = deepFreeze({
3841
3841
  // device — no §8 native-only case and no paired implementation. Purely a
3842
3842
  // marker: it changes nothing about how a widget renders. Minor bump on the
3843
3843
  // pre-1.0 channel.
3844
- version: "1.101.0",
3844
+ // 1.102.0: deprecation (sc-7344) — `styleGroup(name)` is now inert. Its only
3845
+ // reader, the Widget Builder preview's click-to-select mode (sc-7209) and
3846
+ // the per-element style narrowing it fed (sc-7282), is removed: two
3847
+ // controls opened one drawer, and arming the overlay stopped the author
3848
+ // exercising the widget they were previewing. The primitive stays
3849
+ // EXPORTED and unchanged — it is published API and a pure no-op marker, so
3850
+ // widgets already spreading it keep building with no migration (CLAUDE.md
3851
+ // §7: a breaking change to a shipped package needs a reason, and there is
3852
+ // none here). Only the MANDATE to emit it is gone, from the AI widget
3853
+ // agent prompt and the designer skill. Minor bump: nothing removed.
3854
+ version: "1.102.0",
3845
3855
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
3846
3856
  hooks: HOOKS,
3847
3857
  primitives: PRIMITIVES,
package/dist/host.d.ts CHANGED
@@ -222,13 +222,12 @@ export function resolveSidebarTokens(theme: unknown): SidebarTokens;
222
222
 
223
223
  /** The top app bar's resolved tokens. `tintColor` and `titleColor` are separate
224
224
  * because an unthemed bar paints its icons slate and its app name in the brand
225
- * colour; an authored `topBar.textColor` drives both. */
225
+ * colour; an authored `topBar.textColor` drives both. The bar carries NO
226
+ * divider (sc-7360): a stored `topBar.borderColor` / `borderWidth` is inert. */
226
227
  export interface TopBarTokens {
227
228
  backgroundColor: string;
228
229
  tintColor: string;
229
230
  titleColor: string;
230
- borderColor: string | null;
231
- borderWidth: number | null;
232
231
  /** The current page's mark — the active link's label, and an active tab's
233
232
  * label plus its indicator. Falls back to the RAIL's `activeColor` and then
234
233
  * to the brand, so an app states its navigation colour once. */
package/dist/index.d.ts CHANGED
@@ -2681,12 +2681,12 @@ export function pressableLift(state?: {
2681
2681
  }): Array<Record<string, unknown> | null>;
2682
2682
 
2683
2683
  /**
2684
- * sc-7282marks WHICH rendered element a styleSchema `ui.group` paints, so
2685
- * the Widget Builder preview can show only that group's style fields when the
2686
- * element is clicked. Spread it: `<View {...styleGroup("Card")}>`.
2684
+ * @deprecated (sc-7344)inert; nothing reads the marker. It marked which
2685
+ * rendered element a styleSchema `ui.group` painted, for a Widget Builder
2686
+ * preview click-to-select that no longer exists. Still exported and safe:
2687
+ * existing spreads keep working as no-ops, so no migration is needed.
2687
2688
  *
2688
- * `name` must be the EXACT `ui.group` string. A missing or blank name returns
2689
- * `undefined`, so spreading the result is always safe.
2689
+ * A missing or blank name returns `undefined`, so spreading is always safe.
2690
2690
  */
2691
2691
  export function styleGroup(
2692
2692
  name: string,
@@ -281,7 +281,9 @@ function resolveSidebarTokens(theme) {
281
281
  }
282
282
 
283
283
  /**
284
- * The top app bar's surface, its two text colours and its opt-in divider.
284
+ * The top app bar's surface and its two text colours. It has NO divider
285
+ * (sc-7360): the bar and its tab row sit in one surface, so a stored divider
286
+ * colour or width on the block is inert on both hosts.
285
287
  *
286
288
  * `tintColor` and `titleColor` are SEPARATE because the web bar has always
287
289
  * painted them differently when the author names nothing: the hamburger and
@@ -295,13 +297,11 @@ function resolveSidebarTokens(theme) {
295
297
  * @param {unknown} theme — the whole `theme_config`; the app's
296
298
  * `backgroundColor`/`backgroundGradient` are read because an unset surface
297
299
  * resolves to the page's, as an `attached` tab's already did (sc-6596).
298
- * @returns {{ backgroundColor: string, tintColor: string, titleColor: string,
299
- * borderColor: string|null, borderWidth: number|null }}
300
+ * @returns {{ backgroundColor: string, tintColor: string, titleColor: string }}
300
301
  */
301
302
  function resolveTopBarTokens(theme) {
302
303
  const config = isPlainObject(theme) ? theme : {};
303
304
  const topBar = isPlainObject(config.topBar) ? config.topBar : {};
304
- const borderColor = hexOrNull(topBar.borderColor);
305
305
  // An explicit colour drives BOTH slots; only the unset case splits.
306
306
  const authored = hexOrNull(topBar.textColor);
307
307
  return {
@@ -324,13 +324,10 @@ function resolveTopBarTokens(theme) {
324
324
  topBar.activeColor,
325
325
  hexOr(sidebarBlock(config).activeColor, brandPrimary(config)),
326
326
  ),
327
- borderColor,
328
- borderWidth: borderColor ? borderWidthOr(topBar.borderWidth) : null,
329
327
  // REQ-NAV-STRUCTURE: how the tab row marks its current page.
330
328
  // `underline` keeps the tab in the bar's surface and marks it with an
331
329
  // indicator. `attached` makes it a real folder tab: it takes the CONTENT's
332
- // surface and sits over the row's divider, so the tab and the page beneath
333
- // read as one plane. Meaningless on a shape that draws no tab row — a host
330
+ // 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
334
331
  // reads it only where it has tabs to draw.
335
332
  tabStyle: topBar.tabStyle === "attached" ? "attached" : "underline",
336
333
  // The surface an `attached` tab AND its content panel share. One value for
@@ -272,7 +272,9 @@ export function resolveSidebarTokens(theme) {
272
272
  }
273
273
 
274
274
  /**
275
- * The top app bar's surface, its two text colours and its opt-in divider.
275
+ * The top app bar's surface and its two text colours. It has NO divider
276
+ * (sc-7360): the bar and its tab row sit in one surface, so a stored divider
277
+ * colour or width on the block is inert on both hosts.
276
278
  *
277
279
  * `tintColor` and `titleColor` are SEPARATE because the web bar has always
278
280
  * painted them differently when the author names nothing: the hamburger and
@@ -286,13 +288,11 @@ export function resolveSidebarTokens(theme) {
286
288
  * @param {unknown} theme — the whole `theme_config`; the app's
287
289
  * `backgroundColor`/`backgroundGradient` are read because an unset surface
288
290
  * resolves to the page's, as an `attached` tab's already did (sc-6596).
289
- * @returns {{ backgroundColor: string, tintColor: string, titleColor: string,
290
- * borderColor: string|null, borderWidth: number|null }}
291
+ * @returns {{ backgroundColor: string, tintColor: string, titleColor: string }}
291
292
  */
292
293
  export function resolveTopBarTokens(theme) {
293
294
  const config = isPlainObject(theme) ? theme : {};
294
295
  const topBar = isPlainObject(config.topBar) ? config.topBar : {};
295
- const borderColor = hexOrNull(topBar.borderColor);
296
296
  // An explicit colour drives BOTH slots; only the unset case splits.
297
297
  const authored = hexOrNull(topBar.textColor);
298
298
  return {
@@ -315,13 +315,10 @@ export function resolveTopBarTokens(theme) {
315
315
  topBar.activeColor,
316
316
  hexOr(sidebarBlock(config).activeColor, brandPrimary(config)),
317
317
  ),
318
- borderColor,
319
- borderWidth: borderColor ? borderWidthOr(topBar.borderWidth) : null,
320
318
  // REQ-NAV-STRUCTURE: how the tab row marks its current page.
321
319
  // `underline` keeps the tab in the bar's surface and marks it with an
322
320
  // indicator. `attached` makes it a real folder tab: it takes the CONTENT's
323
- // surface and sits over the row's divider, so the tab and the page beneath
324
- // read as one plane. Meaningless on a shape that draws no tab row — a host
321
+ // 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
325
322
  // reads it only where it has tabs to draw.
326
323
  tabStyle: topBar.tabStyle === "attached" ? "attached" : "underline",
327
324
  // The surface an `attached` tab AND its content panel share. One value for
@@ -1,6 +1,9 @@
1
- // sc-7282 — marks WHICH rendered element a styleSchema `ui.group` paints, so
2
- // the Widget Builder preview can map a clicked node back to its group and show
3
- // only that group's style fields.
1
+ // sc-7282 — marked WHICH rendered element a styleSchema `ui.group` paints.
2
+ //
3
+ // DEPRECATED (sc-7344): its only reader, the Widget Builder preview's
4
+ // click-to-select, is gone, so the marker is now inert. Kept exported because
5
+ // it is published API and a no-op — widgets already spreading it need no
6
+ // migration (CLAUDE.md §7). Do not add it to new widgets.
4
7
  //
5
8
  // ONE file, no `.native.js` twin: `react-native-web` maps `dataSet` to `data-*`
6
9
  // attributes while real react-native drops the prop, so the marker is inert on
@@ -16,11 +19,10 @@
16
19
  export const STYLE_GROUP_DATA_KEY = "styleGroup";
17
20
 
18
21
  /**
19
- * Props marking the element a style group paints. Spread it:
20
- * `<View {...styleGroup("Card")}>`.
22
+ * @deprecated (sc-7344) inert; nothing reads the marker.
21
23
  *
22
- * `name` must be the EXACT `ui.group` string from the widget's styleSchema — a
23
- * mismatch marks an element no group owns, and the click resolves to nothing.
24
+ * Props marking the element a style group paints. Still returns the same shape,
25
+ * so existing spreads keep working as no-ops.
24
26
  *
25
27
  * Returns `undefined` for a missing or blank name so `{...styleGroup(x)}` stays
26
28
  * safe when `x` is absent: spreading `undefined` is a no-op in JSX.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.130.0",
3
+ "version": "0.132.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",