Skip to content

Commit

Permalink
[0.9] Remove experimental flag for copyToClipboard (#4037)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreatercurve authored Mar 8, 2023
1 parent 828df30 commit d126f97
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/lexical-clipboard/flow/LexicalClipboard.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ declare export function $generateNodesFromSerializedNodes(
serializedNodes: Array<BaseSerializedNode>,
): Array<LexicalNode>;

declare export function copyToClipboard__EXPERIMENTAL(
declare export function copyToClipboard(
editor: LexicalEditor,
event: null | ClipboardEvent,
): Promise<boolean>;
2 changes: 1 addition & 1 deletion packages/lexical-clipboard/src/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ let clipboardEventTimeout: null | number = null;

// TODO custom selection
// TODO potentially have a node customizable version for plain text
export async function copyToClipboard__EXPERIMENTAL(
export async function copyToClipboard(
editor: LexicalEditor,
event: null | ClipboardEvent,
): Promise<boolean> {
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-clipboard/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export {
$insertDataTransferForPlainText,
$insertDataTransferForRichText,
$insertGeneratedNodes,
copyToClipboard__EXPERIMENTAL,
copyToClipboard,
} from './clipboard';
12 changes: 3 additions & 9 deletions packages/lexical-rich-text/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type {

import {
$insertDataTransferForRichText,
copyToClipboard__EXPERIMENTAL,
copyToClipboard,
} from '@lexical/clipboard';
import {
$moveCharacter,
Expand Down Expand Up @@ -402,10 +402,7 @@ async function onCutForRichText(
event: CommandPayloadType<typeof CUT_COMMAND>,
editor: LexicalEditor,
): Promise<void> {
await copyToClipboard__EXPERIMENTAL(
editor,
event instanceof ClipboardEvent ? event : null,
);
await copyToClipboard(editor, event instanceof ClipboardEvent ? event : null);
editor.update(() => {
const selection = $getSelection();
if ($isRangeSelection(selection)) {
Expand Down Expand Up @@ -961,10 +958,7 @@ export function registerRichText(editor: LexicalEditor): () => void {
editor.registerCommand(
COPY_COMMAND,
(event) => {
copyToClipboard__EXPERIMENTAL(
editor,
event instanceof ClipboardEvent ? event : null,
);
copyToClipboard(editor, event instanceof ClipboardEvent ? event : null);
return true;
},
COMMAND_PRIORITY_EDITOR,
Expand Down

2 comments on commit d126f97

@vercel
Copy link

@vercel vercel bot commented on d126f97 Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexicaljs.com
lexical-git-main-fbopensource.vercel.app
lexicaljs.org
lexical-fbopensource.vercel.app
www.lexical.dev
lexical.dev

@vercel
Copy link

@vercel vercel bot commented on d126f97 Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-git-main-fbopensource.vercel.app
playground.lexical.dev
lexical-playground.vercel.app
lexical-playground-fbopensource.vercel.app

Please sign in to comment.