Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 632 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 632 Bytes

Utils

A utils library that is used across most packages of lexi-kit.

Features

  • strings.prefixClassNames - Add a prefix to a group of classes
  • getDOMRangeRect - Get a rect from a native DOM selection range
  • setFloatingElementPosition - Set the position of a floating element based on a DOM Rect.
  • guards.isHTMLElement - A typescript guard that hints that a value is an HTMLElement.
  • nodes.getSelectedNode - Get the correct selected node from a lexical RangeSelection.

Installation

$ npm install @lexi-kit/utils
# or
$ yarn add @lexi-kit/utils
# or
$ pnpm add @lexi-kit/utils