feat: rich text email body (#14482)
Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@@ -34,6 +34,17 @@ export { safeParseRelativeDateFilterValue } from './safeParseRelativeDateFilterV
|
||||
export { getGenericOperationName } from './sentry/getGenericOperationName';
|
||||
export { getHumanReadableNameFromCode } from './sentry/getHumanReadableNameFromCode';
|
||||
export { capitalize } from './strings/capitalize';
|
||||
export type {
|
||||
TipTapMarkType,
|
||||
TipTapNodeType,
|
||||
LinkMarkAttributes,
|
||||
TipTapMark,
|
||||
} from './tiptap/tiptap-marks';
|
||||
export {
|
||||
TIPTAP_MARK_TYPES,
|
||||
TIPTAP_NODE_TYPES,
|
||||
TIPTAP_MARKS_RENDER_ORDER,
|
||||
} from './tiptap/tiptap-marks';
|
||||
export type { StringPropertyKeys } from './trim-and-remove-duplicated-whitespaces-from-object-string-properties';
|
||||
export { trimAndRemoveDuplicatedWhitespacesFromObjectStringProperties } from './trim-and-remove-duplicated-whitespaces-from-object-string-properties';
|
||||
export { trimAndRemoveDuplicatedWhitespacesFromString } from './trim-and-remove-duplicated-whitespaces-from-string';
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from './tiptap-marks';
|
||||
@@ -0,0 +1,42 @@
|
||||
// Shared TipTap types for consistency between frontend and email renderer
|
||||
|
||||
export const TIPTAP_MARK_TYPES = {
|
||||
BOLD: 'bold',
|
||||
ITALIC: 'italic',
|
||||
UNDERLINE: 'underline',
|
||||
STRIKE: 'strike',
|
||||
LINK: 'link',
|
||||
} as const;
|
||||
|
||||
export const TIPTAP_NODE_TYPES = {
|
||||
PARAGRAPH: 'paragraph',
|
||||
TEXT: 'text',
|
||||
HEADING: 'heading',
|
||||
VARIABLE_TAG: 'variableTag',
|
||||
IMAGE: 'image',
|
||||
} as const;
|
||||
|
||||
export type TipTapMarkType = typeof TIPTAP_MARK_TYPES[keyof typeof TIPTAP_MARK_TYPES];
|
||||
export type TipTapNodeType = typeof TIPTAP_NODE_TYPES[keyof typeof TIPTAP_NODE_TYPES];
|
||||
|
||||
// Order for mark rendering (inner to outer)
|
||||
export const TIPTAP_MARKS_RENDER_ORDER: readonly TipTapMarkType[] = [
|
||||
TIPTAP_MARK_TYPES.UNDERLINE,
|
||||
TIPTAP_MARK_TYPES.BOLD,
|
||||
TIPTAP_MARK_TYPES.ITALIC,
|
||||
TIPTAP_MARK_TYPES.STRIKE,
|
||||
TIPTAP_MARK_TYPES.LINK,
|
||||
] as const;
|
||||
|
||||
// Link mark attributes interface
|
||||
export interface LinkMarkAttributes {
|
||||
href?: string;
|
||||
target?: string;
|
||||
rel?: string;
|
||||
}
|
||||
|
||||
// Generic mark interface
|
||||
export interface TipTapMark {
|
||||
type: TipTapMarkType;
|
||||
attrs?: LinkMarkAttributes | Record<string, unknown>;
|
||||
}
|
||||
Reference in New Issue
Block a user