Skip to content
Merged
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
5 changes: 5 additions & 0 deletions packages/pluggable-widgets-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- We updated the transpilation targets for babel to target more recent browsers.

- We changed [System Text XML](https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#text) type to use `namespace` instead of `widgetId`, since we now allow Pluggable Widgets to refer to all system texts.

- We updated the Mendix package to 11.15.


### Fixed

- We fixed an issue with object destructuring assignments caused by a polyfill. (Issue #176)
Expand Down
8 changes: 4 additions & 4 deletions packages/pluggable-widgets-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mendix/pluggable-widgets-tools",
"version": "11.13.0",
"version": "11.15.0",
"description": "Mendix Pluggable Widgets Tools",
"engines": {
"node": "^22.18.0"
Expand Down Expand Up @@ -46,6 +46,8 @@
"@rollup/plugin-typescript": "^12.1.1",
"@rollup/plugin-url": "^8.0.2",
"@rollup/pluginutils": "^5.3.0",
"@swc/core": "^1.10.0",
"@swc/jest": "^0.2.37",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
Expand Down Expand Up @@ -79,7 +81,7 @@
"jest-jasmine2": "~30.5.0",
"jest-junit": "^17.0.0",
"make-dir": "^5.1.0",
"mendix": "^11.8.0",
"mendix": "^11.15.0",
"mime": "^4.1.0",
"postcss": "^8.5.18",
"postcss-import": "^14.0.2",
Expand All @@ -99,8 +101,6 @@
"semver": "^7.3.2",
"shelljs": "^0.10.0",
"shx": "^0.4.0",
"@swc/core": "^1.10.0",
"@swc/jest": "^0.2.37",
"ts-jest": "^29.4.9",
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export interface SystemTextParameter {

export interface ExternalSystemTextNamespace {
$: {
widgetId: string;
namespace: string;
};
text: ExternalSystemText[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const systemProperty = `<systemProperty key="Text">
<parameter caption="Count" />
</parameters>
</text>
<externalTexts widgetId="mendix.textbox.TextBox">
<externalTexts namespace="mendix.textbox.TextBox">
<text key="label" />
<text key="placeholder" />
</externalTexts>
<externalTexts widgetId="mendix.datagrid.DataGrid" />
<externalTexts namespace="mendix.datagrid.DataGrid" />
</systemProperty>`;

export const systemTextsInput = `<?xml version="1.0" encoding="utf-8"?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SystemProperty, TextSystemProperty } from "./WidgetXml";

const STAR = "*" as const;
type Star = typeof STAR;
type Text = { key: string; parameters: string[] } | { widgetId: string; key: Star | string[] };
type Text = { key: string; parameters: string[] } | { namespace: string; key: Star | string[] };

function textsFromSystemProperty(node: SystemProperty): Text[] {
if (!isTextSystemProperty(node)) return [];
Expand All @@ -16,7 +16,7 @@ function textsFromSystemProperty(node: SystemProperty): Text[] {
})),
...(node.externalTexts ?? []).map(e => {
return {
widgetId: e.$.widgetId,
namespace: e.$.namespace,
key: e.text === undefined ? STAR : e.text.map(t => t.$.key)
};
})
Expand All @@ -28,11 +28,11 @@ function isTextSystemProperty(node: SystemProperty): node is TextSystemProperty
}

function generateTextType(t: Text): string {
if ("widgetId" in t) {
if ("namespace" in t) {
if (t.key === STAR) {
return `"${t.widgetId}": [key: string, params?: string[]]`;
return `"${t.namespace}": [key: string, params?: string[]]`;
}
return `"${t.widgetId}": [key: ${t.key.map(key => `"${key}"`).join(" | ")}, params?: string[]]`;
return `"${t.namespace}": [key: ${t.key.map(key => `"${key}"`).join(" | ")}, params?: string[]]`;
}

const parameterTypes = t.parameters.map(p => `${normalizeParameterName(p)}: string`);
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading