Files
klz-cables.com/.pnpm-store/v10/files/00/d9f759163e677edbeae0164cda36f7fec6c8f167c15bedc72f25521670cb1b019431c0e7684faf1288ed8f0dc5b9a06ce7ecc5b44ae6a1e5e6aeb2d93b297d
Marc Mintel 5397309103
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
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

10 lines
950 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"),t=require("lexical"),c=require("react");function o(e,c){return e.getEditorState().read((()=>{const e=t.$getNodeByKey(c);return null!==e&&e.isSelected()}))}exports.useLexicalNodeSelection=function(r){const[i]=e.useLexicalComposerContext(),[l,n]=c.useState((()=>o(i,r)));return c.useEffect((()=>{let e=!0;const t=i.registerUpdateListener((()=>{e&&n(o(i,r))}));return()=>{e=!1,t()}}),[i,r]),[l,c.useCallback((e=>{i.update((()=>{let c=t.$getSelection();t.$isNodeSelection(c)||(c=t.$createNodeSelection(),t.$setSelection(c)),t.$isNodeSelection(c)&&(e?c.add(r):c.delete(r))}))}),[i,r]),c.useCallback((()=>{i.update((()=>{const e=t.$getSelection();t.$isNodeSelection(e)&&e.clear()}))}),[i])]};