Skip to content

Commit 087ac32

Browse files
committed
refactor: documentation and cleanup
1 parent cb7fad5 commit 087ac32

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/example-web/src/defaultHtmlStyle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const WEB_DEFAULT_HTML_STYLE: HtmlStyle = {
4343
a: {
4444
color: 'green',
4545
textDecorationLine: 'underline',
46+
pressColor: 'darkblue',
4647
},
4748
ol: {
4849
gapWidth: 16,

src/types.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,16 @@ export interface EnrichedTextMentionStyleProperties extends MentionStyleProperti
910910
pressBackgroundColor?: ColorValue;
911911
}
912912

913-
export interface EnrichedTextHtmlStyle extends Omit<HtmlStyle, 'mention'> {
913+
export interface EnrichedTextHtmlStyle extends Omit<
914+
HtmlStyle,
915+
'a' | 'mention'
916+
> {
917+
a?: Omit<NonNullable<HtmlStyle['a']>, 'pressColor'> & {
918+
// the documentation comment below is to suppress the base HtmlStyle's
919+
// web-only note about pressColor, as in EnrichedText it is cross-platform
920+
/***/
921+
pressColor?: ColorValue;
922+
};
914923
mention?:
915924
| Record<string, EnrichedTextMentionStyleProperties>
916925
| EnrichedTextMentionStyleProperties;

src/web/htmlExtensions/useLinkPress.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export function useLinkPress(
88
const pressedLinkRef = useRef<HTMLElement | null>(null);
99

1010
const handleLinkPress = (event: PointerEvent): boolean => {
11-
if (!getOnLinkPress()) return false;
1211
const onPress = getOnLinkPress();
1312
if (!onPress) return false;
1413
const anchor = (event.target as HTMLElement).closest?.('a');

0 commit comments

Comments
 (0)