mirror of
https://github.com/codex-team/editor.js
synced 2026-03-15 23:25:47 +01:00
* chore(caret): caret.setToBlock offset improved * handle empty block * Update caret.cy.ts * fix eslint
19 lines
No EOL
331 B
TypeScript
19 lines
No EOL
331 B
TypeScript
import { nanoid } from 'nanoid';
|
|
|
|
/**
|
|
* Creates a paragraph mock
|
|
*
|
|
* @param text - text for the paragraph
|
|
* @returns paragraph mock
|
|
*/
|
|
export function createParagraphMock(text: string): {
|
|
id: string;
|
|
type: string;
|
|
data: { text: string };
|
|
} {
|
|
return {
|
|
id: nanoid(),
|
|
type: 'paragraph',
|
|
data: { text },
|
|
};
|
|
} |