better-react-email-editor 0.1.6 → 0.1.8

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.
@@ -2,12 +2,19 @@
2
2
  export interface FontOption {
3
3
  label: string;
4
4
  value: string;
5
+ /** Stylesheet of a web font (e.g. Google Fonts). Loaded in the editor, and linked in the exported email when the font is used. */
6
+ href?: string;
5
7
  }
6
8
  /**
7
9
  * Fonts installed on virtually every device and supported by every email
8
- * client, each with fallbacks. Single quotes only: the stack ends up in a
9
- * `style` attribute.
10
+ * client, each with fallbacks, plus Inter as a web font: only some clients
11
+ * (Apple Mail, iOS) load it, the others show Arial. Single quotes only: the
12
+ * stack ends up in a `style` attribute.
10
13
  */
11
14
  export declare const defaultFonts: FontOption[];
12
15
  /** The option whose first family matches `value` (quotes and fallbacks may differ). */
13
16
  export declare function findFont(fonts: FontOption[], value: string | undefined): FontOption | undefined;
17
+ /** Web fonts of `fonts` used by a rendered email (looked up in its `font-family` declarations). */
18
+ export declare function usedWebFonts(html: string, fonts: FontOption[]): FontOption[];
19
+ /** Adds `<link rel="stylesheet">` tags for the web fonts an email uses, so the clients that support them load them. */
20
+ export declare function linkWebFonts(html: string, fonts: FontOption[]): string;
@@ -0,0 +1,14 @@
1
+ import { Extension } from '@tiptap/core';
2
+ /**
3
+ * Spell check only where the user is writing: the text blocks of the
4
+ * selection, while the editable area has the browser focus. The rest of the
5
+ * email shows no red underlines.
6
+ *
7
+ * Tracks DOM focus itself: `editor.isFocused` stays true while the user works
8
+ * in the sidebar or top bar (the package's focus scopes keep the selection
9
+ * alive for the properties panel).
10
+ *
11
+ * Firefox keeps underlines when a block's `spellcheck` attribute turns off, so
12
+ * spell check is disabled there altogether.
13
+ */
14
+ export declare const FocusedSpellcheck: Extension<any, any>;
@@ -35,5 +35,5 @@ export * as content from './core/content';
35
35
  export { BLOCK_CONTAINERS, COLUMN_PARENTS, appendBlocks, applyDrop, findDropTarget, selectedUnit, selectUnit, duplicateUnit, deleteUnit, parentUnit, unitAt, type BlockUnit, type DragPayload, type DropTarget, } from './core/dnd';
36
36
  export { EmailButton } from './core/paste';
37
37
  export { inlineStyleToObject } from './core/style-utils';
38
- export { defaultFonts, findFont, type FontOption } from './core/fonts';
38
+ export { defaultFonts, findFont, linkWebFonts, usedWebFonts, type FontOption } from './core/fonts';
39
39
  export { cx, type StyleProps } from './core/cx';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-react-email-editor",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Drag & drop email builder for React (Unlayer-style), built on @react-email/editor. Modular components, English and French included.",
5
5
  "keywords": [
6
6
  "react",