Skip to content

Commit ab8c8d5

Browse files
feat(rich-text): add support for custom fonts in RichText widget
1 parent 8a86001 commit ab8c8d5

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

packages/pluggableWidgets/rich-text-web/src/RichText.xml

+11
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@
163163
<caption>Enable spell checking</caption>
164164
<description />
165165
</property>
166+
<property key="customFonts" type="object" isList="true" required="false">
167+
<caption>Custom fonts</caption>
168+
<description />
169+
<properties>
170+
<property key="fontName" type="textTemplate" required="false">
171+
<caption>Font name</caption>
172+
<category>Item</category>
173+
<description />
174+
</property>
175+
</properties>
176+
</property>
166177
</propertyGroup>
167178
</propertyGroup>
168179
<propertyGroup caption="Custom toolbar">

packages/pluggableWidgets/rich-text-web/typings/RichTextProps.d.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* WARNING: All changes made to this file will be overwritten
44
* @author Mendix Widgets Framework Team
55
*/
6-
import { ActionValue, EditableValue } from "mendix";
6+
import { ActionValue, DynamicValue, EditableValue } from "mendix";
77

88
export type PresetEnum = "basic" | "standard" | "full" | "custom";
99

@@ -23,6 +23,10 @@ export type OverflowYEnum = "auto" | "scroll" | "hidden";
2323

2424
export type OnChangeTypeEnum = "onLeave" | "onDataChange";
2525

26+
export interface CustomFontsType {
27+
fontName?: DynamicValue<string>;
28+
}
29+
2630
export type ToolbarConfigEnum = "basic" | "advanced";
2731

2832
export type CtItemTypeEnum = "separator" | "undo" | "redo" | "bold" | "italic" | "underline" | "strike" | "superScript" | "subScript" | "orderedList" | "bulletList" | "lowerAlphaList" | "checkList" | "minIndent" | "plusIndent" | "direction" | "link" | "image" | "video" | "formula" | "blockquote" | "code" | "codeBlock" | "viewCode" | "align" | "centerAlign" | "rightAlign" | "font" | "size" | "color" | "background" | "header" | "fullscreen" | "clean" | "tableBetter";
@@ -31,6 +35,10 @@ export interface AdvancedConfigType {
3135
ctItemType: CtItemTypeEnum;
3236
}
3337

38+
export interface CustomFontsPreviewType {
39+
fontName: string;
40+
}
41+
3442
export interface AdvancedConfigPreviewType {
3543
ctItemType: CtItemTypeEnum;
3644
}
@@ -59,6 +67,7 @@ export interface RichTextContainerProps {
5967
onLoad?: ActionValue;
6068
onChangeType: OnChangeTypeEnum;
6169
spellCheck: boolean;
70+
customFonts: CustomFontsType[];
6271
toolbarConfig: ToolbarConfigEnum;
6372
history: boolean;
6473
fontStyle: boolean;
@@ -100,6 +109,7 @@ export interface RichTextPreviewProps {
100109
onLoad: {} | null;
101110
onChangeType: OnChangeTypeEnum;
102111
spellCheck: boolean;
112+
customFonts: CustomFontsPreviewType[];
103113
toolbarConfig: ToolbarConfigEnum;
104114
history: boolean;
105115
fontStyle: boolean;

0 commit comments

Comments
 (0)