@fileverse-dev/ddoc 3.5.2-font-3 → 3.5.2-font-5
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.
- package/dist/index.es.js +11273 -11301
- package/dist/package/utils/font-loader.d.ts +18 -2
- package/package.json +1 -1
- package/dist/package/extensions/font-autoload.d.ts +0 -3
|
@@ -2,7 +2,23 @@ import { FontDescriptor } from '../types';
|
|
|
2
2
|
|
|
3
3
|
/** "Poppins, sans-serif" -> "Poppins"; "'Times New Roman', serif" -> "Times New Roman" */
|
|
4
4
|
export declare function primaryToken(family: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Registers each catalog font with the browser without downloading it. A
|
|
7
|
+
* FontFace added to document.fonts but never `.load()`-ed behaves like a CSS
|
|
8
|
+
* `@font-face` rule: the UA fetches it lazily the first time rendered text
|
|
9
|
+
* (local edit, paste, undo, or a remote Yjs update) matches the family — which
|
|
10
|
+
* is why no document-scanning extension is needed.
|
|
11
|
+
*
|
|
12
|
+
* Merges into the existing catalog and never clears it, so a second editor
|
|
13
|
+
* mounting without a `fonts` prop can't wipe fonts other editors on the same
|
|
14
|
+
* page still need. The CSS face name is derived from the family stack, not the
|
|
15
|
+
* cosmetic `name`, so the registered face actually matches styled content.
|
|
16
|
+
*/
|
|
5
17
|
export declare function registerFonts(fonts: FontDescriptor[]): void;
|
|
6
18
|
export declare function getRegisteredFonts(): FontDescriptor[];
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Forces a download and resolves once the face is ready. Used by the picker
|
|
21
|
+
* click so applying a font doesn't flash the fallback. `document.fonts.load`
|
|
22
|
+
* deduplicates internally, so no custom promise cache is needed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ensureLoaded(family: string): Promise<unknown>;
|
package/package.json
CHANGED