Files
klz-cables.com/.pnpm-store/v10/files/57/2c1611f7c7b3d87c18dc99104ce622a1206272084f8d52873be4717516f62a37a0d7102f0460be07849b86d50f818ada239ee217c03fe998b50995d16683f7
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

49 lines
1.4 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.
*
*/
'use strict';
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
var history = require('@lexical/history');
var react = require('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 = react.useMemo(() => externalHistoryState || history.createEmptyHistoryState(), [externalHistoryState]);
react.useEffect(() => {
return history.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] = LexicalComposerContext.useLexicalComposerContext();
useHistory(editor, externalHistoryState, delay);
return null;
}
exports.createEmptyHistoryState = history.createEmptyHistoryState;
exports.HistoryPlugin = HistoryPlugin;