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
138 changes: 138 additions & 0 deletions package-lock.json

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

10 changes: 10 additions & 0 deletions packages/pluggableWidgets/rich-text-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- We added character count options to the status bar to help users understand content length requirements and avoid validation failures when rich text HTML markup exceeds database attribute limits.

- We added a configuration to set default font-family and font-size when there are no other value currently selected in the toolbar.

### Fixed

- We fixed the issue that image uploader not able to show.

## [4.9.0] - 2025-09-03

### Added
Expand Down
3 changes: 2 additions & 1 deletion packages/pluggableWidgets/rich-text-web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mendix/rich-text-web",
"widgetName": "RichText",
"version": "4.9.0",
"version": "4.10.0",
"description": "Rich inline or toolbar text editing",
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -44,6 +44,7 @@
},
"dependencies": {
"@codemirror/lang-html": "^6.4.9",
"@codemirror/state": "^6.5.2",
"@floating-ui/react": "^0.26.27",
"@melloware/coloris": "^0.25.0",
"@uiw/codemirror-theme-github": "^4.23.13",
Expand Down
17 changes: 17 additions & 0 deletions packages/pluggableWidgets/rich-text-web/src/RichText.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@
<caption>Enable spell checking</caption>
<description />
</property>
<property key="defaultFontFamily" type="textTemplate" required="false">
<caption>Default font family</caption>
<description />
</property>
<property key="defaultFontSize" type="textTemplate" required="false">
<caption>Default font size</caption>
<description />
</property>
<property key="customFonts" type="object" isList="true" required="false">
<caption>Custom fonts</caption>
<description />
Expand Down Expand Up @@ -199,6 +207,15 @@
<caption>Enable default upload</caption>
<description />
</property>
<property key="statusBarContent" type="enumeration" defaultValue="wordCount">
<caption>Status bar content</caption>
<description>Choose what to display in the status bar</description>
<enumerationValues>
<enumerationValue key="wordCount">Word count</enumerationValue>
<enumerationValue key="characterCount">Character count (text only)</enumerationValue>
<enumerationValue key="characterCountHtml">Character count (including HTML)</enumerationValue>
</enumerationValues>
</property>
</propertyGroup>
</propertyGroup>
<propertyGroup caption="Custom toolbar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EditableValueBuilder } from "@mendix/widget-plugin-test-utils";
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { createElement } from "react";
import { RichTextContainerProps } from "../../typings/RichTextProps";
import { RichTextContainerProps, StatusBarContentEnum } from "../../typings/RichTextProps";

import RichText from "../RichText";

Expand Down Expand Up @@ -38,6 +38,7 @@ describe("Rich Text", () => {
tabIndex: 0,
onChangeType: "onLeave",
enableStatusBar: true,
statusBarContent: "wordCount" as StatusBarContentEnum,
spellCheck: true,
minHeightUnit: "none",
maxHeightUnit: "none",
Expand All @@ -59,4 +60,23 @@ describe("Rich Text", () => {
const component = render(<RichText {...defaultProps} toolbarLocation={"top"} preset={"full"} />);
expect(component.container).toMatchSnapshot();
});

it("renders with character count status bar", () => {
const component = render(
<RichText {...defaultProps} statusBarContent={"characterCount" as StatusBarContentEnum} />
);
expect(component.container).toMatchSnapshot();
});

it("renders with HTML character count status bar", () => {
const component = render(
<RichText {...defaultProps} statusBarContent={"characterCountHtml" as StatusBarContentEnum} />
);
expect(component.container).toMatchSnapshot();
});

it("renders with both word and character count", () => {
const component = render(<RichText {...defaultProps} statusBarContent={"both" as StatusBarContentEnum} />);
expect(component.container).toMatchSnapshot();
});
});
Loading
Loading