Skip to content

[WC-2914]: add support for custom fonts in RichText widget #1555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
11 changes: 11 additions & 0 deletions packages/pluggableWidgets/rich-text-web/src/RichText.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@
<caption>Enable spell checking</caption>
<description />
</property>
<property key="customFonts" type="object" isList="true" required="false">
<caption>Custom fonts</caption>
<description />
<properties>
<property key="fontName" type="textTemplate" required="false">
<caption>Font name</caption>
<category>Item</category>
<description />
</property>
</properties>
</property>
</propertyGroup>
</propertyGroup>
<propertyGroup caption="Custom toolbar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WARNING: All changes made to this file will be overwritten
* @author Mendix Widgets Framework Team
*/
import { ActionValue, EditableValue } from "mendix";
import { ActionValue, DynamicValue, EditableValue } from "mendix";

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

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

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

export interface CustomFontsType {
fontName?: DynamicValue<string>;
}

export type ToolbarConfigEnum = "basic" | "advanced";

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";
Expand All @@ -31,6 +35,10 @@ export interface AdvancedConfigType {
ctItemType: CtItemTypeEnum;
}

export interface CustomFontsPreviewType {
fontName: string;
}

export interface AdvancedConfigPreviewType {
ctItemType: CtItemTypeEnum;
}
Expand Down Expand Up @@ -59,6 +67,7 @@ export interface RichTextContainerProps {
onLoad?: ActionValue;
onChangeType: OnChangeTypeEnum;
spellCheck: boolean;
customFonts: CustomFontsType[];
toolbarConfig: ToolbarConfigEnum;
history: boolean;
fontStyle: boolean;
Expand Down Expand Up @@ -100,6 +109,7 @@ export interface RichTextPreviewProps {
onLoad: {} | null;
onChangeType: OnChangeTypeEnum;
spellCheck: boolean;
customFonts: CustomFontsPreviewType[];
toolbarConfig: ToolbarConfigEnum;
history: boolean;
fontStyle: boolean;
Expand Down
Loading