@usememos/editor 26.11.1 → 26.11.2
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.js +55 -55
- package/dist/index.js.map +3 -3
- package/dist/types/view/dom.d.ts +10 -7
- package/package.json +1 -1
package/dist/types/view/dom.d.ts
CHANGED
|
@@ -100,6 +100,8 @@ export declare class BlockRenderer {
|
|
|
100
100
|
private readonly root;
|
|
101
101
|
private readonly labels;
|
|
102
102
|
private rendered;
|
|
103
|
+
/** What the last render put in the root. Anything else there is the browser's (see `strayText`). */
|
|
104
|
+
private placed;
|
|
103
105
|
/** Last number written into each ordered item's marker, keyed by element. */
|
|
104
106
|
private readonly numbers;
|
|
105
107
|
/** The URL policy for links and images. Set before a full render. */
|
|
@@ -212,6 +214,14 @@ export declare class BlockRenderer {
|
|
|
212
214
|
* skip layout while off screen; use it only when loading a document.
|
|
213
215
|
*/
|
|
214
216
|
render(doc: Doc, force?: boolean, lazy?: boolean): void;
|
|
217
|
+
/**
|
|
218
|
+
* The text the browser left in the root, outside what the last render put
|
|
219
|
+
* there. WebKit, on committing a composition that is a block's whole text,
|
|
220
|
+
* removes the block's element and inserts the committed text in the root:
|
|
221
|
+
* as a text node for a paragraph, and inside elements that keep the block's
|
|
222
|
+
* look for others (`<span style="font-size: …"><b>` for a heading).
|
|
223
|
+
*/
|
|
224
|
+
strayText(): string;
|
|
215
225
|
/**
|
|
216
226
|
* The footnotes section, as GitHub renders one: every definition that is
|
|
217
227
|
* referenced, in order of first reference, each rendered as its block is
|
|
@@ -241,13 +251,6 @@ export declare function contentElement(blockEl: HTMLElement, cell?: Cell): HTMLE
|
|
|
241
251
|
export declare function childIndex(node: Node): number;
|
|
242
252
|
/** Plain text of a content element as the browser currently has it, with atoms as one character. */
|
|
243
253
|
export declare function domText(contentEl: HTMLElement): string;
|
|
244
|
-
/**
|
|
245
|
-
* The text the browser left directly in the root, outside every block. The
|
|
246
|
-
* renderer puts only elements there. WebKit, on committing a composition that
|
|
247
|
-
* is a block's whole text, removes the block's element and inserts the
|
|
248
|
-
* committed text as a text node of the root.
|
|
249
|
-
*/
|
|
250
|
-
export declare function strayText(root: HTMLElement): string;
|
|
251
254
|
export declare function domToPosition(root: HTMLElement, node: Node, offset: number): Position | null;
|
|
252
255
|
/** The atom (an image or a rendered token) that starts at `pos`, or null. */
|
|
253
256
|
export declare function atomAt(blockEl: HTMLElement, pos: Position): HTMLElement | null;
|