@colixsystems/widget-sdk 0.75.0 → 0.77.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
@@ -54,14 +54,36 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
54
54
 
55
55
  ## Status
56
56
 
57
- `v0.75.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**.
57
+ `v0.77.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**.
58
+
59
+ ### What's new in 0.77.0
60
+
61
+ **`ui.group` is a layout hint, not a visibility rule (sc-4176).** 0.75.0 gave `"Basics"` a reserved meaning: Agent Mode's in-preview edit panel rendered only that group and pointed the author at the Builder for the rest. That withheld styling from an author already editing the widget in front of them, so the reserved behaviour is **retired**.
62
+
63
+ - **Both Style surfaces now render your whole `styleSchema`** — the Builder's Properties panel and the in-preview edit panel show the same fields, as one labelled fieldset per group.
64
+ - **Keep grouping.** It is what makes a 10–12 field Style section readable: "Basics / Card / Title" is three scannable decisions where a flat list is a wall of inputs. Group all your fields or none, name each group after an element the author can see, and keep `"Basics"` for the three whole-widget fields so they read first.
65
+ - **No group name is special any more.** Nothing you put in — or leave out of — a group changes whether an author can reach a field. Do not try to hide an advanced knob by grouping it.
66
+ - **Nothing else changes.** `themeDefault` / `default` placeholders (0.76.0) apply to every field in every group, and an ungrouped `styleSchema` renders exactly as it always has.
67
+
68
+ Docs-only correction of documented host behaviour: no export, type, runtime, or `CONTRACT` field changed; `CONTRACT.version` stays `1.51.0`.
69
+
70
+ ### What's new in 0.76.0
71
+
72
+ **`themeDefault` publishes the value a style field falls back to (sc-4164).** An unset `styleSchema` field rendered as an empty box, so an author adjusting `Title size` could not see the size they were changing. `WidgetPropertyDef` now documents the key the Studio has read since sc-1807:
73
+
74
+ - **`themeDefault: "<dotted path into the resolved widget theme>"`** — e.g. `"typography.sizes.lg"`, `"radii.md"`, `"colors.onSurface"`. The Studio renders it as greyed placeholder text, resolved against the **workspace's** theme, so the hint stays truthful after a rebrand. Prefer it over a literal `default` whenever your fallback is a theme token — which it usually is, since you style from `useTheme()`.
75
+ - **A literal `default`** still works and is the right choice for a hard-coded constant your code carries (`default: 1.4` for a line height you wrote yourself).
76
+ - **Both are DISPLAY-ONLY.** Neither is ever written into `props.style`, so a style field keeps its only-when-set contract and continues to inherit the theme. Declare the value your code actually applies — a baseline that disagrees with the render is worse than none.
77
+ - **Optional.** A field whose fallback has no fixed value (a `background` that inherits whatever the container paints) declares neither and renders blank.
78
+
79
+ Types-only addition: no export, runtime behaviour, or `CONTRACT` field changed; `CONTRACT.version` stays `1.51.0`.
58
80
 
59
81
  ### What's new in 0.75.0
60
82
 
61
83
  **`ui.group: "Basics"` marks a widget's quick style knobs (sc-4100).** A `styleSchema` field has always accepted the `propertySchema` `ui.group` key; the Studio now reads one reserved group name from it, so a widget with several styleable elements can expose per-element controls without burying the two or three an author reaches for first.
62
84
 
63
85
  - **Group every style field, or none of them.** In a grouped `styleSchema`, put the whole-widget basics (`background`, `textColor`, `align`) under the exact group `"Basics"` and each per-element field under a group named for the element it styles (`"Card"`, `"Title"`, `"Chip"`, …). Keep the total under about 12 fields.
64
- - **Where each surface renders.** The Builder's Properties panel renders **every** group. Agent Mode's in-preview edit panel — a quick-tweak surface — renders **only** `"Basics"` and points the author at the Builder for the rest.
86
+ - **Where each surface renders.** ~~The Builder's Properties panel renders **every** group. Agent Mode's in-preview edit panel — a quick-tweak surface — renders **only** `"Basics"` and points the author at the Builder for the rest.~~ **Superseded in 0.77.0:** both surfaces render every group. `ui.group` is a layout hint, not a visibility rule.
65
87
  - **Nothing changes for an ungrouped `styleSchema`.** A flat schema (no `ui.group` anywhere) renders in full in both surfaces exactly as before, so every already-published widget is unaffected. A grouped schema that declares no `"Basics"` group also renders in full — the trim needs a group to trim *to*.
66
88
 
67
89
  No export, type, hook, or `CONTRACT` field changed; `CONTRACT.version` stays `1.51.0`. This is an additive host convention over an existing manifest key.
package/dist/index.d.ts CHANGED
@@ -73,6 +73,15 @@ export interface WidgetPropertyDef {
73
73
  enum?: Array<{ value: unknown; label: string }>;
74
74
  items?: WidgetPropertyDef;
75
75
  properties?: Record<string, WidgetPropertyDef>;
76
+ // sc-1807 / sc-4164 — the value the widget falls back to when this field is
77
+ // unset, as a dotted path into the resolved widget theme
78
+ // (`"typography.sizes.lg"`, `"radii.md"`, `"colors.onSurface"`). The Studio
79
+ // shows it as greyed placeholder text so the author can see what they are
80
+ // adjusting from; it resolves against the WORKSPACE's theme, so the hint stays
81
+ // truthful after a rebrand. DISPLAY-ONLY — never written into props.style, so
82
+ // a styleSchema field keeps its only-when-set contract. Prefer this over a
83
+ // literal `default` whenever the fallback is a theme token.
84
+ themeDefault?: string;
76
85
  ui?: {
77
86
  widget?: "textarea" | "slider" | "code";
78
87
  group?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.75.0",
3
+ "version": "0.77.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",