Releases: github/clipboard-copy-element
Releases · github/clipboard-copy-element
v1.3.0
What's Changed
- Bump socket.io-parser from 4.2.2 to 4.2.4 by @dependabot in #68
- Bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in #69
- Fix import error in example page by @Xvezda in #70
- Allow disabling element by @camertron in #71
New Contributors
- @Xvezda made their first contribution in #70
- @camertron made their first contribution in #71
Full Changelog: v1.2.1...v1.3.0
v1.2.1
Fix package exports
Full Changelog: v1.2.0...v1.2.1
v1.2.0
What's Changed
- Bump acorn from 7.1.0 to 7.1.1 by @dependabot in #29
- TypeScript conversion by @muan in #30
- Upgrade eslint-config-github by @muan in #31
- Bump lodash from 4.17.15 to 4.17.19 by @dependabot in #32
- Update link to polyfill by @sonicdoe in #33
- Fix typo in example page texts by @gambala in #36
- Bump hosted-git-info from 2.8.8 to 2.8.9 by @dependabot in #42
- Bump socket.io from 2.3.0 to 2.4.1 by @dependabot in #43
- Bump lodash from 4.17.19 to 4.17.21 by @dependabot in #41
- Bump glob-parent from 5.1.0 to 5.1.2 by @dependabot in #39
- Bump path-parse from 1.0.6 to 1.0.7 by @dependabot in #38
- Bump y18n from 4.0.0 to 4.0.3 by @dependabot in #40
- Bump follow-redirects from 1.11.0 to 1.14.7 by @dependabot in #44
- Bump log4js from 6.2.1 to 6.4.0 by @dependabot in #45
- Bump pathval from 1.1.0 to 1.1.1 by @dependabot in #47
- Bump ajv from 6.12.2 to 6.12.6 by @dependabot in #49
- Bump follow-redirects from 1.14.7 to 1.14.8 by @dependabot in #50
- Use chromium for karma tests by @theinterned in #46
- Add a .devcontainer by @koddsson in #51
- Add a release action by @koddsson in #52
- Bump minimist from 1.2.5 to 1.2.6 by @dependabot in #53
- Bump karma from 5.0.9 to 6.3.16 by @dependabot in #54
- Bump ansi-regex from 3.0.0 to 3.0.1 by @dependabot in #55
- Bump got from 11.8.3 to 11.8.5 by @dependabot in #56
- move AOR to primer by @keithamus in #57
- Bump socket.io-parser from 4.0.4 to 4.0.5 by @dependabot in #58
- Bump minimatch and mocha by @dependabot in #59
- Bump engine.io and socket.io by @dependabot in #60
- Bump ua-parser-js from 0.7.31 to 0.7.33 by @dependabot in #61
- Bump engine.io and socket.io by @dependabot in #65
- upgrade to new web component standards by @keithamus in #67
New Contributors
- @dependabot made their first contribution in #29
- @sonicdoe made their first contribution in #33
- @gambala made their first contribution in #36
- @theinterned made their first contribution in #46
Full Changelog: v1.1.2...v1.2.0
v1.1.2
v1.1.1
v1.1.0
1.0.7
v1.0.6
v1.0.5
- 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
1.0.5
<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.