Skip to content

Commit

Permalink
fix copy command
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Aug 11, 2023
1 parent 04f702a commit e6d70b2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
18 changes: 10 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@wordpress/wordcount": "file:../wordcount",
"change-case": "^4.1.2",
"classnames": "^2.3.1",
"clipboard": "2.0.11",
"colord": "^2.7.0",
"deepmerge": "^4.3.0",
"diff": "^4.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/**
* External dependencies
*/
import Clipboard from 'clipboard';

/**
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import {
hasBlockSupport,
store as blocksStore,
serialize,
switchToBlockType,
isTemplatePart,
} from '@wordpress/blocks';
Expand Down Expand Up @@ -239,6 +245,7 @@ const useActionsCommands = () => {
replaceBlocks( clientIds, innerBlocks );
};
const onCopy = () => {
Clipboard.copy( serialize( blocks ) );
const selectedBlockClientIds = blocks.map(
( { clientId } ) => clientId
);
Expand Down
2 changes: 1 addition & 1 deletion packages/compose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@wordpress/keycodes": "file:../keycodes",
"@wordpress/priority-queue": "file:../priority-queue",
"change-case": "^4.1.2",
"clipboard": "^2.0.8",
"clipboard": "^2.0.11",
"mousetrap": "^1.6.5",
"use-memo-one": "^1.1.1"
},
Expand Down

0 comments on commit e6d70b2

Please sign in to comment.