Files
klz-cables.com/.pnpm-store/v10/files/e0/fe9616d350b0f5262aafefb057a8dfeefbb5f7760b0f80c39c3e628df07c7fe2c2be3bf2c153614a3a00cf21c3bcd689a7616360e7107da780e49ef4497c05
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

47 lines
1.3 KiB
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.
*
*/
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { createEmptyHistoryState, registerHistory } from '@lexical/history';
export { createEmptyHistoryState } from '@lexical/history';
import { useMemo, useEffect } from 'react';
/**
* 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.
*
*/
function useHistory(editor, externalHistoryState, delay = 1000) {
const historyState = useMemo(() => externalHistoryState || createEmptyHistoryState(), [externalHistoryState]);
useEffect(() => {
return registerHistory(editor, historyState, delay);
}, [delay, editor, historyState]);
}
/**
* 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.
*
*/
function HistoryPlugin({
delay,
externalHistoryState
}) {
const [editor] = useLexicalComposerContext();
useHistory(editor, externalHistoryState, delay);
return null;
}
export { HistoryPlugin };