Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/pluggable-widgets-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- We added support for the `allowUpload` attribute on image properties in native widgets, generating `EditableImageValue<NativeImage>` when enabled.

### Changed

- We changed the order of imports in generated widget prop types to match that of the eslint sort-imports rule.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const imageNativeOutput = `export interface MyWidgetProps<Style> {
style: Style[];
image: DynamicValue<NativeImage>;
image2?: DynamicValue<NativeImage>;
image3: DynamicValue<NativeImage>;
image3: EditableImageValue<NativeImage>;
description: EditableValue<string>;
action?: ActionValue;
}`;
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ function toClientPropType(
case "icon":
return isNative ? "DynamicValue<NativeIcon>" : "DynamicValue<WebIcon>";
case "image":
return isNative ? "DynamicValue<NativeImage>" : prop.$.allowUpload === "true" ? "EditableImageValue<WebImage>" : "DynamicValue<WebImage>";
if (prop.$.allowUpload === "true") {
return isNative ? "EditableImageValue<NativeImage>" : "EditableImageValue<WebImage>";
}
return isNative ? "DynamicValue<NativeImage>" : "DynamicValue<WebImage>";
case "file":
return prop.$.allowUpload ? "EditableFileValue" : "DynamicValue<FileValue>";
case "datasource":
Expand Down
Loading