@colixsystems/widget-sdk 0.74.0 → 0.76.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 +22 -1
- package/dist/index.d.ts +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,28 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
54
54
|
|
|
55
55
|
## Status
|
|
56
56
|
|
|
57
|
-
`v0.
|
|
57
|
+
`v0.76.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.76.0
|
|
60
|
+
|
|
61
|
+
**`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:
|
|
62
|
+
|
|
63
|
+
- **`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()`.
|
|
64
|
+
- **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).
|
|
65
|
+
- **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.
|
|
66
|
+
- **Optional.** A field whose fallback has no fixed value (a `background` that inherits whatever the container paints) declares neither and renders blank.
|
|
67
|
+
|
|
68
|
+
Types-only addition: no export, runtime behaviour, or `CONTRACT` field changed; `CONTRACT.version` stays `1.51.0`.
|
|
69
|
+
|
|
70
|
+
### What's new in 0.75.0
|
|
71
|
+
|
|
72
|
+
**`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.
|
|
73
|
+
|
|
74
|
+
- **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.
|
|
75
|
+
- **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.
|
|
76
|
+
- **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*.
|
|
77
|
+
|
|
78
|
+
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.
|
|
58
79
|
|
|
59
80
|
### What's new in 0.74.0
|
|
60
81
|
|
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.
|
|
3
|
+
"version": "0.76.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",
|