@colixsystems/widget-sdk 0.27.0 → 0.29.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 +9 -1
- package/dist/index.d.ts +4 -0
- package/dist/property-schema.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,15 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
46
46
|
|
|
47
47
|
## Status
|
|
48
48
|
|
|
49
|
-
`v0.
|
|
49
|
+
`v0.29.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**.
|
|
50
|
+
|
|
51
|
+
### What's new in 0.29.0
|
|
52
|
+
|
|
53
|
+
**New `assetList` propertySchema type + `ui.showWhen` `neq`/`in` + `ui.step` (REQ-WDG-ASSET).** `assetList` is the multi-pick form of `asset` — an ordered array of bare File UUIDs rendered with the Asset Manager `MultiFileSelector` (selection order preserved; narrow with `ui.mimeFilter`). tenant-copy remaps each id. `ui.showWhen` now accepts `{ neq }` and `{ in: [...] }` alongside `{ eq }`; `ui.step` sets the numeric input/slider step. Additive — no existing export or type changed.
|
|
54
|
+
|
|
55
|
+
### What's new in 0.28.0
|
|
56
|
+
|
|
57
|
+
**New `asset` propertySchema type + `ui.showWhen` (REQ-WDG-ASSET).** `asset` is a file/asset picker that stores a bare File UUID and renders the Asset Manager `FileSelector` in the Studio Properties Panel (narrow it with `ui.mimeFilter`, e.g. `"image"`). `ui.showWhen: { field, eq }` conditionally hides a field unless a sibling field equals a value (e.g. show the asset picker only when `imageSource === "asset"`). tenant-copy remaps an `asset` File UUID to the copied file. Additive — no existing export or type changed.
|
|
50
58
|
|
|
51
59
|
### What's new in 0.27.0
|
|
52
60
|
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ export type WidgetPropertyType =
|
|
|
41
41
|
| "pageRef"
|
|
42
42
|
// REQ-WDG-RICHTEXT: rich-text (HTML string) edited via a Tiptap editor.
|
|
43
43
|
| "richText"
|
|
44
|
+
// REQ-WDG-ASSET: file/asset picker → bare File UUID (Asset Manager picker).
|
|
45
|
+
| "asset"
|
|
46
|
+
// REQ-WDG-ASSET: ordered multi-file picker → Array<File UUID>.
|
|
47
|
+
| "assetList"
|
|
44
48
|
| "expression"
|
|
45
49
|
| "eventBinding"
|
|
46
50
|
| "object"
|
package/dist/property-schema.js
CHANGED
|
@@ -30,6 +30,16 @@ const VALID_TYPES = new Set([
|
|
|
30
30
|
// Tiptap editor in the Studio Properties Panel; the widget renders the
|
|
31
31
|
// sanitised HTML. Stored as a string, so no tenant-copy remap is needed.
|
|
32
32
|
"richText",
|
|
33
|
+
// REQ-WDG-ASSET: `asset` is a file/asset picker. Stores a bare File UUID;
|
|
34
|
+
// renders the Asset Manager FileSelector in the Studio Properties Panel
|
|
35
|
+
// (an `ui.mimeFilter` narrows it, e.g. "image"). tenant-copy remaps the id
|
|
36
|
+
// through the layout walk's fileId map.
|
|
37
|
+
"asset",
|
|
38
|
+
// REQ-WDG-ASSET: `assetList` is the multi-pick form of `asset` — an ordered
|
|
39
|
+
// array of bare File UUIDs (the Asset Manager multi-picker preserves
|
|
40
|
+
// selection order). Renders `MultiFileSelector` in the Studio Properties
|
|
41
|
+
// Panel; tenant-copy remaps each id through the layout walk's fileId map.
|
|
42
|
+
"assetList",
|
|
33
43
|
"expression", "eventBinding",
|
|
34
44
|
"object", "array",
|
|
35
45
|
]);
|
|
@@ -114,6 +124,7 @@ function coerceLeaf(def, value, path, errors) {
|
|
|
114
124
|
case "groupRef":
|
|
115
125
|
case "pageRef":
|
|
116
126
|
case "richText":
|
|
127
|
+
case "asset":
|
|
117
128
|
case "expression":
|
|
118
129
|
case "eventBinding":
|
|
119
130
|
if (typeof value !== "string") errors.push(`${path}: expected string`);
|
|
@@ -138,6 +149,15 @@ function coerceLeaf(def, value, path, errors) {
|
|
|
138
149
|
errors.push(`${path}: value not in enum`);
|
|
139
150
|
}
|
|
140
151
|
return value;
|
|
152
|
+
case "assetList":
|
|
153
|
+
if (!Array.isArray(value)) {
|
|
154
|
+
errors.push(`${path}: expected array`);
|
|
155
|
+
} else {
|
|
156
|
+
value.forEach((v, i) => {
|
|
157
|
+
if (typeof v !== "string") errors.push(`${path}[${i}]: expected string`);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return value;
|
|
141
161
|
case "multiselect":
|
|
142
162
|
if (!Array.isArray(value)) {
|
|
143
163
|
errors.push(`${path}: expected array`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.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",
|