@fileverse-dev/ddoc 3.0.79-skeleton-2 → 3.0.80
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,8 +2,12 @@ import { Extension } from '@tiptap/core';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* TypographyPersistence consolidates fontFamily and fontSize persistence logic
|
|
5
|
-
* into a single extension with
|
|
6
|
-
*
|
|
5
|
+
* into a single extension with 2 plugins.
|
|
6
|
+
*
|
|
7
|
+
* Node-attr syncing (storedMarks → paragraph attrs) is handled directly by the
|
|
8
|
+
* setFontFamily/unsetFontFamily/setFontSize/unsetFontSize commands rather than
|
|
9
|
+
* via an appendTransaction plugin, because appendTransaction's setNodeMarkup
|
|
10
|
+
* clears storedMarks and drops other textStyle attrs like color.
|
|
7
11
|
*
|
|
8
12
|
* Plugins:
|
|
9
13
|
* 1. typographyInheritance — when a new paragraph is inserted next to a styled
|
|
@@ -12,11 +16,5 @@ import { Extension } from '@tiptap/core';
|
|
|
12
16
|
* at creation time, but should not be overridden when the user clears them).
|
|
13
17
|
* 2. typographyStoredMarks — when selection moves into an empty styled
|
|
14
18
|
* 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
19
|
*/
|
|
22
20
|
export declare const TypographyPersistence: Extension<any, any>;
|