Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lecixal): export additional helper functions and commands #4173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/slimy-moons-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/core": minor
"@twilio-paste/lexical-library": minor
---

[Lexical Library] exported additional helper functions and commands to allow advanced editor node manipulation programatically
83 changes: 78 additions & 5 deletions packages/paste-libraries/lexical/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,92 @@ import ErrorBoundary from "@lexical/react/LexicalErrorBoundary";
import type { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";

export {
$getRoot,
$getSelection,
$createParagraphNode,
$createTextNode,
createCommand,
CLEAR_EDITOR_COMMAND,
KEY_ENTER_COMMAND,
COMMAND_PRIORITY_CRITICAL,
COMMAND_PRIORITY_HIGH,
COMMAND_PRIORITY_NORMAL,
COMMAND_PRIORITY_LOW,
COMMAND_PRIORITY_EDITOR,
BLUR_COMMAND,
CAN_REDO_COMMAND,
CAN_UNDO_COMMAND,
CLEAR_HISTORY_COMMAND,
CLICK_COMMAND,
CONTROLLED_TEXT_INSERTION_COMMAND,
COPY_COMMAND,
CUT_COMMAND,
DELETE_CHARACTER_COMMAND,
DELETE_LINE_COMMAND,
DELETE_WORD_COMMAND,
DRAGEND_COMMAND,
DRAGOVER_COMMAND,
DRAGSTART_COMMAND,
DROP_COMMAND,
FOCUS_COMMAND,
FORMAT_ELEMENT_COMMAND,
FORMAT_TEXT_COMMAND,
INDENT_CONTENT_COMMAND,
INSERT_LINE_BREAK_COMMAND,
INSERT_PARAGRAPH_COMMAND,
INSERT_TAB_COMMAND,
KEY_ARROW_DOWN_COMMAND,
KEY_ARROW_LEFT_COMMAND,
KEY_ARROW_RIGHT_COMMAND,
KEY_ARROW_UP_COMMAND,
KEY_BACKSPACE_COMMAND,
KEY_DELETE_COMMAND,
KEY_DOWN_COMMAND,
KEY_ESCAPE_COMMAND,
KEY_MODIFIER_COMMAND,
KEY_SPACE_COMMAND,
KEY_TAB_COMMAND,
MOVE_TO_END,
MOVE_TO_START,
OUTDENT_CONTENT_COMMAND,
PASTE_COMMAND,
REDO_COMMAND,
REMOVE_TEXT_COMMAND,
SELECT_ALL_COMMAND,
SELECTION_CHANGE_COMMAND,
UNDO_COMMAND,
$addUpdateTag,
$applyNodeReplacement,
$copyNode,
$getAdjacentNode,
$getNearestNodeFromDOMNode,
$getNearestRootOrShadowRoot,
$getNodeByKey,
$hasAncestor,
$hasUpdateTag,
$isInlineElementOrDecoratorNode,
$isLeafNode,
$isRootOrShadowRoot,
$nodesOfType,
$selectAll,
$setCompositionKey,
$setSelection,
$splitNode,
$parseSerializedNode,
$createRangeSelection,
$getPreviousSelection,
$getTextContent,
$insertNodes,
$isBlockElementNode,
$isNodeSelection,
$isRangeSelection,
$isParagraphNode,
$createLineBreakNode,
$isLineBreakNode,
$isElementNode,
$isDecoratorNode,
$getRoot,
$getSelection,
$createParagraphNode,
$createTextNode,
} from "lexical";
export type { EditorState, EditorThemeClasses, LexicalEditor } from "lexical";
export type { EditorState, EditorThemeClasses, LexicalEditor, SerializedEditorState } from "lexical";

export { AutoLinkNode } from "@lexical/link";
export { LexicalComposer } from "@lexical/react/LexicalComposer";
Expand Down
Loading