feat(lexical): add declarative rich text editor

Introduce @workspace/lexical with composable actions, toolbars, embeds, rich-text nodes, media uploads, selection utilities, HTML serialization, and theme styling.\n\nLocalize built-in controls through MessageDescriptor catalogs for English and Simplified Chinese, while providing an English I18nProvider fallback for standalone editor use. Include focused unit coverage for actions, controls, serialization, plugins, public API, and catalogs.
This commit is contained in:
Maofeng
2026-07-31 15:07:09 +08:00
parent 1fe9c1021a
commit 0d817537be
65 changed files with 7453 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { describe, expect, it } from "vitest"
import {
ActionGroup,
Bold,
ClipboardImages,
defineLexicalAction,
LexicalActions,
LexicalBubbleToolbar,
LexicalContent,
LexicalFixedToolbar,
LexicalFooter,
LexicalRoot,
normalizeLexicalHtml,
} from "."
describe("Lexical editor public API", () => {
it("exports the declarative compound components", () => {
expect(LexicalRoot).toBeTypeOf("function")
expect(LexicalActions).toBeTypeOf("function")
expect(LexicalFixedToolbar).toBeTypeOf("function")
expect(LexicalBubbleToolbar).toBeTypeOf("function")
expect(LexicalContent).toBeTypeOf("function")
expect(LexicalFooter).toBeTypeOf("function")
expect(ActionGroup).toBeTypeOf("function")
expect(Bold).toBeTypeOf("function")
expect(ClipboardImages).toBeTypeOf("function")
expect(defineLexicalAction).toBeTypeOf("function")
expect(normalizeLexicalHtml).toBeTypeOf("function")
})
})