@colixsystems/widget-sdk 0.250.0 → 0.251.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 +10 -3
- package/dist/contract.cjs +4 -1
- package/dist/contract.js +4 -1
- package/dist/index.d.ts +7 -2
- package/package.json +1 -1
- package/src/contract.js +4 -1
package/README.md
CHANGED
|
@@ -84,7 +84,14 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
84
84
|
|
|
85
85
|
## Status
|
|
86
86
|
|
|
87
|
-
`v0.
|
|
87
|
+
`v0.251.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**.
|
|
88
|
+
|
|
89
|
+
### What's new in 0.251.0 (contract 1.205.0)
|
|
90
|
+
|
|
91
|
+
**A text property's default is real, editable text in the Studio.** The Properties panel used to show a `string` property's `default` as a grey placeholder, so authors took it for a hint and never edited the text the widget actually rendered. It now shows the default as the field's own value. It is still not written until the author edits, so an untouched field keeps following the manifest. Clearing a field that shows a default stores `""`. Your widget gets an empty string and should render it as empty, so read text props with `??`, not `||`. Two `ui` hints are now typed:
|
|
92
|
+
|
|
93
|
+
- `ui.placeholder` — a grey hint shown while the field is empty.
|
|
94
|
+
- `ui.clearRestoresDefault: true` — clearing brings the default back instead of storing `""`. Use it for a caption that must never render blank, such as a button label.
|
|
88
95
|
|
|
89
96
|
### What's new in 0.250.0 (contract 1.204.0)
|
|
90
97
|
|
|
@@ -2089,7 +2096,7 @@ const style = useWidgetStyle();
|
|
|
2089
2096
|
<View style={[styles.card, style.cardBackground && { backgroundColor: style.cardBackground }]}>
|
|
2090
2097
|
```
|
|
2091
2098
|
|
|
2092
|
-
Keep `themeDefault` for a fallback that IS a theme token: it stays display-only (
|
|
2099
|
+
Keep `themeDefault` for a fallback that IS a theme token: it stays display-only (shown in the Style panel field, never written) so the field tracks the workspace theme. Use `default` for a literal constant your code genuinely falls back to — that value now reaches `props.style`, so it must match what your code applies.
|
|
2093
2100
|
|
|
2094
2101
|
### What's new in 0.117.0 (contract 1.89.0)
|
|
2095
2102
|
|
|
@@ -2609,7 +2616,7 @@ Docs-only correction of documented host behaviour: no export, type, runtime, or
|
|
|
2609
2616
|
|
|
2610
2617
|
**`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:
|
|
2611
2618
|
|
|
2612
|
-
- **`themeDefault: "<dotted path into the resolved widget theme>"`** — e.g. `"typography.sizes.lg"`, `"radii.md"`, `"colors.onSurface"`. The Studio
|
|
2619
|
+
- **`themeDefault: "<dotted path into the resolved widget theme>"`** — e.g. `"typography.sizes.lg"`, `"radii.md"`, `"colors.onSurface"`. The Studio shows it in the field, 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()`.
|
|
2613
2620
|
- **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).
|
|
2614
2621
|
- **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.
|
|
2615
2622
|
- **Optional.** A field whose fallback has no fixed value (a `background` that inherits whatever the container paints) declares neither and renders blank.
|
package/dist/contract.cjs
CHANGED
|
@@ -6332,7 +6332,10 @@ const CONTRACT = deepFreeze({
|
|
|
6332
6332
|
// `field-in-bordered-row`, `field-trailing-press-unnamed`.
|
|
6333
6333
|
// 1.204.0: additive (sc-12244) — `<DataTable showHeader>` (default true);
|
|
6334
6334
|
// false drops the wide layout's header row and its sticky index.
|
|
6335
|
-
|
|
6335
|
+
// 1.205.0: additive (sc-11840) — a string property's `default` shows as the
|
|
6336
|
+
// field's editable text and clearing stores ""; `ui.placeholder` and
|
|
6337
|
+
// `ui.clearRestoresDefault` are typed.
|
|
6338
|
+
version: "1.205.0",
|
|
6336
6339
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6337
6340
|
hooks: HOOKS,
|
|
6338
6341
|
primitives: PRIMITIVES,
|
package/dist/contract.js
CHANGED
|
@@ -6328,7 +6328,10 @@ const CONTRACT = deepFreeze({
|
|
|
6328
6328
|
// `field-in-bordered-row`, `field-trailing-press-unnamed`.
|
|
6329
6329
|
// 1.204.0: additive (sc-12244) — `<DataTable showHeader>` (default true);
|
|
6330
6330
|
// false drops the wide layout's header row and its sticky index.
|
|
6331
|
-
|
|
6331
|
+
// 1.205.0: additive (sc-11840) — a string property's `default` shows as the
|
|
6332
|
+
// field's editable text and clearing stores ""; `ui.placeholder` and
|
|
6333
|
+
// `ui.clearRestoresDefault` are typed.
|
|
6334
|
+
version: "1.205.0",
|
|
6332
6335
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6333
6336
|
hooks: HOOKS,
|
|
6334
6337
|
primitives: PRIMITIVES,
|
package/dist/index.d.ts
CHANGED
|
@@ -87,8 +87,8 @@ export interface WidgetPropertyDef {
|
|
|
87
87
|
// sc-1807 / sc-4164 — the value the widget falls back to when this field is
|
|
88
88
|
// unset, as a dotted path into the resolved widget theme
|
|
89
89
|
// (`"typography.sizes.lg"`, `"radii.md"`, `"colors.onSurface"`). The Studio
|
|
90
|
-
// shows it
|
|
91
|
-
// adjusting from; it resolves against the WORKSPACE's theme, so the hint stays
|
|
90
|
+
// shows it in the field (a greyed hint for colours) so the author can see
|
|
91
|
+
// what they are adjusting from; it resolves against the WORKSPACE's theme, so the hint stays
|
|
92
92
|
// truthful after a rebrand. DISPLAY-ONLY — never written into props.style, so
|
|
93
93
|
// a styleSchema field keeps its only-when-set contract. Prefer this over a
|
|
94
94
|
// literal `default` whenever the fallback is a theme token.
|
|
@@ -106,6 +106,11 @@ export interface WidgetPropertyDef {
|
|
|
106
106
|
// a static `default`). Today: `"tabId"` → seed a unique stable id
|
|
107
107
|
// for newly added Tab Layout tabs.
|
|
108
108
|
defaultFactory?: "tabId";
|
|
109
|
+
// string: a grey hint shown while the field is empty.
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
// string: clearing restores `default` instead of storing "" — for a
|
|
112
|
+
// caption that must never render blank (a button label).
|
|
113
|
+
clearRestoresDefault?: boolean;
|
|
109
114
|
};
|
|
110
115
|
validation?: { min?: number; max?: number; pattern?: string };
|
|
111
116
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.251.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",
|
package/src/contract.js
CHANGED
|
@@ -6328,7 +6328,10 @@ const CONTRACT = deepFreeze({
|
|
|
6328
6328
|
// `field-in-bordered-row`, `field-trailing-press-unnamed`.
|
|
6329
6329
|
// 1.204.0: additive (sc-12244) — `<DataTable showHeader>` (default true);
|
|
6330
6330
|
// false drops the wide layout's header row and its sticky index.
|
|
6331
|
-
|
|
6331
|
+
// 1.205.0: additive (sc-11840) — a string property's `default` shows as the
|
|
6332
|
+
// field's editable text and clearing stores ""; `ui.placeholder` and
|
|
6333
|
+
// `ui.clearRestoresDefault` are typed.
|
|
6334
|
+
version: "1.205.0",
|
|
6332
6335
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6333
6336
|
hooks: HOOKS,
|
|
6334
6337
|
primitives: PRIMITIVES,
|