Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
10 lines
754 B
Plaintext
10 lines
754 B
Plaintext
/**
|
|
* 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.
|
|
*
|
|
*/
|
|
|
|
"use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/LexicalHorizontalRuleNode"),t=require("@lexical/utils"),o=require("lexical"),i=require("react");exports.HorizontalRulePlugin=function(){const[l]=e.useLexicalComposerContext();return i.useEffect((()=>l.registerCommand(r.INSERT_HORIZONTAL_RULE_COMMAND,(e=>{const i=o.$getSelection();if(!o.$isRangeSelection(i))return!1;if(null!==i.focus.getNode()){const e=r.$createHorizontalRuleNode();t.$insertNodeToNearestRoot(e)}return!0}),o.COMMAND_PRIORITY_EDITOR)),[l]),null};
|