@fileverse-dev/ddoc 3.0.64 → 3.0.65

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.
@@ -0,0 +1,11 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ fontFamilyPersistence: {
6
+ setFontFamily: (fontFamily: string) => ReturnType;
7
+ unsetFontFamily: () => ReturnType;
8
+ };
9
+ }
10
+ }
11
+ export declare const FontFamilyPersistence: Extension<any, any>;
@@ -0,0 +1,22 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ /**
4
+ * TypographyPersistence consolidates fontFamily and fontSize persistence logic
5
+ * into a single extension with 3 plugins, replacing the 6 individual plugins
6
+ * that were split across FontFamilyPersistence and FontSize.
7
+ *
8
+ * Plugins:
9
+ * 1. typographyInheritance — when a new paragraph is inserted next to a styled
10
+ * one, inherit fontFamily and fontSize in a single setNodeMarkup pass.
11
+ * Skips trailing-node paragraphs (they inherit from the previous sibling
12
+ * at creation time, but should not be overridden when the user clears them).
13
+ * 2. typographyStoredMarks — when selection moves into an empty styled
14
+ * paragraph, restore storedMarks for both fontFamily and fontSize at once.
15
+ * 3. typographySyncNodeAttr — when storedMarks change on an empty paragraph,
16
+ * update both node attributes in one setNodeMarkup call.
17
+ * Clearing only happens when the textStyle mark itself explicitly has a null
18
+ * value for the property — NOT when non-textStyle marks (bold, italic, etc.)
19
+ * are stored, which was previously causing font attrs to be wiped on
20
+ * bold/italic toggle.
21
+ */
22
+ export declare const TypographyPersistence: Extension<any, any>;