Skip to content

Commit

Permalink
feat(lecixal): export additional helper functions and commands
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus committed Nov 26, 2024
1 parent 7f39856 commit d98a780
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 5 deletions.
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

0 comments on commit d98a780

Please sign in to comment.