UNPKG

@lexical/react

Version:

This package provides Lexical components and hooks for React applications.

10 lines (8 loc) 978 B
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import{AutoLinkNode as e,registerAutoLink as r}from"@lexical/link";export{createLinkMatcherWithRegExp}from"@lexical/link";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{useEffect as n}from"react";function t(o,t,i){n(()=>{o.hasNodes([e])||function(e,...r){const o=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw o.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77)}),n(()=>r(o,{changeHandlers:i?[i]:[],matchers:t}),[o,t,i])}function i({matchers:e,onChange:r}){const[n]=o();return t(n,e,r),null}export{i as AutoLinkPlugin};