clipboard-copy-element

Copy element text content or input values to the clipboard.

MIT License

Downloads
169.8K
Stars
461
Committers
12

Bot releases are hidden (Show)

clipboard-copy-element - v1.3.0 Latest Release

Published by camertron about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/github/clipboard-copy-element/compare/v1.2.1...v1.3.0

clipboard-copy-element - v1.2.1

Published by keithamus over 1 year ago

clipboard-copy-element - v1.2.0

Published by keithamus over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/github/clipboard-copy-element/compare/v1.1.2...v1.2.0

clipboard-copy-element -

Published by koddsson over 4 years ago

  • Add type to HTMLElementTagNameMap in typescript declaration file (#28)

https://github.com/github/clipboard-copy-element/compare/v1.1.1...v1.1.2

clipboard-copy-element - v1.1.1

Published by muan almost 5 years ago

  • Fix for -> input.id not getting copied in < iOS 13 #27
clipboard-copy-element - v1.1.0

Published by muan almost 5 years ago

Add support for Shadow DOM in #26, with thanks to @jorgecasar.

clipboard-copy-element - 1.0.7

Published by dgraham about 5 years ago

  • Fixed Flow module declaration #22
clipboard-copy-element -

Published by keithamus about 5 years ago

clipboard-copy-element -

Published by koddsson about 5 years ago

  • Merge pull request #18 from github/add-typescript-definition-file f2902b3
  • Merge branch 'master' into add-typescript-definition-file 3fe5fc9
  • set a name for the UMD bundle ece9825
  • default export class in flow definition file 4e47911
  • export ClipboardCopyElement by default da30301
  • reference typescript file in package.json 3847935
  • add typescript definition file 4b345c1

https://github.com/github/clipboard-copy-element/compare/v1.0.4...v1.0.5

clipboard-copy-element - 1.0.5

Published by koddsson about 5 years ago

<clipboard-copy> element

Copy element text content or input values to the clipboard.

Installation

$ npm install --save @github/clipboard-copy-element

Usage

import '@github/clipboard-copy-element'
<clipboard-copy for="blob-path" class="btn btn-sm BtnGroup-item">
  Copy path
</clipboard-copy>
<div id="blob-path">src/index.js</div>

Data sources

Attribute

<clipboard-copy value="src/index.js">Copy</clipboard-copy>

Element content

<clipboard-copy for="blob-path">Copy</clipboard-copy>
<div id="blob-path">src/index.js</div>

Form input

<clipboard-copy for="blob-path">Copy</clipboard-copy>
<input id="blob-path" value="src/index.js">

Hyperlink href

<clipboard-copy for="blob-path">Copy full URL</clipboard-copy>
<a id="blob-path" href="/path/to#my-blob">Link text will not be copied</a>

Events

After copying to the clipboard, a clipboard-copy event is dispatched from
the <clipboard-copy> element:

document.addEventListener('clipboard-copy', function(event) {
  const button = event.target
  button.classList.add('highlight')
})

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

clipboard-copy-element -

Published by koddsson about 5 years ago

  • Merge pull request #20 from github/publish-to-gpr-as-well ed91610
  • publish to GPR as a postpublish step 70ead12

https://github.com/github/clipboard-copy-element/compare/v1.0.3...v1.0.4

clipboard-copy-element - 1.0.4

Published by koddsson about 5 years ago

<clipboard-copy> element

Copy element text content or input values to the clipboard.

Installation

$ npm install --save @github/clipboard-copy-element

Usage

import '@github/clipboard-copy-element'
<clipboard-copy for="blob-path" class="btn btn-sm BtnGroup-item">
  Copy path
</clipboard-copy>
<div id="blob-path">src/index.js</div>

Data sources

Attribute

<clipboard-copy value="src/index.js">Copy</clipboard-copy>

Element content

<clipboard-copy for="blob-path">Copy</clipboard-copy>
<div id="blob-path">src/index.js</div>

Form input

<clipboard-copy for="blob-path">Copy</clipboard-copy>
<input id="blob-path" value="src/index.js">

Hyperlink href

<clipboard-copy for="blob-path">Copy full URL</clipboard-copy>
<a id="blob-path" href="/path/to#my-blob">Link text will not be copied</a>

Events

After copying to the clipboard, a clipboard-copy event is dispatched from
the <clipboard-copy> element:

document.addEventListener('clipboard-copy', function(event) {
  const button = event.target
  button.classList.add('highlight')
})

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

clipboard-copy-element -

Published by koddsson about 5 years ago

  • Merge pull request #19 from github/update-deps a5fb22f
  • run npm audit fix 0cc473a
  • update eslint-plugin-github, flow and karma-chrome-launcher to latest versions f3a5624
  • run npm update e3a96e4

https://github.com/github/clipboard-copy-element/compare/v1.0.2...v1.0.3

clipboard-copy-element -

Published by koddsson about 5 years ago

  • Merge pull request #17 from github/update-deps 3355875
  • update eslint, eslint-plugin-github and flow-bin manually to latest versions 186dbe6
  • run npm update 28f0ad6
  • update package name in README.md 003b465

https://github.com/github/clipboard-copy-element/compare/v1.0.1...v1.0.2

clipboard-copy-element -

Published by koddsson over 5 years ago

Package has been renamed to include the @github scope. You can now find it at https://www.npmjs.com/package/@github/clipboard-copy-element on npm.

https://github.com/github/clipboard-copy-element/compare/v1.0.0...v1.0.1

clipboard-copy-element - v0.5.0

Published by keithamus almost 6 years ago