Add duplicate selection functionality in App.js

This commit is contained in:
2026-04-05 04:23:58 +02:00
parent f195d2b0b5
commit 70725fa989

View File

@@ -2115,6 +2115,20 @@ export function App({ store, initialStatusMessage }) {
}
return false;
};
const handleDuplicateSelection = () => {
if (!selectionCanBeDuplicated(editorState.selection)) {
return false;
}
try {
store.executeCommand(createDuplicateSelectionCommand());
setStatusMessage("Duplicated selection.");
return true;
}
catch (error) {
setStatusMessage(getErrorMessage(error));
return false;
}
};
const updateInteractionLinkTrigger = (link, trigger) => {
const sourceEntity = getInteractionSourceEntityForLink(link);
if (sourceEntity?.kind === "interactable" && trigger !== "click") {