diff --git a/packages/pluggable-widgets-tools/package.json b/packages/pluggable-widgets-tools/package.json index b68e7087..21aec125 100644 --- a/packages/pluggable-widgets-tools/package.json +++ b/packages/pluggable-widgets-tools/package.json @@ -1,6 +1,6 @@ { "name": "@mendix/pluggable-widgets-tools", - "version": "11.3.1", + "version": "11.8.0", "description": "Mendix Pluggable Widgets Tools", "engines": { "node": ">=20" @@ -78,7 +78,7 @@ "jest-jasmine2": "^29.0.3", "jest-junit": "^13.0.0", "make-dir": "^3.1.0", - "mendix": "^10.21.64362", + "mendix": "^11.8.0", "mime": "^3.0.0", "node-fetch": "^2.6.1", "postcss": "^8.3.11", diff --git a/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts b/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts index 99656baa..f6220ef6 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/WidgetXml.ts @@ -51,6 +51,7 @@ export interface Property { isDefault?: string; dataSource?: string; onChange?: string; + allowUpload?: string; }; caption?: string[]; category?: string[]; diff --git a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/index.spec.ts b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/index.spec.ts index b628948c..50c894d8 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/index.spec.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/index.spec.ts @@ -45,6 +45,8 @@ import { associationMetaDataNativeInput, associationMetaDataWebInput } from "./i import { associationMetaDataNativeOutput, associationMetaDataWebOutput } from "./outputs/metadata-association"; import {listActionWithVariablesInput, listActionWithVariablesInputNative} from "./inputs/list-action-with-variables"; import {listActionWithVariablesOutput, listActionWithVariablesOutputNative} from "./outputs/list-action-with-variables"; +import {imageWebInput, imageNativeInput} from "./inputs/image"; +import {imageWebOutput, imageNativeOutput} from "./outputs/image"; describe("Generating tests", () => { it("Generates a parsed typing from XML for native", () => { @@ -236,6 +238,16 @@ describe("Generating tests", () => { const newContent = generateNativeTypesFor(associationMetaDataNativeInput); expect(newContent).toBe(associationMetaDataNativeOutput); }); + + it("Generates a parsed typing from XML for web using images", () => { + const newContent = generateFullTypesFor(imageWebInput); + expect(newContent).toBe(imageWebOutput); + }); + + it("Generates a parsed typing from XML for native using images", () => { + const newContent = generateNativeTypesFor(imageNativeInput); + expect(newContent).toBe(imageNativeOutput); + }); }); function generateFullTypesFor(xml: string) { diff --git a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/file.ts b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/file.ts index cb04709c..2cd55cc7 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/file.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/file.ts @@ -12,6 +12,10 @@ export const fileInput = ` File 2 + + File 3 + + @@ -49,6 +53,10 @@ export const fileInputNative = ` File 2 + + File 3 + + diff --git a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/image.ts b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/image.ts new file mode 100644 index 00000000..d649f924 --- /dev/null +++ b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/inputs/image.ts @@ -0,0 +1,81 @@ +export const imageWebInput = ` + + + + + Image + + + + Image 2 + + + + Image 3 + + + + + + Action + + + + + + + Action + + + + + + + + + + +`; + +export const imageNativeInput = ` + + + + + Image + + + + Image 2 + + + + Image 3 + + + + + + Action + + + + + + + Action + + + + + + + + + + +`; diff --git a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/file.ts b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/file.ts index 8be35660..9f1ec7b9 100644 --- a/packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/file.ts +++ b/packages/pluggable-widgets-tools/src/typings-generator/__tests__/outputs/file.ts @@ -3,7 +3,7 @@ export const fileWebOutput = `/** * WARNING: All changes made to this file will be overwritten * @author Mendix Widgets Framework Team */ -import { ActionValue, DynamicValue, EditableValue, FileValue } from "mendix"; +import { ActionValue, DynamicValue, EditableValue, EditableFileValue, FileValue } from "mendix"; export interface MyWidgetContainerProps { name: string; @@ -11,6 +11,7 @@ export interface MyWidgetContainerProps { id: string; file: DynamicValue; file2?: DynamicValue; + file3: EditableFileValue; description: EditableValue; action?: ActionValue; } @@ -21,6 +22,7 @@ export interface MyWidgetPreviewProps { translate: (text: string) => string; file: string; file2: string; + file3: string; description: string; action: {} | null; } @@ -30,6 +32,7 @@ export const fileNativeOutput = `export interface MyWidgetProps