From adc17f4221a0e48da4450695c655632d37eee2a8 Mon Sep 17 00:00:00 2001 From: Stephen Kraus <8003332+stephenmk@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:54:41 -0600 Subject: Add support for more HTML attributes and style declarations in structured content (#450) * Add support for more HTMl attributes and style declarations * Update test term to use new `margin` property * Allow string values for 'padding' and 'margin' properties * Remove newly added default 'unset' values from term bank schema --------- Co-authored-by: stephenmk --- types/ext/structured-content.d.ts | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'types/ext') diff --git a/types/ext/structured-content.d.ts b/types/ext/structured-content.d.ts index 2144cd84..c9ad87f6 100644 --- a/types/ext/structured-content.d.ts +++ b/types/ext/structured-content.d.ts @@ -23,10 +23,14 @@ export type TextDecorationLine = 'underline' | 'overline' | 'line-through'; export type TextDecorationLineOrNone = 'none' | TextDecorationLine; +export type TextDecorationStyle = 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy'; + export type FontStyle = 'normal' | 'italic'; export type FontWeight = 'normal' | 'bold'; +export type WordBreak = 'normal' | 'break-all' | 'keep-all'; + export type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'justify-all' | 'match-parent'; export type SizeUnits = 'px' | 'em'; @@ -48,13 +52,30 @@ export type StructuredContentStyle = { fontStyle?: FontStyle; fontWeight?: FontWeight; fontSize?: string; + color?: string; + backgroundColor?: string; textDecorationLine?: TextDecorationLineOrNone | TextDecorationLine[]; + textDecorationStyle?: TextDecorationStyle; + textDecorationColor?: string; + borderColor?: string; + borderStyle?: string; + borderRadius?: string; + borderWidth?: string; verticalAlign?: VerticalAlign; textAlign?: TextAlign; - marginTop?: number; - marginLeft?: number; - marginRight?: number; - marginBottom?: number; + margin?: string; + marginTop?: number | string; + marginLeft?: number | string; + marginRight?: number | string; + marginBottom?: number | string; + padding?: string; + paddingTop?: string; + paddingLeft?: string; + paddingRight?: string; + paddingBottom?: string; + wordBreak?: WordBreak; + whiteSpace?: string; + cursor?: string; listStyleType?: string; }; @@ -99,6 +120,10 @@ export type StyledElement = { content?: Content; data?: Data; style?: StructuredContentStyle; + /** + * Hover text for the element. + */ + title?: string; /** * Defines the language of an element in the format defined by RFC 5646. */ -- cgit v1.2.3