@blocknote/xl-email-exporter 0.42.0 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -691,10 +691,11 @@ class te extends E {
691
691
  );
692
692
  }
693
693
  blocknoteDefaultPropsToReactEmailStyle(e) {
694
+ var t, n;
694
695
  return {
695
696
  textAlign: e.textAlignment,
696
- backgroundColor: e.backgroundColor === "default" || !e.backgroundColor ? void 0 : this.options.colors[e.backgroundColor].background,
697
- color: e.textColor === "default" || !e.textColor ? void 0 : this.options.colors[e.textColor].text,
697
+ backgroundColor: e.backgroundColor === "default" || !e.backgroundColor || (t = this.options.colors[e.backgroundColor]) == null ? void 0 : t.background,
698
+ color: e.textColor === "default" || !e.textColor || (n = this.options.colors[e.textColor]) == null ? void 0 : n.text,
698
699
  alignItems: e.textAlignment === "right" ? "flex-end" : e.textAlignment === "center" ? "center" : void 0
699
700
  };
700
701
  }
@@ -1 +1 @@
1
- {"version":3,"file":"blocknote-xl-email-exporter.js","sources":["../src/react-email/defaultSchema/blocks.tsx","../src/react-email/defaultSchema/inlinecontent.tsx","../src/react-email/defaultSchema/styles.tsx","../src/react-email/defaultSchema/index.ts","../src/react-email/reactEmailExporter.tsx"],"sourcesContent":["import {\n BlockMapping,\n createPageBreakBlockConfig,\n DefaultBlockSchema,\n mapTableCell,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n CodeBlock,\n dracula,\n Heading,\n Img,\n Link,\n PrismLanguage,\n Text,\n} from \"@react-email/components\";\n\n// Define TextProps type based on React Email Text component\ntype TextProps = React.ComponentPropsWithoutRef<typeof Text>;\n\n// Define the styles interface for configurable Text components\nexport interface ReactEmailTextStyles {\n paragraph?: Partial<TextProps>;\n bulletListItem?: Partial<TextProps>;\n toggleListItem?: Partial<TextProps>;\n numberedListItem?: Partial<TextProps>;\n checkListItem?: Partial<TextProps>;\n quote?: Partial<TextProps>;\n tableError?: Partial<TextProps>;\n tableCell?: Partial<TextProps>;\n caption?: Partial<TextProps>;\n heading1?: Partial<TextProps>;\n heading2?: Partial<TextProps>;\n heading3?: Partial<TextProps>;\n heading4?: Partial<TextProps>;\n heading5?: Partial<TextProps>;\n heading6?: Partial<TextProps>;\n codeBlock?: Partial<React.ComponentProps<typeof CodeBlock>>;\n}\n\nconst defaultTextStyle: TextProps[\"style\"] = {\n fontSize: 16,\n lineHeight: 1.5,\n margin: 3,\n minHeight: 24,\n};\n\n// Default styles for Text components\nexport const defaultReactEmailTextStyles = {\n paragraph: {\n style: defaultTextStyle,\n },\n bulletListItem: {\n style: defaultTextStyle,\n },\n toggleListItem: {\n style: defaultTextStyle,\n },\n numberedListItem: {\n style: defaultTextStyle,\n },\n checkListItem: {\n style: defaultTextStyle,\n },\n quote: {\n style: defaultTextStyle,\n },\n tableError: {\n style: defaultTextStyle,\n },\n tableCell: {\n style: defaultTextStyle,\n },\n caption: {\n style: defaultTextStyle,\n },\n heading1: {\n style: {\n fontSize: 48,\n margin: 3,\n },\n },\n heading2: {\n style: {\n fontSize: 36,\n margin: 3,\n },\n },\n heading3: {\n style: {\n fontSize: 24,\n margin: 3,\n },\n },\n heading4: {\n style: {\n fontSize: 20,\n margin: 3,\n },\n },\n heading5: {\n style: {\n fontSize: 18,\n margin: 3,\n },\n },\n heading6: {\n style: {\n fontSize: 16,\n margin: 3,\n },\n },\n codeBlock: {\n style: defaultTextStyle,\n },\n} satisfies ReactEmailTextStyles;\n\nexport const createReactEmailBlockMappingForDefaultSchema = (\n textStyles: ReactEmailTextStyles = defaultReactEmailTextStyles,\n): BlockMapping<\n DefaultBlockSchema & {\n pageBreak: ReturnType<typeof createPageBreakBlockConfig>;\n },\n any,\n any,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>\n> => ({\n paragraph: (block, t) => {\n return (\n <Text\n {...textStyles.paragraph}\n style={{\n ...defaultReactEmailTextStyles.paragraph.style,\n ...textStyles.paragraph?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n bulletListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.bulletListItem}\n style={{\n ...defaultReactEmailTextStyles.bulletListItem.style,\n ...textStyles.bulletListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n toggleListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.toggleListItem}\n style={{\n ...defaultReactEmailTextStyles.toggleListItem.style,\n ...textStyles.toggleListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n numberedListItem: (block, t, _nestingLevel) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.numberedListItem}\n style={{\n ...defaultReactEmailTextStyles.numberedListItem.style,\n ...textStyles.numberedListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n checkListItem: (block, t) => {\n // Render a checkbox using inline SVG for better appearance in email\n // block.props.checked should be true/false\n const checked = block.props?.checked;\n const checkboxSvg = checked ? (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#4F8A10\"\n stroke=\"#4F8A10\"\n strokeWidth=\"2\"\n />\n <polyline\n points=\"5,10 8,13 13,6\"\n fill=\"none\"\n stroke=\"#fff\"\n strokeWidth=\"2\"\n />\n </svg>\n ) : (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#fff\"\n stroke=\"#888\"\n strokeWidth=\"2\"\n />\n </svg>\n );\n return (\n <Text\n {...textStyles.checkListItem}\n style={{\n ...defaultReactEmailTextStyles.checkListItem.style,\n ...textStyles.checkListItem?.style,\n }}\n >\n {checkboxSvg}\n <span>{t.transformInlineContent(block.content)}</span>\n </Text>\n );\n },\n heading: (block, t) => {\n return (\n <Heading\n as={`h${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`}\n {...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]}\n style={{\n ...defaultReactEmailTextStyles[\n `heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`\n ].style,\n ...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]\n ?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Heading>\n );\n },\n\n codeBlock: (block) => {\n const textContent = (block.content as StyledText<any>[])[0]?.text || \"\";\n\n return (\n <CodeBlock\n code={textContent}\n fontFamily=\"'CommitMono', monospace\"\n language={block.props.language as PrismLanguage}\n theme={dracula}\n {...textStyles.codeBlock}\n style={{\n ...defaultReactEmailTextStyles.codeBlock.style,\n ...textStyles.codeBlock?.style,\n }}\n />\n );\n },\n audio: (block) => {\n // Audio icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#4F8A10\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open audio file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n video: (block) => {\n // Video icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#1976D2\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open video file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n file: (block) => {\n // File icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#888\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n image: (block) => {\n return (\n <Img\n src={block.props.url}\n width={block.props.previewWidth}\n alt={block.props.caption}\n />\n );\n },\n table: (block, t) => {\n // Render table using standard HTML table elements for email compatibility\n const table = block.content;\n if (!table || typeof table !== \"object\" || !Array.isArray(table.rows)) {\n return <Text {...textStyles.tableError}>Table data not available</Text>;\n }\n const headerRowsCount = (table.headerRows as number) ?? 0;\n const headerColsCount = (table.headerCols as number) ?? 0;\n\n return (\n <table\n style={{\n borderCollapse: \"collapse\",\n width: \"100%\",\n margin: \"16px 0\",\n border: \"1px solid #ddd\",\n borderRadius: 4,\n overflow: \"hidden\",\n }}\n border={0}\n cellPadding={0}\n cellSpacing={0}\n >\n <tbody>\n {table.rows.map((row: any, rowIndex: number) => (\n <tr key={\"row-\" + rowIndex}>\n {row.cells.map((cell: any, colIndex: number) => {\n // Use mapTableCell to normalize table cell data into a standard interface\n // This handles partial cells, provides default values, and ensures consistent structure\n const normalizedCell = mapTableCell(cell);\n const isHeaderRow = rowIndex < headerRowsCount;\n const isHeaderCol = colIndex < headerColsCount;\n const isHeader = isHeaderRow || isHeaderCol;\n const CellTag = isHeader ? \"th\" : \"td\";\n return (\n <CellTag\n key={\"row_\" + rowIndex + \"_col_\" + colIndex}\n style={{\n border: \"1px solid #ddd\",\n padding: \"8px 12px\",\n background:\n normalizedCell.props.backgroundColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .backgroundColor as keyof typeof t.options.colors\n ].background\n : \"inherit\",\n fontWeight: isHeader ? \"bold\" : undefined,\n textAlign: normalizedCell.props.textAlignment || \"left\",\n color:\n normalizedCell.props.textColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .textColor as keyof typeof t.options.colors\n ].text\n : \"inherit\",\n ...defaultReactEmailTextStyles.tableCell.style,\n ...textStyles.tableCell?.style,\n }}\n {...((normalizedCell.props.colspan || 1) > 1 && {\n colSpan: normalizedCell.props.colspan || 1,\n })}\n {...((normalizedCell.props.rowspan || 1) > 1 && {\n rowSpan: normalizedCell.props.rowspan || 1,\n })}\n >\n {t.transformInlineContent(normalizedCell.content)}\n </CellTag>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n },\n quote: (block, t) => {\n // Render block quote with a left border and subtle background for email compatibility\n return (\n <Text\n {...textStyles.quote}\n style={{\n borderLeft: \"2px solid #bdbdbd\",\n padding: \"0px 12px\",\n fontStyle: \"italic\",\n color: t.options.colors.gray.text,\n display: \"block\",\n ...defaultReactEmailTextStyles.quote.style,\n ...textStyles.quote?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n pageBreak: () => {\n // In email, a page break can be represented as a horizontal rule\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"2px dashed #ccc\",\n margin: \"24px 0\",\n }}\n />\n );\n },\n divider: () => {\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"1px solid #ccc\",\n margin: \"11.5px 0\",\n }}\n />\n );\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailBlockMappingForDefaultSchema =\n createReactEmailBlockMappingForDefaultSchema();\n\n// Helper for file-like blocks (audio, video, file)\nfunction FileLink({\n url,\n name,\n defaultText,\n icon,\n}: {\n url?: string;\n name?: string;\n defaultText: string;\n icon: React.ReactElement;\n}) {\n return (\n <Link\n href={url}\n style={{\n textDecoration: \"none\",\n color: \"#333\",\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 16,\n }}\n >\n {icon}\n <span style={{ verticalAlign: \"middle\" }}>{name || defaultText}</span>\n </Link>\n );\n}\n\nfunction Caption({\n caption,\n width,\n textStyles,\n}: {\n caption?: string;\n width?: number;\n textStyles: ReactEmailTextStyles;\n}) {\n if (!caption) {\n return null;\n }\n return (\n <Text\n {...textStyles.caption}\n style={{\n width,\n fontSize: 13,\n color: \"#888\",\n margin: \"4px 0 0 0\",\n ...defaultReactEmailTextStyles.caption.style,\n ...textStyles.caption?.style,\n }}\n >\n {caption}\n </Text>\n );\n}\n","import {\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentMapping,\n} from \"@blocknote/core\";\nimport { Link } from \"@react-email/components\";\n\n// Define the styles interface for configurable Link components\nexport interface ReactEmailLinkStyles {\n link?: Partial<React.ComponentPropsWithoutRef<typeof Link>>;\n}\n\n// Default styles for Link components\nexport const defaultReactEmailLinkStyles: ReactEmailLinkStyles = {\n link: {},\n};\n\nexport const createReactEmailInlineContentMappingForDefaultSchema = (\n linkStyles: ReactEmailLinkStyles = defaultReactEmailLinkStyles,\n): InlineContentMapping<\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n React.ReactElement<HTMLSpanElement>\n> => ({\n link: (ic, t) => {\n return (\n <Link href={ic.href} {...linkStyles.link}>\n {...ic.content.map((content) => {\n return t.transformStyledText(content);\n })}\n </Link>\n );\n },\n text: (ic, t) => {\n return t.transformStyledText(ic);\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailInlineContentMappingForDefaultSchema =\n createReactEmailInlineContentMappingForDefaultSchema();\n","import { DefaultStyleSchema, StyleMapping } from \"@blocknote/core\";\nimport { CSSProperties } from \"react\";\n\n// Define the styles interface for configurable style transformations\n// This can be extended in the future to allow customizing style transformations\nexport type ReactEmailStyleTransformStyles = Record<string, never>;\n\n// Default styles for style transformations\nexport const defaultReactEmailStyleTransformStyles: ReactEmailStyleTransformStyles =\n {};\n\nexport const createReactEmailStyleMappingForDefaultSchema = (\n _styleTransformStyles: ReactEmailStyleTransformStyles = defaultReactEmailStyleTransformStyles,\n): StyleMapping<DefaultStyleSchema, CSSProperties> => ({\n bold: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontWeight: \"bold\",\n };\n },\n italic: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontStyle: \"italic\",\n };\n },\n underline: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"underline\", // TODO: could conflict with strike\n };\n },\n strike: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"line-through\",\n };\n },\n backgroundColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n backgroundColor:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .background,\n };\n },\n textColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n color:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .text,\n };\n },\n code: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontFamily: \"GeistMono\",\n };\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailStyleMappingForDefaultSchema =\n createReactEmailStyleMappingForDefaultSchema();\n","import {\n reactEmailBlockMappingForDefaultSchema,\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nimport {\n reactEmailInlineContentMappingForDefaultSchema,\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nimport {\n reactEmailStyleMappingForDefaultSchema,\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Re-export for backward compatibility\nexport { reactEmailBlockMappingForDefaultSchema } from \"./blocks.js\";\nexport { reactEmailInlineContentMappingForDefaultSchema } from \"./inlinecontent.js\";\nexport { reactEmailStyleMappingForDefaultSchema } from \"./styles.js\";\n\n// Export the new configurable functions\nexport {\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nexport {\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nexport {\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Export the combined styles interface\nexport interface ReactEmailDefaultSchemaStyles {\n textStyles?: ReactEmailTextStyles;\n linkStyles?: ReactEmailLinkStyles;\n styleTransformStyles?: ReactEmailStyleTransformStyles;\n}\n\n// Export the default combined styles\nexport const defaultReactEmailDefaultSchemaStyles: ReactEmailDefaultSchemaStyles =\n {\n textStyles: defaultReactEmailTextStyles,\n linkStyles: defaultReactEmailLinkStyles,\n styleTransformStyles: defaultReactEmailStyleTransformStyles,\n };\n\nexport const reactEmailDefaultSchemaMappings = {\n blockMapping: reactEmailBlockMappingForDefaultSchema,\n inlineContentMapping: reactEmailInlineContentMappingForDefaultSchema,\n styleMapping: reactEmailStyleMappingForDefaultSchema,\n};\n\nexport const reactEmailDefaultSchemaMappingsWithStyles = (\n styles: ReactEmailDefaultSchemaStyles = defaultReactEmailDefaultSchemaStyles,\n): typeof reactEmailDefaultSchemaMappings => {\n return {\n blockMapping: createReactEmailBlockMappingForDefaultSchema(\n styles.textStyles,\n ),\n inlineContentMapping: createReactEmailInlineContentMappingForDefaultSchema(\n styles.linkStyles,\n ),\n styleMapping: createReactEmailStyleMappingForDefaultSchema(\n styles.styleTransformStyles,\n ),\n };\n};\n","import {\n Block,\n BlockNoteSchema,\n BlockSchema,\n COLORS_DEFAULT,\n DefaultProps,\n Exporter,\n ExporterOptions,\n InlineContentSchema,\n StyleSchema,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n Body,\n Head,\n Html,\n Link,\n Preview,\n Section,\n Tailwind,\n} from \"@react-email/components\";\nimport { render as renderEmail } from \"@react-email/render\";\nimport React, { CSSProperties } from \"react\";\n\nexport class ReactEmailExporter<\n B extends BlockSchema,\n S extends StyleSchema,\n I extends InlineContentSchema,\n> extends Exporter<\n B,\n I,\n S,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n> {\n public constructor(\n public readonly schema: BlockNoteSchema<B, I, S>,\n mappings: Exporter<\n NoInfer<B>,\n NoInfer<I>,\n NoInfer<S>,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n >[\"mappings\"],\n options?: Partial<ExporterOptions>,\n ) {\n const defaults = {\n colors: COLORS_DEFAULT,\n } satisfies Partial<ExporterOptions>;\n\n const newOptions = {\n ...defaults,\n ...options,\n };\n super(schema, mappings, newOptions);\n }\n\n public transformStyledText(styledText: StyledText<S>) {\n const stylesArray = this.mapStyles(styledText.styles);\n const styles = Object.assign({}, ...stylesArray);\n return (\n <span\n style={styles}\n dangerouslySetInnerHTML={{\n __html: styledText.text.replace(/\\n/g, \"<br />\"),\n }}\n />\n );\n }\n\n private async renderGroupedListBlocks(\n blocks: Block<B, I, S>[],\n startIndex: number,\n nestingLevel: number,\n ): Promise<{ element: React.ReactElement; nextIndex: number }> {\n const listType = blocks[startIndex].type;\n const listItems: React.ReactElement<any>[] = [];\n let j = startIndex;\n\n for (\n let itemIndex = 1;\n j < blocks.length && blocks[j].type === listType;\n j++, itemIndex++\n ) {\n const block = blocks[j];\n const liContent = (await this.mapBlock(\n block as any,\n nestingLevel,\n itemIndex,\n )) as any;\n let nestedList: React.ReactElement<any>[] = [];\n if (block.children && block.children.length > 0) {\n nestedList = await this.renderNestedLists(\n block.children,\n nestingLevel + 1,\n block.id,\n );\n }\n listItems.push(\n <li key={block.id}>\n {liContent}\n {nestedList.length > 0 && nestedList}\n </li>,\n );\n }\n let element: React.ReactElement;\n if (listType === \"bulletListItem\" || listType === \"toggleListItem\") {\n element = (\n <ul className=\"mb-2 list-disc pl-6\" key={blocks[startIndex].id + \"-ul\"}>\n {listItems}\n </ul>\n );\n } else {\n element = (\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={blocks[startIndex].id + \"-ol\"}\n >\n {listItems}\n </ol>\n );\n }\n return { element, nextIndex: j };\n }\n\n private async renderNestedLists(\n children: Block<B, I, S>[],\n nestingLevel: number,\n parentId: string,\n ): Promise<React.ReactElement<any>[]> {\n const nestedList: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < children.length) {\n const child = children[i];\n if (\n child.type === \"bulletListItem\" ||\n child.type === \"numberedListItem\"\n ) {\n // Group consecutive list items of the same type\n const listType = child.type;\n const listItems: React.ReactElement<any>[] = [];\n let j = i;\n\n for (\n let itemIndex = 1;\n j < children.length && children[j].type === listType;\n j++, itemIndex++\n ) {\n const listItem = children[j];\n const liContent = (await this.mapBlock(\n listItem as any,\n nestingLevel,\n itemIndex,\n )) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(\n listItem.props as any,\n );\n let nestedContent: React.ReactElement<any>[] = [];\n if (listItem.children && listItem.children.length > 0) {\n // If children are list items, render as nested list; otherwise, as normal blocks\n if (\n listItem.children[0] &&\n (listItem.children[0].type === \"bulletListItem\" ||\n listItem.children[0].type === \"numberedListItem\")\n ) {\n nestedContent = await this.renderNestedLists(\n listItem.children,\n nestingLevel + 1,\n listItem.id,\n );\n } else {\n nestedContent = await this.transformBlocks(\n listItem.children,\n nestingLevel + 1,\n );\n }\n }\n listItems.push(\n <li key={listItem.id} style={style}>\n {liContent}\n {nestedContent.length > 0 && (\n <div style={{ marginTop: \"8px\" }}>{nestedContent}</div>\n )}\n </li>,\n );\n }\n if (listType === \"bulletListItem\") {\n nestedList.push(\n <ul\n className=\"mb-2 list-disc pl-6\"\n key={parentId + \"-ul-nested-\" + i}\n >\n {listItems}\n </ul>,\n );\n } else {\n nestedList.push(\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={parentId + \"-ol-nested-\" + i}\n >\n {listItems}\n </ol>,\n );\n }\n i = j;\n } else {\n // Non-list child, render as normal with indentation\n const childBlocks = await this.transformBlocks([child], nestingLevel);\n nestedList.push(\n <Section key={child.id} style={{ marginLeft: \"24px\" }}>\n {childBlocks}\n </Section>,\n );\n i++;\n }\n }\n return nestedList;\n }\n\n public async transformBlocks(\n blocks: Block<B, I, S>[],\n nestingLevel = 0,\n ): Promise<React.ReactElement<any>[]> {\n const ret: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < blocks.length) {\n const b = blocks[i];\n if (\n b.type === \"bulletListItem\" ||\n b.type === \"numberedListItem\" ||\n b.type === \"toggleListItem\"\n ) {\n const { element, nextIndex } = await this.renderGroupedListBlocks(\n blocks,\n i,\n nestingLevel,\n );\n ret.push(element);\n i = nextIndex;\n continue;\n }\n // Non-list blocks\n const children = await this.transformBlocks(b.children, nestingLevel + 1);\n const self = (await this.mapBlock(b as any, nestingLevel, 0)) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(b.props as any);\n ret.push(\n <React.Fragment key={b.id}>\n <Section style={style}>{self}</Section>\n {children.length > 0 && (\n <div style={{ marginLeft: \"24px\" }}>{children}</div>\n )}\n </React.Fragment>,\n );\n i++;\n }\n return ret;\n }\n\n public async toReactEmailDocument(\n blocks: Block<B, I, S>[],\n options?: {\n /**\n * Inject elements into the {@link Head} element\n * @see https://react.email/docs/components/head\n */\n head?: React.ReactElement;\n /**\n * Set the preview text for the email\n * @see https://react.email/docs/components/preview\n */\n preview?: string | string[];\n /**\n * Add a header to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n header?: React.ReactElement;\n /**\n * Add a footer to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n footer?: React.ReactElement;\n /**\n * Customize the container element\n */\n container?: React.FC<{ children: React.ReactNode }>;\n },\n ) {\n const transformedBlocks = await this.transformBlocks(blocks);\n const DefaultContainer =\n options?.container ||\n (({ children }: { children: React.ReactNode }) => (\n <React.Fragment>{children}</React.Fragment>\n ));\n return renderEmail(\n <Html>\n <Head>{options?.head}</Head>\n <Body\n style={{\n fontFamily:\n \"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif\",\n fontSize: \"16px\",\n lineHeight: \"1.5\",\n color: \"#333\",\n }}\n >\n {options?.preview && <Preview>{options.preview}</Preview>}\n <Tailwind>\n <DefaultContainer>\n {options?.header}\n {transformedBlocks}\n {options?.footer}\n </DefaultContainer>\n </Tailwind>\n </Body>\n </Html>,\n );\n }\n\n protected blocknoteDefaultPropsToReactEmailStyle(\n props: Partial<DefaultProps>,\n ): any {\n return {\n textAlign: props.textAlignment,\n backgroundColor:\n props.backgroundColor === \"default\" || !props.backgroundColor\n ? undefined\n : this.options.colors[\n props.backgroundColor as keyof typeof this.options.colors\n ].background,\n color:\n props.textColor === \"default\" || !props.textColor\n ? undefined\n : this.options.colors[\n props.textColor as keyof typeof this.options.colors\n ].text,\n alignItems:\n props.textAlignment === \"right\"\n ? \"flex-end\"\n : props.textAlignment === \"center\"\n ? \"center\"\n : undefined,\n };\n }\n}\n"],"names":["defaultTextStyle","defaultReactEmailTextStyles","createReactEmailBlockMappingForDefaultSchema","textStyles","block","jsx","Text","_a","_nestingLevel","checkboxSvg","jsxs","_b","Heading","textContent","CodeBlock","dracula","icon","previewWidth","FileLink","Caption","Img","table","headerRowsCount","headerColsCount","row","rowIndex","cell","colIndex","normalizedCell","mapTableCell","isHeaderRow","isHeaderCol","isHeader","reactEmailBlockMappingForDefaultSchema","url","name","defaultText","Link","caption","width","defaultReactEmailLinkStyles","createReactEmailInlineContentMappingForDefaultSchema","linkStyles","ic","content","reactEmailInlineContentMappingForDefaultSchema","defaultReactEmailStyleTransformStyles","createReactEmailStyleMappingForDefaultSchema","_styleTransformStyles","val","exporter","reactEmailStyleMappingForDefaultSchema","defaultReactEmailDefaultSchemaStyles","reactEmailDefaultSchemaMappings","reactEmailDefaultSchemaMappingsWithStyles","styles","ReactEmailExporter","Exporter","schema","mappings","options","newOptions","COLORS_DEFAULT","styledText","stylesArray","blocks","startIndex","nestingLevel","listType","listItems","j","itemIndex","liContent","nestedList","element","children","parentId","child","listItem","style","nestedContent","childBlocks","Section","ret","i","b","nextIndex","self","React","transformedBlocks","DefaultContainer","renderEmail","Html","Head","Body","Preview","Tailwind","props"],"mappings":";;;;;AAwCA,MAAMA,IAAuC;AAAA,EAC3C,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AACb,GAGaC,IAA8B;AAAA,EACzC,WAAW;AAAA,IACT,OAAOD;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAOA;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAOA;AAAA,EAAA;AAAA,EAET,kBAAkB;AAAA,IAChB,OAAOA;AAAA,EAAA;AAAA,EAET,eAAe;AAAA,IACb,OAAOA;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,OAAOA;AAAA,EAAA;AAAA,EAET,YAAY;AAAA,IACV,OAAOA;AAAA,EAAA;AAAA,EAET,WAAW;AAAA,IACT,OAAOA;AAAA,EAAA;AAAA,EAET,SAAS;AAAA,IACP,OAAOA;AAAA,EAAA;AAAA,EAET,UAAU;AAAA,IACR,OAAO;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,UAAU;AAAA,IACR,OAAO;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,UAAU;AAAA,IACR,OAAO;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,UAAU;AAAA,IACR,OAAO;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,UAAU;AAAA,IACR,OAAO;AAAA,MACL,UAAU;AAAA,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OACEA,EAAM,cAAc,aAAa,CAACA,EAAM,YACpC,SACA,KAAK,QAAQ,OACXA,EAAM,SACR,EAAE;AAAA,MACR,YACEA,EAAM,kBAAkB,UACpB,aACAA,EAAM,kBAAkB,WACtB,WACA;AAAA,IAAA;AAAA,EAEZ;AACF;"}
1
+ {"version":3,"file":"blocknote-xl-email-exporter.js","sources":["../src/react-email/defaultSchema/blocks.tsx","../src/react-email/defaultSchema/inlinecontent.tsx","../src/react-email/defaultSchema/styles.tsx","../src/react-email/defaultSchema/index.ts","../src/react-email/reactEmailExporter.tsx"],"sourcesContent":["import {\n BlockMapping,\n createPageBreakBlockConfig,\n DefaultBlockSchema,\n mapTableCell,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n CodeBlock,\n dracula,\n Heading,\n Img,\n Link,\n PrismLanguage,\n Text,\n} from \"@react-email/components\";\n\n// Define TextProps type based on React Email Text component\ntype TextProps = React.ComponentPropsWithoutRef<typeof Text>;\n\n// Define the styles interface for configurable Text components\nexport interface ReactEmailTextStyles {\n paragraph?: Partial<TextProps>;\n bulletListItem?: Partial<TextProps>;\n toggleListItem?: Partial<TextProps>;\n numberedListItem?: Partial<TextProps>;\n checkListItem?: Partial<TextProps>;\n quote?: Partial<TextProps>;\n tableError?: Partial<TextProps>;\n tableCell?: Partial<TextProps>;\n caption?: Partial<TextProps>;\n heading1?: Partial<TextProps>;\n heading2?: Partial<TextProps>;\n heading3?: Partial<TextProps>;\n heading4?: Partial<TextProps>;\n heading5?: Partial<TextProps>;\n heading6?: Partial<TextProps>;\n codeBlock?: Partial<React.ComponentProps<typeof CodeBlock>>;\n}\n\nconst defaultTextStyle: TextProps[\"style\"] = {\n fontSize: 16,\n lineHeight: 1.5,\n margin: 3,\n minHeight: 24,\n};\n\n// Default styles for Text components\nexport const defaultReactEmailTextStyles = {\n paragraph: {\n style: defaultTextStyle,\n },\n bulletListItem: {\n style: defaultTextStyle,\n },\n toggleListItem: {\n style: defaultTextStyle,\n },\n numberedListItem: {\n style: defaultTextStyle,\n },\n checkListItem: {\n style: defaultTextStyle,\n },\n quote: {\n style: defaultTextStyle,\n },\n tableError: {\n style: defaultTextStyle,\n },\n tableCell: {\n style: defaultTextStyle,\n },\n caption: {\n style: defaultTextStyle,\n },\n heading1: {\n style: {\n fontSize: 48,\n margin: 3,\n },\n },\n heading2: {\n style: {\n fontSize: 36,\n margin: 3,\n },\n },\n heading3: {\n style: {\n fontSize: 24,\n margin: 3,\n },\n },\n heading4: {\n style: {\n fontSize: 20,\n margin: 3,\n },\n },\n heading5: {\n style: {\n fontSize: 18,\n margin: 3,\n },\n },\n heading6: {\n style: {\n fontSize: 16,\n margin: 3,\n },\n },\n codeBlock: {\n style: defaultTextStyle,\n },\n} satisfies ReactEmailTextStyles;\n\nexport const createReactEmailBlockMappingForDefaultSchema = (\n textStyles: ReactEmailTextStyles = defaultReactEmailTextStyles,\n): BlockMapping<\n DefaultBlockSchema & {\n pageBreak: ReturnType<typeof createPageBreakBlockConfig>;\n },\n any,\n any,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>\n> => ({\n paragraph: (block, t) => {\n return (\n <Text\n {...textStyles.paragraph}\n style={{\n ...defaultReactEmailTextStyles.paragraph.style,\n ...textStyles.paragraph?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n bulletListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.bulletListItem}\n style={{\n ...defaultReactEmailTextStyles.bulletListItem.style,\n ...textStyles.bulletListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n toggleListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.toggleListItem}\n style={{\n ...defaultReactEmailTextStyles.toggleListItem.style,\n ...textStyles.toggleListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n numberedListItem: (block, t, _nestingLevel) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.numberedListItem}\n style={{\n ...defaultReactEmailTextStyles.numberedListItem.style,\n ...textStyles.numberedListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n checkListItem: (block, t) => {\n // Render a checkbox using inline SVG for better appearance in email\n // block.props.checked should be true/false\n const checked = block.props?.checked;\n const checkboxSvg = checked ? (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#4F8A10\"\n stroke=\"#4F8A10\"\n strokeWidth=\"2\"\n />\n <polyline\n points=\"5,10 8,13 13,6\"\n fill=\"none\"\n stroke=\"#fff\"\n strokeWidth=\"2\"\n />\n </svg>\n ) : (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#fff\"\n stroke=\"#888\"\n strokeWidth=\"2\"\n />\n </svg>\n );\n return (\n <Text\n {...textStyles.checkListItem}\n style={{\n ...defaultReactEmailTextStyles.checkListItem.style,\n ...textStyles.checkListItem?.style,\n }}\n >\n {checkboxSvg}\n <span>{t.transformInlineContent(block.content)}</span>\n </Text>\n );\n },\n heading: (block, t) => {\n return (\n <Heading\n as={`h${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`}\n {...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]}\n style={{\n ...defaultReactEmailTextStyles[\n `heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`\n ].style,\n ...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]\n ?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Heading>\n );\n },\n\n codeBlock: (block) => {\n const textContent = (block.content as StyledText<any>[])[0]?.text || \"\";\n\n return (\n <CodeBlock\n code={textContent}\n fontFamily=\"'CommitMono', monospace\"\n language={block.props.language as PrismLanguage}\n theme={dracula}\n {...textStyles.codeBlock}\n style={{\n ...defaultReactEmailTextStyles.codeBlock.style,\n ...textStyles.codeBlock?.style,\n }}\n />\n );\n },\n audio: (block) => {\n // Audio icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#4F8A10\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open audio file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n video: (block) => {\n // Video icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#1976D2\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open video file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n file: (block) => {\n // File icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#888\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n image: (block) => {\n return (\n <Img\n src={block.props.url}\n width={block.props.previewWidth}\n alt={block.props.caption}\n />\n );\n },\n table: (block, t) => {\n // Render table using standard HTML table elements for email compatibility\n const table = block.content;\n if (!table || typeof table !== \"object\" || !Array.isArray(table.rows)) {\n return <Text {...textStyles.tableError}>Table data not available</Text>;\n }\n const headerRowsCount = (table.headerRows as number) ?? 0;\n const headerColsCount = (table.headerCols as number) ?? 0;\n\n return (\n <table\n style={{\n borderCollapse: \"collapse\",\n width: \"100%\",\n margin: \"16px 0\",\n border: \"1px solid #ddd\",\n borderRadius: 4,\n overflow: \"hidden\",\n }}\n border={0}\n cellPadding={0}\n cellSpacing={0}\n >\n <tbody>\n {table.rows.map((row: any, rowIndex: number) => (\n <tr key={\"row-\" + rowIndex}>\n {row.cells.map((cell: any, colIndex: number) => {\n // Use mapTableCell to normalize table cell data into a standard interface\n // This handles partial cells, provides default values, and ensures consistent structure\n const normalizedCell = mapTableCell(cell);\n const isHeaderRow = rowIndex < headerRowsCount;\n const isHeaderCol = colIndex < headerColsCount;\n const isHeader = isHeaderRow || isHeaderCol;\n const CellTag = isHeader ? \"th\" : \"td\";\n return (\n <CellTag\n key={\"row_\" + rowIndex + \"_col_\" + colIndex}\n style={{\n border: \"1px solid #ddd\",\n padding: \"8px 12px\",\n background:\n normalizedCell.props.backgroundColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .backgroundColor as keyof typeof t.options.colors\n ].background\n : \"inherit\",\n fontWeight: isHeader ? \"bold\" : undefined,\n textAlign: normalizedCell.props.textAlignment || \"left\",\n color:\n normalizedCell.props.textColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .textColor as keyof typeof t.options.colors\n ].text\n : \"inherit\",\n ...defaultReactEmailTextStyles.tableCell.style,\n ...textStyles.tableCell?.style,\n }}\n {...((normalizedCell.props.colspan || 1) > 1 && {\n colSpan: normalizedCell.props.colspan || 1,\n })}\n {...((normalizedCell.props.rowspan || 1) > 1 && {\n rowSpan: normalizedCell.props.rowspan || 1,\n })}\n >\n {t.transformInlineContent(normalizedCell.content)}\n </CellTag>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n },\n quote: (block, t) => {\n // Render block quote with a left border and subtle background for email compatibility\n return (\n <Text\n {...textStyles.quote}\n style={{\n borderLeft: \"2px solid #bdbdbd\",\n padding: \"0px 12px\",\n fontStyle: \"italic\",\n color: t.options.colors.gray.text,\n display: \"block\",\n ...defaultReactEmailTextStyles.quote.style,\n ...textStyles.quote?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n pageBreak: () => {\n // In email, a page break can be represented as a horizontal rule\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"2px dashed #ccc\",\n margin: \"24px 0\",\n }}\n />\n );\n },\n divider: () => {\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"1px solid #ccc\",\n margin: \"11.5px 0\",\n }}\n />\n );\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailBlockMappingForDefaultSchema =\n createReactEmailBlockMappingForDefaultSchema();\n\n// Helper for file-like blocks (audio, video, file)\nfunction FileLink({\n url,\n name,\n defaultText,\n icon,\n}: {\n url?: string;\n name?: string;\n defaultText: string;\n icon: React.ReactElement;\n}) {\n return (\n <Link\n href={url}\n style={{\n textDecoration: \"none\",\n color: \"#333\",\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 16,\n }}\n >\n {icon}\n <span style={{ verticalAlign: \"middle\" }}>{name || defaultText}</span>\n </Link>\n );\n}\n\nfunction Caption({\n caption,\n width,\n textStyles,\n}: {\n caption?: string;\n width?: number;\n textStyles: ReactEmailTextStyles;\n}) {\n if (!caption) {\n return null;\n }\n return (\n <Text\n {...textStyles.caption}\n style={{\n width,\n fontSize: 13,\n color: \"#888\",\n margin: \"4px 0 0 0\",\n ...defaultReactEmailTextStyles.caption.style,\n ...textStyles.caption?.style,\n }}\n >\n {caption}\n </Text>\n );\n}\n","import {\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentMapping,\n} from \"@blocknote/core\";\nimport { Link } from \"@react-email/components\";\n\n// Define the styles interface for configurable Link components\nexport interface ReactEmailLinkStyles {\n link?: Partial<React.ComponentPropsWithoutRef<typeof Link>>;\n}\n\n// Default styles for Link components\nexport const defaultReactEmailLinkStyles: ReactEmailLinkStyles = {\n link: {},\n};\n\nexport const createReactEmailInlineContentMappingForDefaultSchema = (\n linkStyles: ReactEmailLinkStyles = defaultReactEmailLinkStyles,\n): InlineContentMapping<\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n React.ReactElement<HTMLSpanElement>\n> => ({\n link: (ic, t) => {\n return (\n <Link href={ic.href} {...linkStyles.link}>\n {...ic.content.map((content) => {\n return t.transformStyledText(content);\n })}\n </Link>\n );\n },\n text: (ic, t) => {\n return t.transformStyledText(ic);\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailInlineContentMappingForDefaultSchema =\n createReactEmailInlineContentMappingForDefaultSchema();\n","import { DefaultStyleSchema, StyleMapping } from \"@blocknote/core\";\nimport { CSSProperties } from \"react\";\n\n// Define the styles interface for configurable style transformations\n// This can be extended in the future to allow customizing style transformations\nexport type ReactEmailStyleTransformStyles = Record<string, never>;\n\n// Default styles for style transformations\nexport const defaultReactEmailStyleTransformStyles: ReactEmailStyleTransformStyles =\n {};\n\nexport const createReactEmailStyleMappingForDefaultSchema = (\n _styleTransformStyles: ReactEmailStyleTransformStyles = defaultReactEmailStyleTransformStyles,\n): StyleMapping<DefaultStyleSchema, CSSProperties> => ({\n bold: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontWeight: \"bold\",\n };\n },\n italic: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontStyle: \"italic\",\n };\n },\n underline: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"underline\", // TODO: could conflict with strike\n };\n },\n strike: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"line-through\",\n };\n },\n backgroundColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n backgroundColor:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .background,\n };\n },\n textColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n color:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .text,\n };\n },\n code: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontFamily: \"GeistMono\",\n };\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailStyleMappingForDefaultSchema =\n createReactEmailStyleMappingForDefaultSchema();\n","import {\n reactEmailBlockMappingForDefaultSchema,\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nimport {\n reactEmailInlineContentMappingForDefaultSchema,\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nimport {\n reactEmailStyleMappingForDefaultSchema,\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Re-export for backward compatibility\nexport { reactEmailBlockMappingForDefaultSchema } from \"./blocks.js\";\nexport { reactEmailInlineContentMappingForDefaultSchema } from \"./inlinecontent.js\";\nexport { reactEmailStyleMappingForDefaultSchema } from \"./styles.js\";\n\n// Export the new configurable functions\nexport {\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nexport {\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nexport {\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Export the combined styles interface\nexport interface ReactEmailDefaultSchemaStyles {\n textStyles?: ReactEmailTextStyles;\n linkStyles?: ReactEmailLinkStyles;\n styleTransformStyles?: ReactEmailStyleTransformStyles;\n}\n\n// Export the default combined styles\nexport const defaultReactEmailDefaultSchemaStyles: ReactEmailDefaultSchemaStyles =\n {\n textStyles: defaultReactEmailTextStyles,\n linkStyles: defaultReactEmailLinkStyles,\n styleTransformStyles: defaultReactEmailStyleTransformStyles,\n };\n\nexport const reactEmailDefaultSchemaMappings = {\n blockMapping: reactEmailBlockMappingForDefaultSchema,\n inlineContentMapping: reactEmailInlineContentMappingForDefaultSchema,\n styleMapping: reactEmailStyleMappingForDefaultSchema,\n};\n\nexport const reactEmailDefaultSchemaMappingsWithStyles = (\n styles: ReactEmailDefaultSchemaStyles = defaultReactEmailDefaultSchemaStyles,\n): typeof reactEmailDefaultSchemaMappings => {\n return {\n blockMapping: createReactEmailBlockMappingForDefaultSchema(\n styles.textStyles,\n ),\n inlineContentMapping: createReactEmailInlineContentMappingForDefaultSchema(\n styles.linkStyles,\n ),\n styleMapping: createReactEmailStyleMappingForDefaultSchema(\n styles.styleTransformStyles,\n ),\n };\n};\n","import {\n Block,\n BlockNoteSchema,\n BlockSchema,\n COLORS_DEFAULT,\n DefaultProps,\n Exporter,\n ExporterOptions,\n InlineContentSchema,\n StyleSchema,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n Body,\n Head,\n Html,\n Link,\n Preview,\n Section,\n Tailwind,\n} from \"@react-email/components\";\nimport { render as renderEmail } from \"@react-email/render\";\nimport React, { CSSProperties } from \"react\";\n\nexport class ReactEmailExporter<\n B extends BlockSchema,\n S extends StyleSchema,\n I extends InlineContentSchema,\n> extends Exporter<\n B,\n I,\n S,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n> {\n public constructor(\n public readonly schema: BlockNoteSchema<B, I, S>,\n mappings: Exporter<\n NoInfer<B>,\n NoInfer<I>,\n NoInfer<S>,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n >[\"mappings\"],\n options?: Partial<ExporterOptions>,\n ) {\n const defaults = {\n colors: COLORS_DEFAULT,\n } satisfies Partial<ExporterOptions>;\n\n const newOptions = {\n ...defaults,\n ...options,\n };\n super(schema, mappings, newOptions);\n }\n\n public transformStyledText(styledText: StyledText<S>) {\n const stylesArray = this.mapStyles(styledText.styles);\n const styles = Object.assign({}, ...stylesArray);\n return (\n <span\n style={styles}\n dangerouslySetInnerHTML={{\n __html: styledText.text.replace(/\\n/g, \"<br />\"),\n }}\n />\n );\n }\n\n private async renderGroupedListBlocks(\n blocks: Block<B, I, S>[],\n startIndex: number,\n nestingLevel: number,\n ): Promise<{ element: React.ReactElement; nextIndex: number }> {\n const listType = blocks[startIndex].type;\n const listItems: React.ReactElement<any>[] = [];\n let j = startIndex;\n\n for (\n let itemIndex = 1;\n j < blocks.length && blocks[j].type === listType;\n j++, itemIndex++\n ) {\n const block = blocks[j];\n const liContent = (await this.mapBlock(\n block as any,\n nestingLevel,\n itemIndex,\n )) as any;\n let nestedList: React.ReactElement<any>[] = [];\n if (block.children && block.children.length > 0) {\n nestedList = await this.renderNestedLists(\n block.children,\n nestingLevel + 1,\n block.id,\n );\n }\n listItems.push(\n <li key={block.id}>\n {liContent}\n {nestedList.length > 0 && nestedList}\n </li>,\n );\n }\n let element: React.ReactElement;\n if (listType === \"bulletListItem\" || listType === \"toggleListItem\") {\n element = (\n <ul className=\"mb-2 list-disc pl-6\" key={blocks[startIndex].id + \"-ul\"}>\n {listItems}\n </ul>\n );\n } else {\n element = (\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={blocks[startIndex].id + \"-ol\"}\n >\n {listItems}\n </ol>\n );\n }\n return { element, nextIndex: j };\n }\n\n private async renderNestedLists(\n children: Block<B, I, S>[],\n nestingLevel: number,\n parentId: string,\n ): Promise<React.ReactElement<any>[]> {\n const nestedList: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < children.length) {\n const child = children[i];\n if (\n child.type === \"bulletListItem\" ||\n child.type === \"numberedListItem\"\n ) {\n // Group consecutive list items of the same type\n const listType = child.type;\n const listItems: React.ReactElement<any>[] = [];\n let j = i;\n\n for (\n let itemIndex = 1;\n j < children.length && children[j].type === listType;\n j++, itemIndex++\n ) {\n const listItem = children[j];\n const liContent = (await this.mapBlock(\n listItem as any,\n nestingLevel,\n itemIndex,\n )) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(\n listItem.props as any,\n );\n let nestedContent: React.ReactElement<any>[] = [];\n if (listItem.children && listItem.children.length > 0) {\n // If children are list items, render as nested list; otherwise, as normal blocks\n if (\n listItem.children[0] &&\n (listItem.children[0].type === \"bulletListItem\" ||\n listItem.children[0].type === \"numberedListItem\")\n ) {\n nestedContent = await this.renderNestedLists(\n listItem.children,\n nestingLevel + 1,\n listItem.id,\n );\n } else {\n nestedContent = await this.transformBlocks(\n listItem.children,\n nestingLevel + 1,\n );\n }\n }\n listItems.push(\n <li key={listItem.id} style={style}>\n {liContent}\n {nestedContent.length > 0 && (\n <div style={{ marginTop: \"8px\" }}>{nestedContent}</div>\n )}\n </li>,\n );\n }\n if (listType === \"bulletListItem\") {\n nestedList.push(\n <ul\n className=\"mb-2 list-disc pl-6\"\n key={parentId + \"-ul-nested-\" + i}\n >\n {listItems}\n </ul>,\n );\n } else {\n nestedList.push(\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={parentId + \"-ol-nested-\" + i}\n >\n {listItems}\n </ol>,\n );\n }\n i = j;\n } else {\n // Non-list child, render as normal with indentation\n const childBlocks = await this.transformBlocks([child], nestingLevel);\n nestedList.push(\n <Section key={child.id} style={{ marginLeft: \"24px\" }}>\n {childBlocks}\n </Section>,\n );\n i++;\n }\n }\n return nestedList;\n }\n\n public async transformBlocks(\n blocks: Block<B, I, S>[],\n nestingLevel = 0,\n ): Promise<React.ReactElement<any>[]> {\n const ret: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < blocks.length) {\n const b = blocks[i];\n if (\n b.type === \"bulletListItem\" ||\n b.type === \"numberedListItem\" ||\n b.type === \"toggleListItem\"\n ) {\n const { element, nextIndex } = await this.renderGroupedListBlocks(\n blocks,\n i,\n nestingLevel,\n );\n ret.push(element);\n i = nextIndex;\n continue;\n }\n // Non-list blocks\n const children = await this.transformBlocks(b.children, nestingLevel + 1);\n const self = (await this.mapBlock(b as any, nestingLevel, 0)) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(b.props as any);\n ret.push(\n <React.Fragment key={b.id}>\n <Section style={style}>{self}</Section>\n {children.length > 0 && (\n <div style={{ marginLeft: \"24px\" }}>{children}</div>\n )}\n </React.Fragment>,\n );\n i++;\n }\n return ret;\n }\n\n public async toReactEmailDocument(\n blocks: Block<B, I, S>[],\n options?: {\n /**\n * Inject elements into the {@link Head} element\n * @see https://react.email/docs/components/head\n */\n head?: React.ReactElement;\n /**\n * Set the preview text for the email\n * @see https://react.email/docs/components/preview\n */\n preview?: string | string[];\n /**\n * Add a header to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n header?: React.ReactElement;\n /**\n * Add a footer to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n footer?: React.ReactElement;\n /**\n * Customize the container element\n */\n container?: React.FC<{ children: React.ReactNode }>;\n },\n ) {\n const transformedBlocks = await this.transformBlocks(blocks);\n const DefaultContainer =\n options?.container ||\n (({ children }: { children: React.ReactNode }) => (\n <React.Fragment>{children}</React.Fragment>\n ));\n return renderEmail(\n <Html>\n <Head>{options?.head}</Head>\n <Body\n style={{\n fontFamily:\n \"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif\",\n fontSize: \"16px\",\n lineHeight: \"1.5\",\n color: \"#333\",\n }}\n >\n {options?.preview && <Preview>{options.preview}</Preview>}\n <Tailwind>\n <DefaultContainer>\n {options?.header}\n {transformedBlocks}\n {options?.footer}\n </DefaultContainer>\n </Tailwind>\n </Body>\n </Html>,\n );\n }\n\n protected blocknoteDefaultPropsToReactEmailStyle(\n props: Partial<DefaultProps>,\n ): any {\n return {\n textAlign: props.textAlignment,\n backgroundColor:\n props.backgroundColor === \"default\" || !props.backgroundColor\n ? undefined\n : this.options.colors[props.backgroundColor]?.background,\n color:\n props.textColor === \"default\" || !props.textColor\n ? undefined\n : this.options.colors[props.textColor]?.text,\n alignItems:\n props.textAlignment === \"right\"\n ? \"flex-end\"\n : props.textAlignment === \"center\"\n ? \"center\"\n : undefined,\n };\n }\n}\n"],"names":["defaultTextStyle","defaultReactEmailTextStyles","createReactEmailBlockMappingForDefaultSchema","textStyles","block","jsx","Text","_a","_nestingLevel","checkboxSvg","jsxs","_b","Heading","textContent","CodeBlock","dracula","icon","previewWidth","FileLink","Caption","Img","table","headerRowsCount","headerColsCount","row","rowIndex","cell","colIndex","normalizedCell","mapTableCell","isHeaderRow","isHeaderCol","isHeader","reactEmailBlockMappingForDefaultSchema","url","name","defaultText","Link","caption","width","defaultReactEmailLinkStyles","createReactEmailInlineContentMappingForDefaultSchema","linkStyles","ic","content","reactEmailInlineContentMappingForDefaultSchema","defaultReactEmailStyleTransformStyles","createReactEmailStyleMappingForDefaultSchema","_styleTransformStyles","val","exporter","reactEmailStyleMappingForDefaultSchema","defaultReactEmailDefaultSchemaStyles","reactEmailDefaultSchemaMappings","reactEmailDefaultSchemaMappingsWithStyles","styles","ReactEmailExporter","Exporter","schema","mappings","options","newOptions","COLORS_DEFAULT","styledText","stylesArray","blocks","startIndex","nestingLevel","listType","listItems","j","itemIndex","liContent","nestedList","element","children","parentId","child","listItem","style","nestedContent","childBlocks","Section","ret","i","b","nextIndex","self","React","transformedBlocks","DefaultContainer","renderEmail","Html","Head","Body","Preview","Tailwind","props"],"mappings":";;;;;AAwCA,MAAMA,IAAuC;AAAA,EAC3C,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AACb,GAGaC,IAA8B;AAAA,EACzC,WAAW;AAAA,IACT,OAAOD;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAOA;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;AAAA,QAAA,gBAAAvF,EAACwF,GAAA,EAAM,iCAAS,KAAA,CAAK;AAAA,QACrB,gBAAAnF;AAAA,UAACoF;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,cACL,YACE;AAAA,cACF,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,OAAO;AAAA,YAAA;AAAA,YAGR,UAAA;AAAA,eAAAlC,KAAA,gBAAAA,EAAS,YAAW,gBAAAvD,EAAC0F,GAAA,EAAS,UAAAnC,EAAQ,SAAQ;AAAA,cAC/C,gBAAAvD,EAAC2F,GAAA,EACC,UAAA,gBAAAtF,EAACgF,GAAA,EACE,UAAA;AAAA,gBAAA9B,KAAA,gBAAAA,EAAS;AAAA,gBACT6B;AAAA,gBACA7B,KAAA,gBAAAA,EAAS;AAAA,cAAA,EAAA,CACZ,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEU,uCACRqC,GACK;;AACL,WAAO;AAAA,MACL,WAAWA,EAAM;AAAA,MACjB,iBACEA,EAAM,oBAAoB,aAAa,CAACA,EAAM,oBAE1C1F,IAAA,KAAK,QAAQ,OAAO0F,EAAM,eAAe,MAAzC,OADA,SACA1F,EAA4C;AAAA,MAClD,OACE0F,EAAM,cAAc,aAAa,CAACA,EAAM,cAEpCtF,IAAA,KAAK,QAAQ,OAAOsF,EAAM,SAAS,MAAnC,OADA,SACAtF,EAAsC;AAAA,MAC5C,YACEsF,EAAM,kBAAkB,UACpB,aACAA,EAAM,kBAAkB,WACtB,WACA;AAAA,IAAA;AAAA,EAEZ;AACF;"}
@@ -1,2 +1,2 @@
1
- (function(o,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("@blocknote/core"),require("@react-email/components"),require("@react-email/render"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@blocknote/core","@react-email/components","@react-email/render","react"],l):(o=typeof globalThis<"u"?globalThis:o||self,l(o["blocknote-xl-email-exporter"]={},o.jsxRuntime,o.core,o.components,o.render,o.React))})(this,function(o,l,w,s,F,A){"use strict";const H=(i=>i&&typeof i=="object"&&"default"in i?i:{default:i})(A),y={fontSize:16,lineHeight:1.5,margin:3,minHeight:24},g={paragraph:{style:y},bulletListItem:{style:y},toggleListItem:{style:y},numberedListItem:{style:y},checkListItem:{style:y},quote:{style:y},tableError:{style:y},tableCell:{style:y},caption:{style:y},heading1:{style:{fontSize:48,margin:3}},heading2:{style:{fontSize:36,margin:3}},heading3:{style:{fontSize:24,margin:3}},heading4:{style:{fontSize:20,margin:3}},heading5:{style:{fontSize:18,margin:3}},heading6:{style:{fontSize:16,margin:3}},codeBlock:{style:y}},S=(i=g)=>({paragraph:(e,t)=>{var r;return l.jsx(s.Text,{...i.paragraph,style:{...g.paragraph.style,...(r=i.paragraph)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},bulletListItem:(e,t)=>{var r;return l.jsx(s.Text,{...i.bulletListItem,style:{...g.bulletListItem.style,...(r=i.bulletListItem)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},toggleListItem:(e,t)=>{var r;return l.jsx(s.Text,{...i.toggleListItem,style:{...g.toggleListItem.style,...(r=i.toggleListItem)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},numberedListItem:(e,t,r)=>{var a;return l.jsx(s.Text,{...i.numberedListItem,style:{...g.numberedListItem.style,...(a=i.numberedListItem)==null?void 0:a.style},children:t.transformInlineContent(e.content)})},checkListItem:(e,t)=>{var n,c;const a=((n=e.props)==null?void 0:n.checked)?l.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",style:{display:"inline",verticalAlign:"middle",marginRight:8},children:[l.jsx("rect",{x:"2",y:"2",width:"14",height:"14",rx:"3",fill:"#4F8A10",stroke:"#4F8A10",strokeWidth:"2"}),l.jsx("polyline",{points:"5,10 8,13 13,6",fill:"none",stroke:"#fff",strokeWidth:"2"})]}):l.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",style:{display:"inline",verticalAlign:"middle",marginRight:8},children:l.jsx("rect",{x:"2",y:"2",width:"14",height:"14",rx:"3",fill:"#fff",stroke:"#888",strokeWidth:"2"})});return l.jsxs(s.Text,{...i.checkListItem,style:{...g.checkListItem.style,...(c=i.checkListItem)==null?void 0:c.style},children:[a,l.jsx("span",{children:t.transformInlineContent(e.content)})]})},heading:(e,t)=>{var r;return l.jsx(s.Heading,{as:`h${e.props.level}`,...i[`heading${e.props.level}`],style:{...g[`heading${e.props.level}`].style,...(r=i[`heading${e.props.level}`])==null?void 0:r.style},children:t.transformInlineContent(e.content)})},codeBlock:e=>{var r,a;const t=((r=e.content[0])==null?void 0:r.text)||"";return l.jsx(s.CodeBlock,{code:t,fontFamily:"'CommitMono', monospace",language:e.props.language,theme:s.dracula,...i.codeBlock,style:{...g.codeBlock.style,...(a=i.codeBlock)==null?void 0:a.style}})},audio:e=>{const t=l.jsx("svg",{height:"18",width:"18",viewBox:"0 0 24 24",fill:"#4F8A10",style:{display:"inline",verticalAlign:"middle"},children:l.jsx("path",{d:"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})}),r="previewWidth"in e.props?e.props.previewWidth:void 0;return l.jsxs("div",{style:{margin:"8px 0"},children:[l.jsx(x,{url:e.props.url,name:e.props.name,defaultText:"Open audio file",icon:t}),l.jsx(b,{caption:e.props.caption,width:r,textStyles:i})]})},video:e=>{const t=l.jsx("svg",{height:"18",width:"18",viewBox:"0 0 24 24",fill:"#1976D2",style:{display:"inline",verticalAlign:"middle"},children:l.jsx("path",{d:"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"})}),r="previewWidth"in e.props?e.props.previewWidth:void 0;return l.jsxs("div",{style:{margin:"8px 0"},children:[l.jsx(x,{url:e.props.url,name:e.props.name,defaultText:"Open video file",icon:t}),l.jsx(b,{caption:e.props.caption,width:r,textStyles:i})]})},file:e=>{const t=l.jsx("svg",{height:"18",width:"18",viewBox:"0 0 24 24",fill:"#888",style:{display:"inline",verticalAlign:"middle"},children:l.jsx("path",{d:"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"})}),r="previewWidth"in e.props?e.props.previewWidth:void 0;return l.jsxs("div",{style:{margin:"8px 0"},children:[l.jsx(x,{url:e.props.url,name:e.props.name,defaultText:"Open file",icon:t}),l.jsx(b,{caption:e.props.caption,width:r,textStyles:i})]})},image:e=>l.jsx(s.Img,{src:e.props.url,width:e.props.previewWidth,alt:e.props.caption}),table:(e,t)=>{const r=e.content;if(!r||typeof r!="object"||!Array.isArray(r.rows))return l.jsx(s.Text,{...i.tableError,children:"Table data not available"});const a=r.headerRows??0,n=r.headerCols??0;return l.jsx("table",{style:{borderCollapse:"collapse",width:"100%",margin:"16px 0",border:"1px solid #ddd",borderRadius:4,overflow:"hidden"},border:0,cellPadding:0,cellSpacing:0,children:l.jsx("tbody",{children:r.rows.map((c,f)=>l.jsx("tr",{children:c.cells.map((m,d)=>{var V;const h=w.mapTableCell(m),p=f<a,M=d<n,C=p||M,u=C?"th":"td";return l.jsx(u,{style:{border:"1px solid #ddd",padding:"8px 12px",background:h.props.backgroundColor!=="default"?t.options.colors[h.props.backgroundColor].background:"inherit",fontWeight:C?"bold":void 0,textAlign:h.props.textAlignment||"left",color:h.props.textColor!=="default"?t.options.colors[h.props.textColor].text:"inherit",...g.tableCell.style,...(V=i.tableCell)==null?void 0:V.style},...(h.props.colspan||1)>1&&{colSpan:h.props.colspan||1},...(h.props.rowspan||1)>1&&{rowSpan:h.props.rowspan||1},children:t.transformInlineContent(h.content)},"row_"+f+"_col_"+d)})},"row-"+f))})})},quote:(e,t)=>{var r;return l.jsx(s.Text,{...i.quote,style:{borderLeft:"2px solid #bdbdbd",padding:"0px 12px",fontStyle:"italic",color:t.options.colors.gray.text,display:"block",...g.quote.style,...(r=i.quote)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},pageBreak:()=>l.jsx("hr",{style:{border:"none",borderTop:"2px dashed #ccc",margin:"24px 0"}}),divider:()=>l.jsx("hr",{style:{border:"none",borderTop:"1px solid #ccc",margin:"11.5px 0"}})}),T=S();function x({url:i,name:e,defaultText:t,icon:r}){return l.jsxs(s.Link,{href:i,style:{textDecoration:"none",color:"#333",display:"inline-flex",alignItems:"center",gap:8,fontSize:16},children:[r,l.jsx("span",{style:{verticalAlign:"middle"},children:e||t})]})}function b({caption:i,width:e,textStyles:t}){var r;return i?l.jsx(s.Text,{...t.caption,style:{width:e,fontSize:13,color:"#888",margin:"4px 0 0 0",...g.caption.style,...(r=t.caption)==null?void 0:r.style},children:i}):null}const L={link:{}},I=(i=L)=>({link:(e,t)=>l.jsxs(s.Link,{href:e.href,...i.link,children:[...e.content.map(r=>t.transformStyledText(r))]}),text:(e,t)=>t.transformStyledText(e)}),E=I(),v={},k=(i=v)=>({bold:e=>e?{fontWeight:"bold"}:{},italic:e=>e?{fontStyle:"italic"}:{},underline:e=>e?{textDecoration:"underline"}:{},strike:e=>e?{textDecoration:"line-through"}:{},backgroundColor:(e,t)=>e?{backgroundColor:t.options.colors[e].background}:{},textColor:(e,t)=>e?{color:t.options.colors[e].text}:{},code:e=>e?{fontFamily:"GeistMono"}:{}}),D=k(),B={textStyles:g,linkStyles:L,styleTransformStyles:v},W={blockMapping:T,inlineContentMapping:E,styleMapping:D},Z=(i=B)=>({blockMapping:S(i.textStyles),inlineContentMapping:I(i.linkStyles),styleMapping:k(i.styleTransformStyles)});class _ extends w.Exporter{constructor(e,t,r){const n={...{colors:w.COLORS_DEFAULT},...r};super(e,t,n),this.schema=e}transformStyledText(e){const t=this.mapStyles(e.styles),r=Object.assign({},...t);return l.jsx("span",{style:r,dangerouslySetInnerHTML:{__html:e.text.replace(/\n/g,"<br />")}})}async renderGroupedListBlocks(e,t,r){const a=e[t].type,n=[];let c=t;for(let m=1;c<e.length&&e[c].type===a;c++,m++){const d=e[c],h=await this.mapBlock(d,r,m);let p=[];d.children&&d.children.length>0&&(p=await this.renderNestedLists(d.children,r+1,d.id)),n.push(l.jsxs("li",{children:[h,p.length>0&&p]},d.id))}let f;return a==="bulletListItem"||a==="toggleListItem"?f=l.jsx("ul",{className:"mb-2 list-disc pl-6",children:n},e[t].id+"-ul"):f=l.jsx("ol",{className:"mb-2 list-decimal pl-6",start:1,children:n},e[t].id+"-ol"),{element:f,nextIndex:c}}async renderNestedLists(e,t,r){const a=[];let n=0;for(;n<e.length;){const c=e[n];if(c.type==="bulletListItem"||c.type==="numberedListItem"){const f=c.type,m=[];let d=n;for(let h=1;d<e.length&&e[d].type===f;d++,h++){const p=e[d],M=await this.mapBlock(p,t,h),C=this.blocknoteDefaultPropsToReactEmailStyle(p.props);let u=[];p.children&&p.children.length>0&&(p.children[0]&&(p.children[0].type==="bulletListItem"||p.children[0].type==="numberedListItem")?u=await this.renderNestedLists(p.children,t+1,p.id):u=await this.transformBlocks(p.children,t+1)),m.push(l.jsxs("li",{style:C,children:[M,u.length>0&&l.jsx("div",{style:{marginTop:"8px"},children:u})]},p.id))}f==="bulletListItem"?a.push(l.jsx("ul",{className:"mb-2 list-disc pl-6",children:m},r+"-ul-nested-"+n)):a.push(l.jsx("ol",{className:"mb-2 list-decimal pl-6",start:1,children:m},r+"-ol-nested-"+n)),n=d}else{const f=await this.transformBlocks([c],t);a.push(l.jsx(s.Section,{style:{marginLeft:"24px"},children:f},c.id)),n++}}return a}async transformBlocks(e,t=0){const r=[];let a=0;for(;a<e.length;){const n=e[a];if(n.type==="bulletListItem"||n.type==="numberedListItem"||n.type==="toggleListItem"){const{element:d,nextIndex:h}=await this.renderGroupedListBlocks(e,a,t);r.push(d),a=h;continue}const c=await this.transformBlocks(n.children,t+1),f=await this.mapBlock(n,t,0),m=this.blocknoteDefaultPropsToReactEmailStyle(n.props);r.push(l.jsxs(H.default.Fragment,{children:[l.jsx(s.Section,{style:m,children:f}),c.length>0&&l.jsx("div",{style:{marginLeft:"24px"},children:c})]},n.id)),a++}return r}async toReactEmailDocument(e,t){const r=await this.transformBlocks(e),a=(t==null?void 0:t.container)||(({children:n})=>l.jsx(H.default.Fragment,{children:n}));return F.render(l.jsxs(s.Html,{children:[l.jsx(s.Head,{children:t==null?void 0:t.head}),l.jsxs(s.Body,{style:{fontFamily:"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif",fontSize:"16px",lineHeight:"1.5",color:"#333"},children:[(t==null?void 0:t.preview)&&l.jsx(s.Preview,{children:t.preview}),l.jsx(s.Tailwind,{children:l.jsxs(a,{children:[t==null?void 0:t.header,r,t==null?void 0:t.footer]})})]})]}))}blocknoteDefaultPropsToReactEmailStyle(e){return{textAlign:e.textAlignment,backgroundColor:e.backgroundColor==="default"||!e.backgroundColor?void 0:this.options.colors[e.backgroundColor].background,color:e.textColor==="default"||!e.textColor?void 0:this.options.colors[e.textColor].text,alignItems:e.textAlignment==="right"?"flex-end":e.textAlignment==="center"?"center":void 0}}}o.ReactEmailExporter=_,o.createReactEmailBlockMappingForDefaultSchema=S,o.createReactEmailInlineContentMappingForDefaultSchema=I,o.createReactEmailStyleMappingForDefaultSchema=k,o.defaultReactEmailDefaultSchemaStyles=B,o.defaultReactEmailLinkStyles=L,o.defaultReactEmailStyleTransformStyles=v,o.defaultReactEmailTextStyles=g,o.reactEmailBlockMappingForDefaultSchema=T,o.reactEmailDefaultSchemaMappings=W,o.reactEmailDefaultSchemaMappingsWithStyles=Z,o.reactEmailInlineContentMappingForDefaultSchema=E,o.reactEmailStyleMappingForDefaultSchema=D,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("@blocknote/core"),require("@react-email/components"),require("@react-email/render"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@blocknote/core","@react-email/components","@react-email/render","react"],l):(o=typeof globalThis<"u"?globalThis:o||self,l(o["blocknote-xl-email-exporter"]={},o.jsxRuntime,o.core,o.components,o.render,o.React))})(this,function(o,l,w,s,F,A){"use strict";const H=(i=>i&&typeof i=="object"&&"default"in i?i:{default:i})(A),y={fontSize:16,lineHeight:1.5,margin:3,minHeight:24},g={paragraph:{style:y},bulletListItem:{style:y},toggleListItem:{style:y},numberedListItem:{style:y},checkListItem:{style:y},quote:{style:y},tableError:{style:y},tableCell:{style:y},caption:{style:y},heading1:{style:{fontSize:48,margin:3}},heading2:{style:{fontSize:36,margin:3}},heading3:{style:{fontSize:24,margin:3}},heading4:{style:{fontSize:20,margin:3}},heading5:{style:{fontSize:18,margin:3}},heading6:{style:{fontSize:16,margin:3}},codeBlock:{style:y}},S=(i=g)=>({paragraph:(e,t)=>{var r;return l.jsx(s.Text,{...i.paragraph,style:{...g.paragraph.style,...(r=i.paragraph)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},bulletListItem:(e,t)=>{var r;return l.jsx(s.Text,{...i.bulletListItem,style:{...g.bulletListItem.style,...(r=i.bulletListItem)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},toggleListItem:(e,t)=>{var r;return l.jsx(s.Text,{...i.toggleListItem,style:{...g.toggleListItem.style,...(r=i.toggleListItem)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},numberedListItem:(e,t,r)=>{var a;return l.jsx(s.Text,{...i.numberedListItem,style:{...g.numberedListItem.style,...(a=i.numberedListItem)==null?void 0:a.style},children:t.transformInlineContent(e.content)})},checkListItem:(e,t)=>{var n,c;const a=((n=e.props)==null?void 0:n.checked)?l.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",style:{display:"inline",verticalAlign:"middle",marginRight:8},children:[l.jsx("rect",{x:"2",y:"2",width:"14",height:"14",rx:"3",fill:"#4F8A10",stroke:"#4F8A10",strokeWidth:"2"}),l.jsx("polyline",{points:"5,10 8,13 13,6",fill:"none",stroke:"#fff",strokeWidth:"2"})]}):l.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",style:{display:"inline",verticalAlign:"middle",marginRight:8},children:l.jsx("rect",{x:"2",y:"2",width:"14",height:"14",rx:"3",fill:"#fff",stroke:"#888",strokeWidth:"2"})});return l.jsxs(s.Text,{...i.checkListItem,style:{...g.checkListItem.style,...(c=i.checkListItem)==null?void 0:c.style},children:[a,l.jsx("span",{children:t.transformInlineContent(e.content)})]})},heading:(e,t)=>{var r;return l.jsx(s.Heading,{as:`h${e.props.level}`,...i[`heading${e.props.level}`],style:{...g[`heading${e.props.level}`].style,...(r=i[`heading${e.props.level}`])==null?void 0:r.style},children:t.transformInlineContent(e.content)})},codeBlock:e=>{var r,a;const t=((r=e.content[0])==null?void 0:r.text)||"";return l.jsx(s.CodeBlock,{code:t,fontFamily:"'CommitMono', monospace",language:e.props.language,theme:s.dracula,...i.codeBlock,style:{...g.codeBlock.style,...(a=i.codeBlock)==null?void 0:a.style}})},audio:e=>{const t=l.jsx("svg",{height:"18",width:"18",viewBox:"0 0 24 24",fill:"#4F8A10",style:{display:"inline",verticalAlign:"middle"},children:l.jsx("path",{d:"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})}),r="previewWidth"in e.props?e.props.previewWidth:void 0;return l.jsxs("div",{style:{margin:"8px 0"},children:[l.jsx(x,{url:e.props.url,name:e.props.name,defaultText:"Open audio file",icon:t}),l.jsx(b,{caption:e.props.caption,width:r,textStyles:i})]})},video:e=>{const t=l.jsx("svg",{height:"18",width:"18",viewBox:"0 0 24 24",fill:"#1976D2",style:{display:"inline",verticalAlign:"middle"},children:l.jsx("path",{d:"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"})}),r="previewWidth"in e.props?e.props.previewWidth:void 0;return l.jsxs("div",{style:{margin:"8px 0"},children:[l.jsx(x,{url:e.props.url,name:e.props.name,defaultText:"Open video file",icon:t}),l.jsx(b,{caption:e.props.caption,width:r,textStyles:i})]})},file:e=>{const t=l.jsx("svg",{height:"18",width:"18",viewBox:"0 0 24 24",fill:"#888",style:{display:"inline",verticalAlign:"middle"},children:l.jsx("path",{d:"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"})}),r="previewWidth"in e.props?e.props.previewWidth:void 0;return l.jsxs("div",{style:{margin:"8px 0"},children:[l.jsx(x,{url:e.props.url,name:e.props.name,defaultText:"Open file",icon:t}),l.jsx(b,{caption:e.props.caption,width:r,textStyles:i})]})},image:e=>l.jsx(s.Img,{src:e.props.url,width:e.props.previewWidth,alt:e.props.caption}),table:(e,t)=>{const r=e.content;if(!r||typeof r!="object"||!Array.isArray(r.rows))return l.jsx(s.Text,{...i.tableError,children:"Table data not available"});const a=r.headerRows??0,n=r.headerCols??0;return l.jsx("table",{style:{borderCollapse:"collapse",width:"100%",margin:"16px 0",border:"1px solid #ddd",borderRadius:4,overflow:"hidden"},border:0,cellPadding:0,cellSpacing:0,children:l.jsx("tbody",{children:r.rows.map((c,f)=>l.jsx("tr",{children:c.cells.map((m,d)=>{var V;const h=w.mapTableCell(m),p=f<a,M=d<n,C=p||M,u=C?"th":"td";return l.jsx(u,{style:{border:"1px solid #ddd",padding:"8px 12px",background:h.props.backgroundColor!=="default"?t.options.colors[h.props.backgroundColor].background:"inherit",fontWeight:C?"bold":void 0,textAlign:h.props.textAlignment||"left",color:h.props.textColor!=="default"?t.options.colors[h.props.textColor].text:"inherit",...g.tableCell.style,...(V=i.tableCell)==null?void 0:V.style},...(h.props.colspan||1)>1&&{colSpan:h.props.colspan||1},...(h.props.rowspan||1)>1&&{rowSpan:h.props.rowspan||1},children:t.transformInlineContent(h.content)},"row_"+f+"_col_"+d)})},"row-"+f))})})},quote:(e,t)=>{var r;return l.jsx(s.Text,{...i.quote,style:{borderLeft:"2px solid #bdbdbd",padding:"0px 12px",fontStyle:"italic",color:t.options.colors.gray.text,display:"block",...g.quote.style,...(r=i.quote)==null?void 0:r.style},children:t.transformInlineContent(e.content)})},pageBreak:()=>l.jsx("hr",{style:{border:"none",borderTop:"2px dashed #ccc",margin:"24px 0"}}),divider:()=>l.jsx("hr",{style:{border:"none",borderTop:"1px solid #ccc",margin:"11.5px 0"}})}),T=S();function x({url:i,name:e,defaultText:t,icon:r}){return l.jsxs(s.Link,{href:i,style:{textDecoration:"none",color:"#333",display:"inline-flex",alignItems:"center",gap:8,fontSize:16},children:[r,l.jsx("span",{style:{verticalAlign:"middle"},children:e||t})]})}function b({caption:i,width:e,textStyles:t}){var r;return i?l.jsx(s.Text,{...t.caption,style:{width:e,fontSize:13,color:"#888",margin:"4px 0 0 0",...g.caption.style,...(r=t.caption)==null?void 0:r.style},children:i}):null}const L={link:{}},I=(i=L)=>({link:(e,t)=>l.jsxs(s.Link,{href:e.href,...i.link,children:[...e.content.map(r=>t.transformStyledText(r))]}),text:(e,t)=>t.transformStyledText(e)}),E=I(),v={},k=(i=v)=>({bold:e=>e?{fontWeight:"bold"}:{},italic:e=>e?{fontStyle:"italic"}:{},underline:e=>e?{textDecoration:"underline"}:{},strike:e=>e?{textDecoration:"line-through"}:{},backgroundColor:(e,t)=>e?{backgroundColor:t.options.colors[e].background}:{},textColor:(e,t)=>e?{color:t.options.colors[e].text}:{},code:e=>e?{fontFamily:"GeistMono"}:{}}),D=k(),B={textStyles:g,linkStyles:L,styleTransformStyles:v},W={blockMapping:T,inlineContentMapping:E,styleMapping:D},Z=(i=B)=>({blockMapping:S(i.textStyles),inlineContentMapping:I(i.linkStyles),styleMapping:k(i.styleTransformStyles)});class _ extends w.Exporter{constructor(e,t,r){const n={...{colors:w.COLORS_DEFAULT},...r};super(e,t,n),this.schema=e}transformStyledText(e){const t=this.mapStyles(e.styles),r=Object.assign({},...t);return l.jsx("span",{style:r,dangerouslySetInnerHTML:{__html:e.text.replace(/\n/g,"<br />")}})}async renderGroupedListBlocks(e,t,r){const a=e[t].type,n=[];let c=t;for(let m=1;c<e.length&&e[c].type===a;c++,m++){const d=e[c],h=await this.mapBlock(d,r,m);let p=[];d.children&&d.children.length>0&&(p=await this.renderNestedLists(d.children,r+1,d.id)),n.push(l.jsxs("li",{children:[h,p.length>0&&p]},d.id))}let f;return a==="bulletListItem"||a==="toggleListItem"?f=l.jsx("ul",{className:"mb-2 list-disc pl-6",children:n},e[t].id+"-ul"):f=l.jsx("ol",{className:"mb-2 list-decimal pl-6",start:1,children:n},e[t].id+"-ol"),{element:f,nextIndex:c}}async renderNestedLists(e,t,r){const a=[];let n=0;for(;n<e.length;){const c=e[n];if(c.type==="bulletListItem"||c.type==="numberedListItem"){const f=c.type,m=[];let d=n;for(let h=1;d<e.length&&e[d].type===f;d++,h++){const p=e[d],M=await this.mapBlock(p,t,h),C=this.blocknoteDefaultPropsToReactEmailStyle(p.props);let u=[];p.children&&p.children.length>0&&(p.children[0]&&(p.children[0].type==="bulletListItem"||p.children[0].type==="numberedListItem")?u=await this.renderNestedLists(p.children,t+1,p.id):u=await this.transformBlocks(p.children,t+1)),m.push(l.jsxs("li",{style:C,children:[M,u.length>0&&l.jsx("div",{style:{marginTop:"8px"},children:u})]},p.id))}f==="bulletListItem"?a.push(l.jsx("ul",{className:"mb-2 list-disc pl-6",children:m},r+"-ul-nested-"+n)):a.push(l.jsx("ol",{className:"mb-2 list-decimal pl-6",start:1,children:m},r+"-ol-nested-"+n)),n=d}else{const f=await this.transformBlocks([c],t);a.push(l.jsx(s.Section,{style:{marginLeft:"24px"},children:f},c.id)),n++}}return a}async transformBlocks(e,t=0){const r=[];let a=0;for(;a<e.length;){const n=e[a];if(n.type==="bulletListItem"||n.type==="numberedListItem"||n.type==="toggleListItem"){const{element:d,nextIndex:h}=await this.renderGroupedListBlocks(e,a,t);r.push(d),a=h;continue}const c=await this.transformBlocks(n.children,t+1),f=await this.mapBlock(n,t,0),m=this.blocknoteDefaultPropsToReactEmailStyle(n.props);r.push(l.jsxs(H.default.Fragment,{children:[l.jsx(s.Section,{style:m,children:f}),c.length>0&&l.jsx("div",{style:{marginLeft:"24px"},children:c})]},n.id)),a++}return r}async toReactEmailDocument(e,t){const r=await this.transformBlocks(e),a=(t==null?void 0:t.container)||(({children:n})=>l.jsx(H.default.Fragment,{children:n}));return F.render(l.jsxs(s.Html,{children:[l.jsx(s.Head,{children:t==null?void 0:t.head}),l.jsxs(s.Body,{style:{fontFamily:"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif",fontSize:"16px",lineHeight:"1.5",color:"#333"},children:[(t==null?void 0:t.preview)&&l.jsx(s.Preview,{children:t.preview}),l.jsx(s.Tailwind,{children:l.jsxs(a,{children:[t==null?void 0:t.header,r,t==null?void 0:t.footer]})})]})]}))}blocknoteDefaultPropsToReactEmailStyle(e){var t,r;return{textAlign:e.textAlignment,backgroundColor:e.backgroundColor==="default"||!e.backgroundColor||(t=this.options.colors[e.backgroundColor])==null?void 0:t.background,color:e.textColor==="default"||!e.textColor||(r=this.options.colors[e.textColor])==null?void 0:r.text,alignItems:e.textAlignment==="right"?"flex-end":e.textAlignment==="center"?"center":void 0}}}o.ReactEmailExporter=_,o.createReactEmailBlockMappingForDefaultSchema=S,o.createReactEmailInlineContentMappingForDefaultSchema=I,o.createReactEmailStyleMappingForDefaultSchema=k,o.defaultReactEmailDefaultSchemaStyles=B,o.defaultReactEmailLinkStyles=L,o.defaultReactEmailStyleTransformStyles=v,o.defaultReactEmailTextStyles=g,o.reactEmailBlockMappingForDefaultSchema=T,o.reactEmailDefaultSchemaMappings=W,o.reactEmailDefaultSchemaMappingsWithStyles=Z,o.reactEmailInlineContentMappingForDefaultSchema=E,o.reactEmailStyleMappingForDefaultSchema=D,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=blocknote-xl-email-exporter.umd.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocknote-xl-email-exporter.umd.cjs","sources":["../src/react-email/defaultSchema/blocks.tsx","../src/react-email/defaultSchema/inlinecontent.tsx","../src/react-email/defaultSchema/styles.tsx","../src/react-email/defaultSchema/index.ts","../src/react-email/reactEmailExporter.tsx"],"sourcesContent":["import {\n BlockMapping,\n createPageBreakBlockConfig,\n DefaultBlockSchema,\n mapTableCell,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n CodeBlock,\n dracula,\n Heading,\n Img,\n Link,\n PrismLanguage,\n Text,\n} from \"@react-email/components\";\n\n// Define TextProps type based on React Email Text component\ntype TextProps = React.ComponentPropsWithoutRef<typeof Text>;\n\n// Define the styles interface for configurable Text components\nexport interface ReactEmailTextStyles {\n paragraph?: Partial<TextProps>;\n bulletListItem?: Partial<TextProps>;\n toggleListItem?: Partial<TextProps>;\n numberedListItem?: Partial<TextProps>;\n checkListItem?: Partial<TextProps>;\n quote?: Partial<TextProps>;\n tableError?: Partial<TextProps>;\n tableCell?: Partial<TextProps>;\n caption?: Partial<TextProps>;\n heading1?: Partial<TextProps>;\n heading2?: Partial<TextProps>;\n heading3?: Partial<TextProps>;\n heading4?: Partial<TextProps>;\n heading5?: Partial<TextProps>;\n heading6?: Partial<TextProps>;\n codeBlock?: Partial<React.ComponentProps<typeof CodeBlock>>;\n}\n\nconst defaultTextStyle: TextProps[\"style\"] = {\n fontSize: 16,\n lineHeight: 1.5,\n margin: 3,\n minHeight: 24,\n};\n\n// Default styles for Text components\nexport const defaultReactEmailTextStyles = {\n paragraph: {\n style: defaultTextStyle,\n },\n bulletListItem: {\n style: defaultTextStyle,\n },\n toggleListItem: {\n style: defaultTextStyle,\n },\n numberedListItem: {\n style: defaultTextStyle,\n },\n checkListItem: {\n style: defaultTextStyle,\n },\n quote: {\n style: defaultTextStyle,\n },\n tableError: {\n style: defaultTextStyle,\n },\n tableCell: {\n style: defaultTextStyle,\n },\n caption: {\n style: defaultTextStyle,\n },\n heading1: {\n style: {\n fontSize: 48,\n margin: 3,\n },\n },\n heading2: {\n style: {\n fontSize: 36,\n margin: 3,\n },\n },\n heading3: {\n style: {\n fontSize: 24,\n margin: 3,\n },\n },\n heading4: {\n style: {\n fontSize: 20,\n margin: 3,\n },\n },\n heading5: {\n style: {\n fontSize: 18,\n margin: 3,\n },\n },\n heading6: {\n style: {\n fontSize: 16,\n margin: 3,\n },\n },\n codeBlock: {\n style: defaultTextStyle,\n },\n} satisfies ReactEmailTextStyles;\n\nexport const createReactEmailBlockMappingForDefaultSchema = (\n textStyles: ReactEmailTextStyles = defaultReactEmailTextStyles,\n): BlockMapping<\n DefaultBlockSchema & {\n pageBreak: ReturnType<typeof createPageBreakBlockConfig>;\n },\n any,\n any,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>\n> => ({\n paragraph: (block, t) => {\n return (\n <Text\n {...textStyles.paragraph}\n style={{\n ...defaultReactEmailTextStyles.paragraph.style,\n ...textStyles.paragraph?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n bulletListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.bulletListItem}\n style={{\n ...defaultReactEmailTextStyles.bulletListItem.style,\n ...textStyles.bulletListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n toggleListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.toggleListItem}\n style={{\n ...defaultReactEmailTextStyles.toggleListItem.style,\n ...textStyles.toggleListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n numberedListItem: (block, t, _nestingLevel) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.numberedListItem}\n style={{\n ...defaultReactEmailTextStyles.numberedListItem.style,\n ...textStyles.numberedListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n checkListItem: (block, t) => {\n // Render a checkbox using inline SVG for better appearance in email\n // block.props.checked should be true/false\n const checked = block.props?.checked;\n const checkboxSvg = checked ? (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#4F8A10\"\n stroke=\"#4F8A10\"\n strokeWidth=\"2\"\n />\n <polyline\n points=\"5,10 8,13 13,6\"\n fill=\"none\"\n stroke=\"#fff\"\n strokeWidth=\"2\"\n />\n </svg>\n ) : (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#fff\"\n stroke=\"#888\"\n strokeWidth=\"2\"\n />\n </svg>\n );\n return (\n <Text\n {...textStyles.checkListItem}\n style={{\n ...defaultReactEmailTextStyles.checkListItem.style,\n ...textStyles.checkListItem?.style,\n }}\n >\n {checkboxSvg}\n <span>{t.transformInlineContent(block.content)}</span>\n </Text>\n );\n },\n heading: (block, t) => {\n return (\n <Heading\n as={`h${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`}\n {...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]}\n style={{\n ...defaultReactEmailTextStyles[\n `heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`\n ].style,\n ...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]\n ?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Heading>\n );\n },\n\n codeBlock: (block) => {\n const textContent = (block.content as StyledText<any>[])[0]?.text || \"\";\n\n return (\n <CodeBlock\n code={textContent}\n fontFamily=\"'CommitMono', monospace\"\n language={block.props.language as PrismLanguage}\n theme={dracula}\n {...textStyles.codeBlock}\n style={{\n ...defaultReactEmailTextStyles.codeBlock.style,\n ...textStyles.codeBlock?.style,\n }}\n />\n );\n },\n audio: (block) => {\n // Audio icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#4F8A10\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open audio file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n video: (block) => {\n // Video icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#1976D2\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open video file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n file: (block) => {\n // File icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#888\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n image: (block) => {\n return (\n <Img\n src={block.props.url}\n width={block.props.previewWidth}\n alt={block.props.caption}\n />\n );\n },\n table: (block, t) => {\n // Render table using standard HTML table elements for email compatibility\n const table = block.content;\n if (!table || typeof table !== \"object\" || !Array.isArray(table.rows)) {\n return <Text {...textStyles.tableError}>Table data not available</Text>;\n }\n const headerRowsCount = (table.headerRows as number) ?? 0;\n const headerColsCount = (table.headerCols as number) ?? 0;\n\n return (\n <table\n style={{\n borderCollapse: \"collapse\",\n width: \"100%\",\n margin: \"16px 0\",\n border: \"1px solid #ddd\",\n borderRadius: 4,\n overflow: \"hidden\",\n }}\n border={0}\n cellPadding={0}\n cellSpacing={0}\n >\n <tbody>\n {table.rows.map((row: any, rowIndex: number) => (\n <tr key={\"row-\" + rowIndex}>\n {row.cells.map((cell: any, colIndex: number) => {\n // Use mapTableCell to normalize table cell data into a standard interface\n // This handles partial cells, provides default values, and ensures consistent structure\n const normalizedCell = mapTableCell(cell);\n const isHeaderRow = rowIndex < headerRowsCount;\n const isHeaderCol = colIndex < headerColsCount;\n const isHeader = isHeaderRow || isHeaderCol;\n const CellTag = isHeader ? \"th\" : \"td\";\n return (\n <CellTag\n key={\"row_\" + rowIndex + \"_col_\" + colIndex}\n style={{\n border: \"1px solid #ddd\",\n padding: \"8px 12px\",\n background:\n normalizedCell.props.backgroundColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .backgroundColor as keyof typeof t.options.colors\n ].background\n : \"inherit\",\n fontWeight: isHeader ? \"bold\" : undefined,\n textAlign: normalizedCell.props.textAlignment || \"left\",\n color:\n normalizedCell.props.textColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .textColor as keyof typeof t.options.colors\n ].text\n : \"inherit\",\n ...defaultReactEmailTextStyles.tableCell.style,\n ...textStyles.tableCell?.style,\n }}\n {...((normalizedCell.props.colspan || 1) > 1 && {\n colSpan: normalizedCell.props.colspan || 1,\n })}\n {...((normalizedCell.props.rowspan || 1) > 1 && {\n rowSpan: normalizedCell.props.rowspan || 1,\n })}\n >\n {t.transformInlineContent(normalizedCell.content)}\n </CellTag>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n },\n quote: (block, t) => {\n // Render block quote with a left border and subtle background for email compatibility\n return (\n <Text\n {...textStyles.quote}\n style={{\n borderLeft: \"2px solid #bdbdbd\",\n padding: \"0px 12px\",\n fontStyle: \"italic\",\n color: t.options.colors.gray.text,\n display: \"block\",\n ...defaultReactEmailTextStyles.quote.style,\n ...textStyles.quote?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n pageBreak: () => {\n // In email, a page break can be represented as a horizontal rule\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"2px dashed #ccc\",\n margin: \"24px 0\",\n }}\n />\n );\n },\n divider: () => {\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"1px solid #ccc\",\n margin: \"11.5px 0\",\n }}\n />\n );\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailBlockMappingForDefaultSchema =\n createReactEmailBlockMappingForDefaultSchema();\n\n// Helper for file-like blocks (audio, video, file)\nfunction FileLink({\n url,\n name,\n defaultText,\n icon,\n}: {\n url?: string;\n name?: string;\n defaultText: string;\n icon: React.ReactElement;\n}) {\n return (\n <Link\n href={url}\n style={{\n textDecoration: \"none\",\n color: \"#333\",\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 16,\n }}\n >\n {icon}\n <span style={{ verticalAlign: \"middle\" }}>{name || defaultText}</span>\n </Link>\n );\n}\n\nfunction Caption({\n caption,\n width,\n textStyles,\n}: {\n caption?: string;\n width?: number;\n textStyles: ReactEmailTextStyles;\n}) {\n if (!caption) {\n return null;\n }\n return (\n <Text\n {...textStyles.caption}\n style={{\n width,\n fontSize: 13,\n color: \"#888\",\n margin: \"4px 0 0 0\",\n ...defaultReactEmailTextStyles.caption.style,\n ...textStyles.caption?.style,\n }}\n >\n {caption}\n </Text>\n );\n}\n","import {\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentMapping,\n} from \"@blocknote/core\";\nimport { Link } from \"@react-email/components\";\n\n// Define the styles interface for configurable Link components\nexport interface ReactEmailLinkStyles {\n link?: Partial<React.ComponentPropsWithoutRef<typeof Link>>;\n}\n\n// Default styles for Link components\nexport const defaultReactEmailLinkStyles: ReactEmailLinkStyles = {\n link: {},\n};\n\nexport const createReactEmailInlineContentMappingForDefaultSchema = (\n linkStyles: ReactEmailLinkStyles = defaultReactEmailLinkStyles,\n): InlineContentMapping<\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n React.ReactElement<HTMLSpanElement>\n> => ({\n link: (ic, t) => {\n return (\n <Link href={ic.href} {...linkStyles.link}>\n {...ic.content.map((content) => {\n return t.transformStyledText(content);\n })}\n </Link>\n );\n },\n text: (ic, t) => {\n return t.transformStyledText(ic);\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailInlineContentMappingForDefaultSchema =\n createReactEmailInlineContentMappingForDefaultSchema();\n","import { DefaultStyleSchema, StyleMapping } from \"@blocknote/core\";\nimport { CSSProperties } from \"react\";\n\n// Define the styles interface for configurable style transformations\n// This can be extended in the future to allow customizing style transformations\nexport type ReactEmailStyleTransformStyles = Record<string, never>;\n\n// Default styles for style transformations\nexport const defaultReactEmailStyleTransformStyles: ReactEmailStyleTransformStyles =\n {};\n\nexport const createReactEmailStyleMappingForDefaultSchema = (\n _styleTransformStyles: ReactEmailStyleTransformStyles = defaultReactEmailStyleTransformStyles,\n): StyleMapping<DefaultStyleSchema, CSSProperties> => ({\n bold: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontWeight: \"bold\",\n };\n },\n italic: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontStyle: \"italic\",\n };\n },\n underline: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"underline\", // TODO: could conflict with strike\n };\n },\n strike: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"line-through\",\n };\n },\n backgroundColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n backgroundColor:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .background,\n };\n },\n textColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n color:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .text,\n };\n },\n code: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontFamily: \"GeistMono\",\n };\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailStyleMappingForDefaultSchema =\n createReactEmailStyleMappingForDefaultSchema();\n","import {\n reactEmailBlockMappingForDefaultSchema,\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nimport {\n reactEmailInlineContentMappingForDefaultSchema,\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nimport {\n reactEmailStyleMappingForDefaultSchema,\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Re-export for backward compatibility\nexport { reactEmailBlockMappingForDefaultSchema } from \"./blocks.js\";\nexport { reactEmailInlineContentMappingForDefaultSchema } from \"./inlinecontent.js\";\nexport { reactEmailStyleMappingForDefaultSchema } from \"./styles.js\";\n\n// Export the new configurable functions\nexport {\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nexport {\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nexport {\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Export the combined styles interface\nexport interface ReactEmailDefaultSchemaStyles {\n textStyles?: ReactEmailTextStyles;\n linkStyles?: ReactEmailLinkStyles;\n styleTransformStyles?: ReactEmailStyleTransformStyles;\n}\n\n// Export the default combined styles\nexport const defaultReactEmailDefaultSchemaStyles: ReactEmailDefaultSchemaStyles =\n {\n textStyles: defaultReactEmailTextStyles,\n linkStyles: defaultReactEmailLinkStyles,\n styleTransformStyles: defaultReactEmailStyleTransformStyles,\n };\n\nexport const reactEmailDefaultSchemaMappings = {\n blockMapping: reactEmailBlockMappingForDefaultSchema,\n inlineContentMapping: reactEmailInlineContentMappingForDefaultSchema,\n styleMapping: reactEmailStyleMappingForDefaultSchema,\n};\n\nexport const reactEmailDefaultSchemaMappingsWithStyles = (\n styles: ReactEmailDefaultSchemaStyles = defaultReactEmailDefaultSchemaStyles,\n): typeof reactEmailDefaultSchemaMappings => {\n return {\n blockMapping: createReactEmailBlockMappingForDefaultSchema(\n styles.textStyles,\n ),\n inlineContentMapping: createReactEmailInlineContentMappingForDefaultSchema(\n styles.linkStyles,\n ),\n styleMapping: createReactEmailStyleMappingForDefaultSchema(\n styles.styleTransformStyles,\n ),\n };\n};\n","import {\n Block,\n BlockNoteSchema,\n BlockSchema,\n COLORS_DEFAULT,\n DefaultProps,\n Exporter,\n ExporterOptions,\n InlineContentSchema,\n StyleSchema,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n Body,\n Head,\n Html,\n Link,\n Preview,\n Section,\n Tailwind,\n} from \"@react-email/components\";\nimport { render as renderEmail } from \"@react-email/render\";\nimport React, { CSSProperties } from \"react\";\n\nexport class ReactEmailExporter<\n B extends BlockSchema,\n S extends StyleSchema,\n I extends InlineContentSchema,\n> extends Exporter<\n B,\n I,\n S,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n> {\n public constructor(\n public readonly schema: BlockNoteSchema<B, I, S>,\n mappings: Exporter<\n NoInfer<B>,\n NoInfer<I>,\n NoInfer<S>,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n >[\"mappings\"],\n options?: Partial<ExporterOptions>,\n ) {\n const defaults = {\n colors: COLORS_DEFAULT,\n } satisfies Partial<ExporterOptions>;\n\n const newOptions = {\n ...defaults,\n ...options,\n };\n super(schema, mappings, newOptions);\n }\n\n public transformStyledText(styledText: StyledText<S>) {\n const stylesArray = this.mapStyles(styledText.styles);\n const styles = Object.assign({}, ...stylesArray);\n return (\n <span\n style={styles}\n dangerouslySetInnerHTML={{\n __html: styledText.text.replace(/\\n/g, \"<br />\"),\n }}\n />\n );\n }\n\n private async renderGroupedListBlocks(\n blocks: Block<B, I, S>[],\n startIndex: number,\n nestingLevel: number,\n ): Promise<{ element: React.ReactElement; nextIndex: number }> {\n const listType = blocks[startIndex].type;\n const listItems: React.ReactElement<any>[] = [];\n let j = startIndex;\n\n for (\n let itemIndex = 1;\n j < blocks.length && blocks[j].type === listType;\n j++, itemIndex++\n ) {\n const block = blocks[j];\n const liContent = (await this.mapBlock(\n block as any,\n nestingLevel,\n itemIndex,\n )) as any;\n let nestedList: React.ReactElement<any>[] = [];\n if (block.children && block.children.length > 0) {\n nestedList = await this.renderNestedLists(\n block.children,\n nestingLevel + 1,\n block.id,\n );\n }\n listItems.push(\n <li key={block.id}>\n {liContent}\n {nestedList.length > 0 && nestedList}\n </li>,\n );\n }\n let element: React.ReactElement;\n if (listType === \"bulletListItem\" || listType === \"toggleListItem\") {\n element = (\n <ul className=\"mb-2 list-disc pl-6\" key={blocks[startIndex].id + \"-ul\"}>\n {listItems}\n </ul>\n );\n } else {\n element = (\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={blocks[startIndex].id + \"-ol\"}\n >\n {listItems}\n </ol>\n );\n }\n return { element, nextIndex: j };\n }\n\n private async renderNestedLists(\n children: Block<B, I, S>[],\n nestingLevel: number,\n parentId: string,\n ): Promise<React.ReactElement<any>[]> {\n const nestedList: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < children.length) {\n const child = children[i];\n if (\n child.type === \"bulletListItem\" ||\n child.type === \"numberedListItem\"\n ) {\n // Group consecutive list items of the same type\n const listType = child.type;\n const listItems: React.ReactElement<any>[] = [];\n let j = i;\n\n for (\n let itemIndex = 1;\n j < children.length && children[j].type === listType;\n j++, itemIndex++\n ) {\n const listItem = children[j];\n const liContent = (await this.mapBlock(\n listItem as any,\n nestingLevel,\n itemIndex,\n )) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(\n listItem.props as any,\n );\n let nestedContent: React.ReactElement<any>[] = [];\n if (listItem.children && listItem.children.length > 0) {\n // If children are list items, render as nested list; otherwise, as normal blocks\n if (\n listItem.children[0] &&\n (listItem.children[0].type === \"bulletListItem\" ||\n listItem.children[0].type === \"numberedListItem\")\n ) {\n nestedContent = await this.renderNestedLists(\n listItem.children,\n nestingLevel + 1,\n listItem.id,\n );\n } else {\n nestedContent = await this.transformBlocks(\n listItem.children,\n nestingLevel + 1,\n );\n }\n }\n listItems.push(\n <li key={listItem.id} style={style}>\n {liContent}\n {nestedContent.length > 0 && (\n <div style={{ marginTop: \"8px\" }}>{nestedContent}</div>\n )}\n </li>,\n );\n }\n if (listType === \"bulletListItem\") {\n nestedList.push(\n <ul\n className=\"mb-2 list-disc pl-6\"\n key={parentId + \"-ul-nested-\" + i}\n >\n {listItems}\n </ul>,\n );\n } else {\n nestedList.push(\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={parentId + \"-ol-nested-\" + i}\n >\n {listItems}\n </ol>,\n );\n }\n i = j;\n } else {\n // Non-list child, render as normal with indentation\n const childBlocks = await this.transformBlocks([child], nestingLevel);\n nestedList.push(\n <Section key={child.id} style={{ marginLeft: \"24px\" }}>\n {childBlocks}\n </Section>,\n );\n i++;\n }\n }\n return nestedList;\n }\n\n public async transformBlocks(\n blocks: Block<B, I, S>[],\n nestingLevel = 0,\n ): Promise<React.ReactElement<any>[]> {\n const ret: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < blocks.length) {\n const b = blocks[i];\n if (\n b.type === \"bulletListItem\" ||\n b.type === \"numberedListItem\" ||\n b.type === \"toggleListItem\"\n ) {\n const { element, nextIndex } = await this.renderGroupedListBlocks(\n blocks,\n i,\n nestingLevel,\n );\n ret.push(element);\n i = nextIndex;\n continue;\n }\n // Non-list blocks\n const children = await this.transformBlocks(b.children, nestingLevel + 1);\n const self = (await this.mapBlock(b as any, nestingLevel, 0)) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(b.props as any);\n ret.push(\n <React.Fragment key={b.id}>\n <Section style={style}>{self}</Section>\n {children.length > 0 && (\n <div style={{ marginLeft: \"24px\" }}>{children}</div>\n )}\n </React.Fragment>,\n );\n i++;\n }\n return ret;\n }\n\n public async toReactEmailDocument(\n blocks: Block<B, I, S>[],\n options?: {\n /**\n * Inject elements into the {@link Head} element\n * @see https://react.email/docs/components/head\n */\n head?: React.ReactElement;\n /**\n * Set the preview text for the email\n * @see https://react.email/docs/components/preview\n */\n preview?: string | string[];\n /**\n * Add a header to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n header?: React.ReactElement;\n /**\n * Add a footer to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n footer?: React.ReactElement;\n /**\n * Customize the container element\n */\n container?: React.FC<{ children: React.ReactNode }>;\n },\n ) {\n const transformedBlocks = await this.transformBlocks(blocks);\n const DefaultContainer =\n options?.container ||\n (({ children }: { children: React.ReactNode }) => (\n <React.Fragment>{children}</React.Fragment>\n ));\n return renderEmail(\n <Html>\n <Head>{options?.head}</Head>\n <Body\n style={{\n fontFamily:\n \"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif\",\n fontSize: \"16px\",\n lineHeight: \"1.5\",\n color: \"#333\",\n }}\n >\n {options?.preview && <Preview>{options.preview}</Preview>}\n <Tailwind>\n <DefaultContainer>\n {options?.header}\n {transformedBlocks}\n {options?.footer}\n </DefaultContainer>\n </Tailwind>\n </Body>\n </Html>,\n );\n }\n\n protected blocknoteDefaultPropsToReactEmailStyle(\n props: Partial<DefaultProps>,\n ): any {\n return {\n textAlign: props.textAlignment,\n backgroundColor:\n props.backgroundColor === \"default\" || !props.backgroundColor\n ? undefined\n : this.options.colors[\n props.backgroundColor as keyof typeof this.options.colors\n ].background,\n color:\n props.textColor === \"default\" || !props.textColor\n ? undefined\n : this.options.colors[\n props.textColor as keyof typeof this.options.colors\n ].text,\n alignItems:\n props.textAlignment === \"right\"\n ? \"flex-end\"\n : props.textAlignment === \"center\"\n ? \"center\"\n : undefined,\n };\n }\n}\n"],"names":["defaultTextStyle","defaultReactEmailTextStyles","createReactEmailBlockMappingForDefaultSchema","textStyles","block","jsx","Text","_a","_nestingLevel","checkboxSvg","jsxs","_b","Heading","textContent","CodeBlock","dracula","icon","previewWidth","FileLink","Caption","Img","table","headerRowsCount","headerColsCount","row","rowIndex","cell","colIndex","normalizedCell","mapTableCell","isHeaderRow","isHeaderCol","isHeader","CellTag","reactEmailBlockMappingForDefaultSchema","url","name","defaultText","Link","caption","width","defaultReactEmailLinkStyles","createReactEmailInlineContentMappingForDefaultSchema","linkStyles","ic","content","reactEmailInlineContentMappingForDefaultSchema","defaultReactEmailStyleTransformStyles","createReactEmailStyleMappingForDefaultSchema","_styleTransformStyles","val","exporter","reactEmailStyleMappingForDefaultSchema","defaultReactEmailDefaultSchemaStyles","reactEmailDefaultSchemaMappings","reactEmailDefaultSchemaMappingsWithStyles","styles","ReactEmailExporter","Exporter","schema","mappings","options","newOptions","COLORS_DEFAULT","styledText","stylesArray","blocks","startIndex","nestingLevel","listType","listItems","j","itemIndex","liContent","nestedList","element","children","parentId","i","child","listItem","style","nestedContent","childBlocks","Section","ret","b","nextIndex","self","React","transformedBlocks","DefaultContainer","renderEmail","Html","Head","Body","Preview","Tailwind","props"],"mappings":"8lBAwCMA,EAAuC,CAC3C,SAAU,GACV,WAAY,IACZ,OAAQ,EACR,UAAW,EACb,EAGaC,EAA8B,CACzC,UAAW,CACT,MAAOD,CAAA,EAET,eAAgB,CACd,MAAOA,CAAA,EAET,eAAgB,CACd,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BU,EAAE,EAKvB,CAAA,EAEFR,GACF,CACA,OAAOO,CACT,CAEA,MAAa,qBACXnB,EACAL,EA4BA,CACA,MAAM6B,EAAoB,MAAM,KAAK,gBAAgBxB,CAAM,EACrDyB,GACJ9B,GAAA,YAAAA,EAAS,aACR,CAAC,CAAE,SAAAe,CAAA,IACFvE,EAAAA,IAACoF,UAAM,SAAN,CAAgB,SAAAb,CAAA,CAAS,GAE9B,OAAOgB,EAAAA,cACJC,EAAAA,KAAA,CACC,SAAA,CAAAxF,EAAAA,IAACyF,EAAAA,KAAA,CAAM,0BAAS,IAAA,CAAK,EACrBpF,EAAAA,KAACqF,EAAAA,KAAA,CACC,MAAO,CACL,WACE,iHACF,SAAU,OACV,WAAY,MACZ,MAAO,MAAA,EAGR,SAAA,EAAAlC,GAAA,YAAAA,EAAS,UAAWxD,MAAC2F,EAAAA,QAAA,CAAS,SAAAnC,EAAQ,QAAQ,EAC/CxD,EAAAA,IAAC4F,EAAAA,SAAA,CACC,SAAAvF,EAAAA,KAACiF,EAAA,CACE,SAAA,CAAA9B,GAAA,YAAAA,EAAS,OACT6B,EACA7B,GAAA,YAAAA,EAAS,MAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAEJ,CAEU,uCACRqC,EACK,CACL,MAAO,CACL,UAAWA,EAAM,cACjB,gBACEA,EAAM,kBAAoB,WAAa,CAACA,EAAM,gBAC1C,OACA,KAAK,QAAQ,OACXA,EAAM,eACR,EAAE,WACR,MACEA,EAAM,YAAc,WAAa,CAACA,EAAM,UACpC,OACA,KAAK,QAAQ,OACXA,EAAM,SACR,EAAE,KACR,WACEA,EAAM,gBAAkB,QACpB,WACAA,EAAM,gBAAkB,SACtB,SACA,MAAA,CAEZ,CACF"}
1
+ {"version":3,"file":"blocknote-xl-email-exporter.umd.cjs","sources":["../src/react-email/defaultSchema/blocks.tsx","../src/react-email/defaultSchema/inlinecontent.tsx","../src/react-email/defaultSchema/styles.tsx","../src/react-email/defaultSchema/index.ts","../src/react-email/reactEmailExporter.tsx"],"sourcesContent":["import {\n BlockMapping,\n createPageBreakBlockConfig,\n DefaultBlockSchema,\n mapTableCell,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n CodeBlock,\n dracula,\n Heading,\n Img,\n Link,\n PrismLanguage,\n Text,\n} from \"@react-email/components\";\n\n// Define TextProps type based on React Email Text component\ntype TextProps = React.ComponentPropsWithoutRef<typeof Text>;\n\n// Define the styles interface for configurable Text components\nexport interface ReactEmailTextStyles {\n paragraph?: Partial<TextProps>;\n bulletListItem?: Partial<TextProps>;\n toggleListItem?: Partial<TextProps>;\n numberedListItem?: Partial<TextProps>;\n checkListItem?: Partial<TextProps>;\n quote?: Partial<TextProps>;\n tableError?: Partial<TextProps>;\n tableCell?: Partial<TextProps>;\n caption?: Partial<TextProps>;\n heading1?: Partial<TextProps>;\n heading2?: Partial<TextProps>;\n heading3?: Partial<TextProps>;\n heading4?: Partial<TextProps>;\n heading5?: Partial<TextProps>;\n heading6?: Partial<TextProps>;\n codeBlock?: Partial<React.ComponentProps<typeof CodeBlock>>;\n}\n\nconst defaultTextStyle: TextProps[\"style\"] = {\n fontSize: 16,\n lineHeight: 1.5,\n margin: 3,\n minHeight: 24,\n};\n\n// Default styles for Text components\nexport const defaultReactEmailTextStyles = {\n paragraph: {\n style: defaultTextStyle,\n },\n bulletListItem: {\n style: defaultTextStyle,\n },\n toggleListItem: {\n style: defaultTextStyle,\n },\n numberedListItem: {\n style: defaultTextStyle,\n },\n checkListItem: {\n style: defaultTextStyle,\n },\n quote: {\n style: defaultTextStyle,\n },\n tableError: {\n style: defaultTextStyle,\n },\n tableCell: {\n style: defaultTextStyle,\n },\n caption: {\n style: defaultTextStyle,\n },\n heading1: {\n style: {\n fontSize: 48,\n margin: 3,\n },\n },\n heading2: {\n style: {\n fontSize: 36,\n margin: 3,\n },\n },\n heading3: {\n style: {\n fontSize: 24,\n margin: 3,\n },\n },\n heading4: {\n style: {\n fontSize: 20,\n margin: 3,\n },\n },\n heading5: {\n style: {\n fontSize: 18,\n margin: 3,\n },\n },\n heading6: {\n style: {\n fontSize: 16,\n margin: 3,\n },\n },\n codeBlock: {\n style: defaultTextStyle,\n },\n} satisfies ReactEmailTextStyles;\n\nexport const createReactEmailBlockMappingForDefaultSchema = (\n textStyles: ReactEmailTextStyles = defaultReactEmailTextStyles,\n): BlockMapping<\n DefaultBlockSchema & {\n pageBreak: ReturnType<typeof createPageBreakBlockConfig>;\n },\n any,\n any,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>\n> => ({\n paragraph: (block, t) => {\n return (\n <Text\n {...textStyles.paragraph}\n style={{\n ...defaultReactEmailTextStyles.paragraph.style,\n ...textStyles.paragraph?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n bulletListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.bulletListItem}\n style={{\n ...defaultReactEmailTextStyles.bulletListItem.style,\n ...textStyles.bulletListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n toggleListItem: (block, t) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.toggleListItem}\n style={{\n ...defaultReactEmailTextStyles.toggleListItem.style,\n ...textStyles.toggleListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n numberedListItem: (block, t, _nestingLevel) => {\n // Return only the <li> for grouping in the exporter\n return (\n <Text\n {...textStyles.numberedListItem}\n style={{\n ...defaultReactEmailTextStyles.numberedListItem.style,\n ...textStyles.numberedListItem?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n checkListItem: (block, t) => {\n // Render a checkbox using inline SVG for better appearance in email\n // block.props.checked should be true/false\n const checked = block.props?.checked;\n const checkboxSvg = checked ? (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#4F8A10\"\n stroke=\"#4F8A10\"\n strokeWidth=\"2\"\n />\n <polyline\n points=\"5,10 8,13 13,6\"\n fill=\"none\"\n stroke=\"#fff\"\n strokeWidth=\"2\"\n />\n </svg>\n ) : (\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n style={{ display: \"inline\", verticalAlign: \"middle\", marginRight: 8 }}\n >\n <rect\n x=\"2\"\n y=\"2\"\n width=\"14\"\n height=\"14\"\n rx=\"3\"\n fill=\"#fff\"\n stroke=\"#888\"\n strokeWidth=\"2\"\n />\n </svg>\n );\n return (\n <Text\n {...textStyles.checkListItem}\n style={{\n ...defaultReactEmailTextStyles.checkListItem.style,\n ...textStyles.checkListItem?.style,\n }}\n >\n {checkboxSvg}\n <span>{t.transformInlineContent(block.content)}</span>\n </Text>\n );\n },\n heading: (block, t) => {\n return (\n <Heading\n as={`h${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`}\n {...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]}\n style={{\n ...defaultReactEmailTextStyles[\n `heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`\n ].style,\n ...textStyles[`heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`]\n ?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Heading>\n );\n },\n\n codeBlock: (block) => {\n const textContent = (block.content as StyledText<any>[])[0]?.text || \"\";\n\n return (\n <CodeBlock\n code={textContent}\n fontFamily=\"'CommitMono', monospace\"\n language={block.props.language as PrismLanguage}\n theme={dracula}\n {...textStyles.codeBlock}\n style={{\n ...defaultReactEmailTextStyles.codeBlock.style,\n ...textStyles.codeBlock?.style,\n }}\n />\n );\n },\n audio: (block) => {\n // Audio icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#4F8A10\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open audio file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n video: (block) => {\n // Video icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#1976D2\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open video file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n file: (block) => {\n // File icon SVG\n const icon = (\n <svg\n height=\"18\"\n width=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"#888\"\n style={{ display: \"inline\", verticalAlign: \"middle\" }}\n >\n <path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\" />\n </svg>\n );\n const previewWidth =\n \"previewWidth\" in block.props\n ? (block.props as any).previewWidth\n : undefined;\n return (\n <div style={{ margin: \"8px 0\" }}>\n <FileLink\n url={block.props.url}\n name={block.props.name}\n defaultText=\"Open file\"\n icon={icon}\n />\n <Caption\n caption={block.props.caption}\n width={previewWidth}\n textStyles={textStyles}\n />\n </div>\n );\n },\n image: (block) => {\n return (\n <Img\n src={block.props.url}\n width={block.props.previewWidth}\n alt={block.props.caption}\n />\n );\n },\n table: (block, t) => {\n // Render table using standard HTML table elements for email compatibility\n const table = block.content;\n if (!table || typeof table !== \"object\" || !Array.isArray(table.rows)) {\n return <Text {...textStyles.tableError}>Table data not available</Text>;\n }\n const headerRowsCount = (table.headerRows as number) ?? 0;\n const headerColsCount = (table.headerCols as number) ?? 0;\n\n return (\n <table\n style={{\n borderCollapse: \"collapse\",\n width: \"100%\",\n margin: \"16px 0\",\n border: \"1px solid #ddd\",\n borderRadius: 4,\n overflow: \"hidden\",\n }}\n border={0}\n cellPadding={0}\n cellSpacing={0}\n >\n <tbody>\n {table.rows.map((row: any, rowIndex: number) => (\n <tr key={\"row-\" + rowIndex}>\n {row.cells.map((cell: any, colIndex: number) => {\n // Use mapTableCell to normalize table cell data into a standard interface\n // This handles partial cells, provides default values, and ensures consistent structure\n const normalizedCell = mapTableCell(cell);\n const isHeaderRow = rowIndex < headerRowsCount;\n const isHeaderCol = colIndex < headerColsCount;\n const isHeader = isHeaderRow || isHeaderCol;\n const CellTag = isHeader ? \"th\" : \"td\";\n return (\n <CellTag\n key={\"row_\" + rowIndex + \"_col_\" + colIndex}\n style={{\n border: \"1px solid #ddd\",\n padding: \"8px 12px\",\n background:\n normalizedCell.props.backgroundColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .backgroundColor as keyof typeof t.options.colors\n ].background\n : \"inherit\",\n fontWeight: isHeader ? \"bold\" : undefined,\n textAlign: normalizedCell.props.textAlignment || \"left\",\n color:\n normalizedCell.props.textColor !== \"default\"\n ? t.options.colors[\n normalizedCell.props\n .textColor as keyof typeof t.options.colors\n ].text\n : \"inherit\",\n ...defaultReactEmailTextStyles.tableCell.style,\n ...textStyles.tableCell?.style,\n }}\n {...((normalizedCell.props.colspan || 1) > 1 && {\n colSpan: normalizedCell.props.colspan || 1,\n })}\n {...((normalizedCell.props.rowspan || 1) > 1 && {\n rowSpan: normalizedCell.props.rowspan || 1,\n })}\n >\n {t.transformInlineContent(normalizedCell.content)}\n </CellTag>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n },\n quote: (block, t) => {\n // Render block quote with a left border and subtle background for email compatibility\n return (\n <Text\n {...textStyles.quote}\n style={{\n borderLeft: \"2px solid #bdbdbd\",\n padding: \"0px 12px\",\n fontStyle: \"italic\",\n color: t.options.colors.gray.text,\n display: \"block\",\n ...defaultReactEmailTextStyles.quote.style,\n ...textStyles.quote?.style,\n }}\n >\n {t.transformInlineContent(block.content)}\n </Text>\n );\n },\n pageBreak: () => {\n // In email, a page break can be represented as a horizontal rule\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"2px dashed #ccc\",\n margin: \"24px 0\",\n }}\n />\n );\n },\n divider: () => {\n return (\n <hr\n style={{\n border: \"none\",\n borderTop: \"1px solid #ccc\",\n margin: \"11.5px 0\",\n }}\n />\n );\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailBlockMappingForDefaultSchema =\n createReactEmailBlockMappingForDefaultSchema();\n\n// Helper for file-like blocks (audio, video, file)\nfunction FileLink({\n url,\n name,\n defaultText,\n icon,\n}: {\n url?: string;\n name?: string;\n defaultText: string;\n icon: React.ReactElement;\n}) {\n return (\n <Link\n href={url}\n style={{\n textDecoration: \"none\",\n color: \"#333\",\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 16,\n }}\n >\n {icon}\n <span style={{ verticalAlign: \"middle\" }}>{name || defaultText}</span>\n </Link>\n );\n}\n\nfunction Caption({\n caption,\n width,\n textStyles,\n}: {\n caption?: string;\n width?: number;\n textStyles: ReactEmailTextStyles;\n}) {\n if (!caption) {\n return null;\n }\n return (\n <Text\n {...textStyles.caption}\n style={{\n width,\n fontSize: 13,\n color: \"#888\",\n margin: \"4px 0 0 0\",\n ...defaultReactEmailTextStyles.caption.style,\n ...textStyles.caption?.style,\n }}\n >\n {caption}\n </Text>\n );\n}\n","import {\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n InlineContentMapping,\n} from \"@blocknote/core\";\nimport { Link } from \"@react-email/components\";\n\n// Define the styles interface for configurable Link components\nexport interface ReactEmailLinkStyles {\n link?: Partial<React.ComponentPropsWithoutRef<typeof Link>>;\n}\n\n// Default styles for Link components\nexport const defaultReactEmailLinkStyles: ReactEmailLinkStyles = {\n link: {},\n};\n\nexport const createReactEmailInlineContentMappingForDefaultSchema = (\n linkStyles: ReactEmailLinkStyles = defaultReactEmailLinkStyles,\n): InlineContentMapping<\n DefaultInlineContentSchema,\n DefaultStyleSchema,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n React.ReactElement<HTMLSpanElement>\n> => ({\n link: (ic, t) => {\n return (\n <Link href={ic.href} {...linkStyles.link}>\n {...ic.content.map((content) => {\n return t.transformStyledText(content);\n })}\n </Link>\n );\n },\n text: (ic, t) => {\n return t.transformStyledText(ic);\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailInlineContentMappingForDefaultSchema =\n createReactEmailInlineContentMappingForDefaultSchema();\n","import { DefaultStyleSchema, StyleMapping } from \"@blocknote/core\";\nimport { CSSProperties } from \"react\";\n\n// Define the styles interface for configurable style transformations\n// This can be extended in the future to allow customizing style transformations\nexport type ReactEmailStyleTransformStyles = Record<string, never>;\n\n// Default styles for style transformations\nexport const defaultReactEmailStyleTransformStyles: ReactEmailStyleTransformStyles =\n {};\n\nexport const createReactEmailStyleMappingForDefaultSchema = (\n _styleTransformStyles: ReactEmailStyleTransformStyles = defaultReactEmailStyleTransformStyles,\n): StyleMapping<DefaultStyleSchema, CSSProperties> => ({\n bold: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontWeight: \"bold\",\n };\n },\n italic: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontStyle: \"italic\",\n };\n },\n underline: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"underline\", // TODO: could conflict with strike\n };\n },\n strike: (val) => {\n if (!val) {\n return {};\n }\n return {\n textDecoration: \"line-through\",\n };\n },\n backgroundColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n backgroundColor:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .background,\n };\n },\n textColor: (val, exporter) => {\n if (!val) {\n return {};\n }\n return {\n color:\n exporter.options.colors[val as keyof typeof exporter.options.colors]\n .text,\n };\n },\n code: (val) => {\n if (!val) {\n return {};\n }\n return {\n fontFamily: \"GeistMono\",\n };\n },\n});\n\n// Export the original mapping for backward compatibility\nexport const reactEmailStyleMappingForDefaultSchema =\n createReactEmailStyleMappingForDefaultSchema();\n","import {\n reactEmailBlockMappingForDefaultSchema,\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nimport {\n reactEmailInlineContentMappingForDefaultSchema,\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nimport {\n reactEmailStyleMappingForDefaultSchema,\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Re-export for backward compatibility\nexport { reactEmailBlockMappingForDefaultSchema } from \"./blocks.js\";\nexport { reactEmailInlineContentMappingForDefaultSchema } from \"./inlinecontent.js\";\nexport { reactEmailStyleMappingForDefaultSchema } from \"./styles.js\";\n\n// Export the new configurable functions\nexport {\n createReactEmailBlockMappingForDefaultSchema,\n type ReactEmailTextStyles,\n defaultReactEmailTextStyles,\n} from \"./blocks.js\";\nexport {\n createReactEmailInlineContentMappingForDefaultSchema,\n type ReactEmailLinkStyles,\n defaultReactEmailLinkStyles,\n} from \"./inlinecontent.js\";\nexport {\n createReactEmailStyleMappingForDefaultSchema,\n type ReactEmailStyleTransformStyles,\n defaultReactEmailStyleTransformStyles,\n} from \"./styles.js\";\n\n// Export the combined styles interface\nexport interface ReactEmailDefaultSchemaStyles {\n textStyles?: ReactEmailTextStyles;\n linkStyles?: ReactEmailLinkStyles;\n styleTransformStyles?: ReactEmailStyleTransformStyles;\n}\n\n// Export the default combined styles\nexport const defaultReactEmailDefaultSchemaStyles: ReactEmailDefaultSchemaStyles =\n {\n textStyles: defaultReactEmailTextStyles,\n linkStyles: defaultReactEmailLinkStyles,\n styleTransformStyles: defaultReactEmailStyleTransformStyles,\n };\n\nexport const reactEmailDefaultSchemaMappings = {\n blockMapping: reactEmailBlockMappingForDefaultSchema,\n inlineContentMapping: reactEmailInlineContentMappingForDefaultSchema,\n styleMapping: reactEmailStyleMappingForDefaultSchema,\n};\n\nexport const reactEmailDefaultSchemaMappingsWithStyles = (\n styles: ReactEmailDefaultSchemaStyles = defaultReactEmailDefaultSchemaStyles,\n): typeof reactEmailDefaultSchemaMappings => {\n return {\n blockMapping: createReactEmailBlockMappingForDefaultSchema(\n styles.textStyles,\n ),\n inlineContentMapping: createReactEmailInlineContentMappingForDefaultSchema(\n styles.linkStyles,\n ),\n styleMapping: createReactEmailStyleMappingForDefaultSchema(\n styles.styleTransformStyles,\n ),\n };\n};\n","import {\n Block,\n BlockNoteSchema,\n BlockSchema,\n COLORS_DEFAULT,\n DefaultProps,\n Exporter,\n ExporterOptions,\n InlineContentSchema,\n StyleSchema,\n StyledText,\n} from \"@blocknote/core\";\nimport {\n Body,\n Head,\n Html,\n Link,\n Preview,\n Section,\n Tailwind,\n} from \"@react-email/components\";\nimport { render as renderEmail } from \"@react-email/render\";\nimport React, { CSSProperties } from \"react\";\n\nexport class ReactEmailExporter<\n B extends BlockSchema,\n S extends StyleSchema,\n I extends InlineContentSchema,\n> extends Exporter<\n B,\n I,\n S,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n> {\n public constructor(\n public readonly schema: BlockNoteSchema<B, I, S>,\n mappings: Exporter<\n NoInfer<B>,\n NoInfer<I>,\n NoInfer<S>,\n React.ReactElement<any>,\n React.ReactElement<typeof Link> | React.ReactElement<HTMLSpanElement>,\n CSSProperties,\n React.ReactElement<HTMLSpanElement>\n >[\"mappings\"],\n options?: Partial<ExporterOptions>,\n ) {\n const defaults = {\n colors: COLORS_DEFAULT,\n } satisfies Partial<ExporterOptions>;\n\n const newOptions = {\n ...defaults,\n ...options,\n };\n super(schema, mappings, newOptions);\n }\n\n public transformStyledText(styledText: StyledText<S>) {\n const stylesArray = this.mapStyles(styledText.styles);\n const styles = Object.assign({}, ...stylesArray);\n return (\n <span\n style={styles}\n dangerouslySetInnerHTML={{\n __html: styledText.text.replace(/\\n/g, \"<br />\"),\n }}\n />\n );\n }\n\n private async renderGroupedListBlocks(\n blocks: Block<B, I, S>[],\n startIndex: number,\n nestingLevel: number,\n ): Promise<{ element: React.ReactElement; nextIndex: number }> {\n const listType = blocks[startIndex].type;\n const listItems: React.ReactElement<any>[] = [];\n let j = startIndex;\n\n for (\n let itemIndex = 1;\n j < blocks.length && blocks[j].type === listType;\n j++, itemIndex++\n ) {\n const block = blocks[j];\n const liContent = (await this.mapBlock(\n block as any,\n nestingLevel,\n itemIndex,\n )) as any;\n let nestedList: React.ReactElement<any>[] = [];\n if (block.children && block.children.length > 0) {\n nestedList = await this.renderNestedLists(\n block.children,\n nestingLevel + 1,\n block.id,\n );\n }\n listItems.push(\n <li key={block.id}>\n {liContent}\n {nestedList.length > 0 && nestedList}\n </li>,\n );\n }\n let element: React.ReactElement;\n if (listType === \"bulletListItem\" || listType === \"toggleListItem\") {\n element = (\n <ul className=\"mb-2 list-disc pl-6\" key={blocks[startIndex].id + \"-ul\"}>\n {listItems}\n </ul>\n );\n } else {\n element = (\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={blocks[startIndex].id + \"-ol\"}\n >\n {listItems}\n </ol>\n );\n }\n return { element, nextIndex: j };\n }\n\n private async renderNestedLists(\n children: Block<B, I, S>[],\n nestingLevel: number,\n parentId: string,\n ): Promise<React.ReactElement<any>[]> {\n const nestedList: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < children.length) {\n const child = children[i];\n if (\n child.type === \"bulletListItem\" ||\n child.type === \"numberedListItem\"\n ) {\n // Group consecutive list items of the same type\n const listType = child.type;\n const listItems: React.ReactElement<any>[] = [];\n let j = i;\n\n for (\n let itemIndex = 1;\n j < children.length && children[j].type === listType;\n j++, itemIndex++\n ) {\n const listItem = children[j];\n const liContent = (await this.mapBlock(\n listItem as any,\n nestingLevel,\n itemIndex,\n )) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(\n listItem.props as any,\n );\n let nestedContent: React.ReactElement<any>[] = [];\n if (listItem.children && listItem.children.length > 0) {\n // If children are list items, render as nested list; otherwise, as normal blocks\n if (\n listItem.children[0] &&\n (listItem.children[0].type === \"bulletListItem\" ||\n listItem.children[0].type === \"numberedListItem\")\n ) {\n nestedContent = await this.renderNestedLists(\n listItem.children,\n nestingLevel + 1,\n listItem.id,\n );\n } else {\n nestedContent = await this.transformBlocks(\n listItem.children,\n nestingLevel + 1,\n );\n }\n }\n listItems.push(\n <li key={listItem.id} style={style}>\n {liContent}\n {nestedContent.length > 0 && (\n <div style={{ marginTop: \"8px\" }}>{nestedContent}</div>\n )}\n </li>,\n );\n }\n if (listType === \"bulletListItem\") {\n nestedList.push(\n <ul\n className=\"mb-2 list-disc pl-6\"\n key={parentId + \"-ul-nested-\" + i}\n >\n {listItems}\n </ul>,\n );\n } else {\n nestedList.push(\n <ol\n className=\"mb-2 list-decimal pl-6\"\n start={1}\n key={parentId + \"-ol-nested-\" + i}\n >\n {listItems}\n </ol>,\n );\n }\n i = j;\n } else {\n // Non-list child, render as normal with indentation\n const childBlocks = await this.transformBlocks([child], nestingLevel);\n nestedList.push(\n <Section key={child.id} style={{ marginLeft: \"24px\" }}>\n {childBlocks}\n </Section>,\n );\n i++;\n }\n }\n return nestedList;\n }\n\n public async transformBlocks(\n blocks: Block<B, I, S>[],\n nestingLevel = 0,\n ): Promise<React.ReactElement<any>[]> {\n const ret: React.ReactElement<any>[] = [];\n let i = 0;\n while (i < blocks.length) {\n const b = blocks[i];\n if (\n b.type === \"bulletListItem\" ||\n b.type === \"numberedListItem\" ||\n b.type === \"toggleListItem\"\n ) {\n const { element, nextIndex } = await this.renderGroupedListBlocks(\n blocks,\n i,\n nestingLevel,\n );\n ret.push(element);\n i = nextIndex;\n continue;\n }\n // Non-list blocks\n const children = await this.transformBlocks(b.children, nestingLevel + 1);\n const self = (await this.mapBlock(b as any, nestingLevel, 0)) as any;\n const style = this.blocknoteDefaultPropsToReactEmailStyle(b.props as any);\n ret.push(\n <React.Fragment key={b.id}>\n <Section style={style}>{self}</Section>\n {children.length > 0 && (\n <div style={{ marginLeft: \"24px\" }}>{children}</div>\n )}\n </React.Fragment>,\n );\n i++;\n }\n return ret;\n }\n\n public async toReactEmailDocument(\n blocks: Block<B, I, S>[],\n options?: {\n /**\n * Inject elements into the {@link Head} element\n * @see https://react.email/docs/components/head\n */\n head?: React.ReactElement;\n /**\n * Set the preview text for the email\n * @see https://react.email/docs/components/preview\n */\n preview?: string | string[];\n /**\n * Add a header to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n header?: React.ReactElement;\n /**\n * Add a footer to every page.\n * The React component passed must be a React-Email component\n * @see https://react.email/components\n */\n footer?: React.ReactElement;\n /**\n * Customize the container element\n */\n container?: React.FC<{ children: React.ReactNode }>;\n },\n ) {\n const transformedBlocks = await this.transformBlocks(blocks);\n const DefaultContainer =\n options?.container ||\n (({ children }: { children: React.ReactNode }) => (\n <React.Fragment>{children}</React.Fragment>\n ));\n return renderEmail(\n <Html>\n <Head>{options?.head}</Head>\n <Body\n style={{\n fontFamily:\n \"'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif\",\n fontSize: \"16px\",\n lineHeight: \"1.5\",\n color: \"#333\",\n }}\n >\n {options?.preview && <Preview>{options.preview}</Preview>}\n <Tailwind>\n <DefaultContainer>\n {options?.header}\n {transformedBlocks}\n {options?.footer}\n </DefaultContainer>\n </Tailwind>\n </Body>\n </Html>,\n );\n }\n\n protected blocknoteDefaultPropsToReactEmailStyle(\n props: Partial<DefaultProps>,\n ): any {\n return {\n textAlign: props.textAlignment,\n backgroundColor:\n props.backgroundColor === \"default\" || !props.backgroundColor\n ? undefined\n : this.options.colors[props.backgroundColor]?.background,\n color:\n props.textColor === \"default\" || !props.textColor\n ? undefined\n : this.options.colors[props.textColor]?.text,\n alignItems:\n props.textAlignment === \"right\"\n ? \"flex-end\"\n : props.textAlignment === \"center\"\n ? \"center\"\n : undefined,\n };\n }\n}\n"],"names":["defaultTextStyle","defaultReactEmailTextStyles","createReactEmailBlockMappingForDefaultSchema","textStyles","block","jsx","Text","_a","_nestingLevel","checkboxSvg","jsxs","_b","Heading","textContent","CodeBlock","dracula","icon","previewWidth","FileLink","Caption","Img","table","headerRowsCount","headerColsCount","row","rowIndex","cell","colIndex","normalizedCell","mapTableCell","isHeaderRow","isHeaderCol","isHeader","CellTag","reactEmailBlockMappingForDefaultSchema","url","name","defaultText","Link","caption","width","defaultReactEmailLinkStyles","createReactEmailInlineContentMappingForDefaultSchema","linkStyles","ic","content","reactEmailInlineContentMappingForDefaultSchema","defaultReactEmailStyleTransformStyles","createReactEmailStyleMappingForDefaultSchema","_styleTransformStyles","val","exporter","reactEmailStyleMappingForDefaultSchema","defaultReactEmailDefaultSchemaStyles","reactEmailDefaultSchemaMappings","reactEmailDefaultSchemaMappingsWithStyles","styles","ReactEmailExporter","Exporter","schema","mappings","options","newOptions","COLORS_DEFAULT","styledText","stylesArray","blocks","startIndex","nestingLevel","listType","listItems","j","itemIndex","liContent","nestedList","element","children","parentId","i","child","listItem","style","nestedContent","childBlocks","Section","ret","b","nextIndex","self","React","transformedBlocks","DefaultContainer","renderEmail","Html","Head","Body","Preview","Tailwind","props"],"mappings":"8lBAwCMA,EAAuC,CAC3C,SAAU,GACV,WAAY,IACZ,OAAQ,EACR,UAAW,EACb,EAGaC,EAA8B,CACzC,UAAW,CACT,MAAOD,CAAA,EAET,eAAgB,CACd,MAAOA,CAAA,EAET,eAAgB,CACd,MAAOA,CAAA,EAET,iBAAkB,CAChB,MAAOA,CAAA,EAET,cAAe,CACb,MAAOA,CAAA,EAET,MAAO,CACL,MAAOA,CAAA,EAET,WAAY,CACV,MAAOA,CAAA,EAET,UAAW,CACT,MAAOA,CAAA,EAET,QAAS,CACP,MAAOA,CAAA,EAET,SAAU,CACR,MAAO,CACL,SAAU,GACV,OAAQ,CAAA,CACV,EAEF,SAAU,CACR,MAAO,CACL,SAAU,GACV,OAAQ,CAAA,CACV,EAEF,SAAU,CACR,MAAO,CACL,SAAU,GACV,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AA,KAAA,CAAM,0BAAS,IAAA,CAAK,EACrBpF,EAAAA,KAACqF,EAAAA,KAAA,CACC,MAAO,CACL,WACE,iHACF,SAAU,OACV,WAAY,MACZ,MAAO,MAAA,EAGR,SAAA,EAAAlC,GAAA,YAAAA,EAAS,UAAWxD,MAAC2F,EAAAA,QAAA,CAAS,SAAAnC,EAAQ,QAAQ,EAC/CxD,EAAAA,IAAC4F,EAAAA,SAAA,CACC,SAAAvF,EAAAA,KAACiF,EAAA,CACE,SAAA,CAAA9B,GAAA,YAAAA,EAAS,OACT6B,EACA7B,GAAA,YAAAA,EAAS,MAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAEJ,CAEU,uCACRqC,EACK,SACL,MAAO,CACL,UAAWA,EAAM,cACjB,gBACEA,EAAM,kBAAoB,WAAa,CAACA,EAAM,kBAE1C3F,EAAA,KAAK,QAAQ,OAAO2F,EAAM,eAAe,IAAzC,KADA,OACA3F,EAA4C,WAClD,MACE2F,EAAM,YAAc,WAAa,CAACA,EAAM,YAEpCvF,EAAA,KAAK,QAAQ,OAAOuF,EAAM,SAAS,IAAnC,KADA,OACAvF,EAAsC,KAC5C,WACEuF,EAAM,gBAAkB,QACpB,WACAA,EAAM,gBAAkB,SACtB,SACA,MAAA,CAEZ,CACF"}
@@ -1 +1 @@
1
- {"builtAt":1762873634272,"assets":[{"name":"blocknote-xl-email-exporter.umd.cjs","size":12651},{"name":"blocknote-xl-email-exporter.umd.cjs.map","size":46264}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote-xl-email-exporter.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/react-email/defaultSchema/blocks.tsx","size":13910,"chunks":["a1ee98a"]},{"name":"./src/react-email/defaultSchema/inlinecontent.tsx","size":579,"chunks":["a1ee98a"]},{"name":"./src/react-email/defaultSchema/styles.tsx","size":1200,"chunks":["a1ee98a"]},{"name":"./src/react-email/defaultSchema/index.ts","size":857,"chunks":["a1ee98a"]},{"name":"./src/react-email/reactEmailExporter.tsx","size":7442,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
1
+ {"builtAt":1763459643973,"assets":[{"name":"blocknote-xl-email-exporter.umd.cjs","size":12685},{"name":"blocknote-xl-email-exporter.umd.cjs.map","size":46182}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote-xl-email-exporter.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/react-email/defaultSchema/blocks.tsx","size":13910,"chunks":["a1ee98a"]},{"name":"./src/react-email/defaultSchema/inlinecontent.tsx","size":579,"chunks":["a1ee98a"]},{"name":"./src/react-email/defaultSchema/styles.tsx","size":1200,"chunks":["a1ee98a"]},{"name":"./src/react-email/defaultSchema/index.ts","size":857,"chunks":["a1ee98a"]},{"name":"./src/react-email/reactEmailExporter.tsx","size":7444,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/xl-email-exporter"
10
10
  },
11
11
  "license": "GPL-3.0 OR PROPRIETARY",
12
- "version": "0.42.0",
12
+ "version": "0.42.1",
13
13
  "files": [
14
14
  "dist",
15
15
  "types",
@@ -46,8 +46,8 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@blocknote/core": "0.42.0",
50
- "@blocknote/react": "0.42.0",
49
+ "@blocknote/core": "0.42.1",
50
+ "@blocknote/react": "0.42.1",
51
51
  "@react-email/components": "^0.1.1",
52
52
  "@react-email/render": "^1.4.0",
53
53
  "buffer": "^6.0.3",
@@ -333,15 +333,11 @@ export class ReactEmailExporter<
333
333
  backgroundColor:
334
334
  props.backgroundColor === "default" || !props.backgroundColor
335
335
  ? undefined
336
- : this.options.colors[
337
- props.backgroundColor as keyof typeof this.options.colors
338
- ].background,
336
+ : this.options.colors[props.backgroundColor]?.background,
339
337
  color:
340
338
  props.textColor === "default" || !props.textColor
341
339
  ? undefined
342
- : this.options.colors[
343
- props.textColor as keyof typeof this.options.colors
344
- ].text,
340
+ : this.options.colors[props.textColor]?.text,
345
341
  alignItems:
346
342
  props.textAlignment === "right"
347
343
  ? "flex-end"