stimulus-clipboard
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -9,2 +9,8 @@ # Changelog | ||
## [3.4.0] - 2023-06-01 | ||
### Added | ||
- Allow to use HTML for success content. | ||
## [3.3.0] - 2022-12-23 | ||
@@ -11,0 +17,0 @@ |
@@ -1,1 +0,1 @@ | ||
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t(require("@hotwired/stimulus")):typeof define=="function"&&define.amd?define(["@hotwired/stimulus"],t):(e=typeof globalThis<"u"?globalThis:e||self,e.StimulusClipboard=t(e.Stimulus))})(this,function(e){"use strict";class t extends e.Controller{connect(){this.hasButtonTarget&&(this.originalContent=this.buttonTarget.innerHTML)}copy(i){i.preventDefault();const s=this.sourceTarget.innerHTML||this.sourceTarget.value;navigator.clipboard.writeText(s).then(()=>this.copied())}copied(){this.hasButtonTarget&&(this.timeout&&clearTimeout(this.timeout),this.buttonTarget.innerText=this.data.get("successContent"),this.timeout=setTimeout(()=>{this.buttonTarget.innerHTML=this.originalContent},this.successDurationValue))}}return t.targets=["button","source"],t.values={successDuration:{type:Number,default:2e3}},t}); | ||
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t(require("@hotwired/stimulus")):typeof define=="function"&&define.amd?define(["@hotwired/stimulus"],t):(e=typeof globalThis<"u"?globalThis:e||self,e.StimulusClipboard=t(e.Stimulus))})(this,function(e){"use strict";class t extends e.Controller{connect(){this.hasButtonTarget&&(this.originalContent=this.buttonTarget.innerHTML)}copy(i){i.preventDefault();const s=this.sourceTarget.innerHTML||this.sourceTarget.value;navigator.clipboard.writeText(s).then(()=>this.copied())}copied(){this.hasButtonTarget&&(this.timeout&&clearTimeout(this.timeout),this.buttonTarget.innerHTML=this.data.get("successContent"),this.timeout=setTimeout(()=>{this.buttonTarget.innerHTML=this.originalContent},this.successDurationValue))}}return t.targets=["button","source"],t.values={successDuration:{type:Number,default:2e3}},t}); |
{ | ||
"name": "stimulus-clipboard", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"engines": { | ||
"node": "18" | ||
}, | ||
"description": "A Stimulus controller to copy text to clipboard.", | ||
@@ -32,14 +35,14 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "7.20.7", | ||
"@babel/core": "7.22.1", | ||
"@babel/plugin-syntax-class-properties": "7.12.13", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@babel/preset-env": "^7.22.4", | ||
"@babel/preset-typescript": "^7.21.5", | ||
"@hotwired/stimulus": "^3.2.1", | ||
"autoprefixer": "^10.4.13", | ||
"np": "^7.6.2", | ||
"postcss": "^8.4.20", | ||
"autoprefixer": "^10.4.14", | ||
"np": "^8.0.2", | ||
"postcss": "^8.4.24", | ||
"prettier-standard": "16.4.1", | ||
"tailwindcss": "^3.2.4", | ||
"typescript": "^4.9.4", | ||
"vite": "^4.0.3" | ||
"tailwindcss": "^3.3.2", | ||
"typescript": "^5.0.4", | ||
"vite": "^4.3.9" | ||
}, | ||
@@ -46,0 +49,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6918