@colixsystems/widget-sdk 0.27.0 → 0.28.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
@@ -46,7 +46,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
46
46
 
47
47
  ## Status
48
48
 
49
- `v0.27.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**.
49
+ `v0.28.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.28.0
52
+
53
+ **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
54
 
51
55
  ### What's new in 0.27.0
52
56
 
package/dist/index.d.ts CHANGED
@@ -41,6 +41,8 @@ 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"
44
46
  | "expression"
45
47
  | "eventBinding"
46
48
  | "object"
@@ -30,6 +30,11 @@ 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",
33
38
  "expression", "eventBinding",
34
39
  "object", "array",
35
40
  ]);
@@ -114,6 +119,7 @@ function coerceLeaf(def, value, path, errors) {
114
119
  case "groupRef":
115
120
  case "pageRef":
116
121
  case "richText":
122
+ case "asset":
117
123
  case "expression":
118
124
  case "eventBinding":
119
125
  if (typeof value !== "string") errors.push(`${path}: expected string`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.27.0",
3
+ "version": "0.28.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",