Compare commits

..

13 Commits

Author SHA1 Message Date
Beto Muniz
9698b1176a 2.0.9 2022-01-27 22:50:17 -03:00
dependabot[bot]
2f70c7af6e Bump follow-redirects from 1.13.1 to 1.14.7 (#788)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-27 09:32:59 +00:00
dependabot[bot]
b0cd56df35 Bump engine.io from 4.1.0 to 4.1.2 (#789)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-27 09:32:46 +00:00
dependabot[bot]
d07940ecb0 Bump log4js from 6.3.0 to 6.4.0 (#790)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-27 09:32:32 +00:00
dependabot[bot]
57345ab3ce Bump browserslist from 4.16.1 to 4.16.6 (#763) 2021-06-29 21:03:06 +01:00
dependabot[bot]
641ac851e8 Bump ws from 7.4.2 to 7.4.6 (#764) 2021-06-29 21:02:45 +01:00
Beto Muniz
44df750c9f Isolate actions strategies in order to code improvement and programmatic usage. (#749)
* Isolate cut, copy and core helper functions.

* Update tests to accommodate new proposal

* Add/update tests

* Add tests to static copy/cut methods

* Update condition syntax based on PR reviews

* Migrate clipboard-action-default to functional approach. Update tests. Add tests

* Improve folder structure. Clean up code.

* Add types. Fix tsd check env. Improve in-code doc comments

* Improve in-code doc comments
2021-05-18 11:46:22 -03:00
dependabot[bot]
8762fc7c66 Bump ssri from 6.0.1 to 6.0.2 (#756)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 13:36:22 +01:00
dependabot[bot]
957080dcad Bump lodash from 4.17.20 to 4.17.21 (#760)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 13:36:14 +01:00
dependabot[bot]
b9d1496b9c Bump ua-parser-js from 0.7.23 to 0.7.28 (#761)
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.23 to 0.7.28.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.23...0.7.28)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 13:36:06 +01:00
dependabot[bot]
f1b1ab2b1a Bump hosted-git-info from 2.8.8 to 2.8.9 (#762)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 13:35:48 +01:00
Vitor Alencar
5ffe395b3a Merge pull request #752 from XhmikosR/patch-1
Update CI config
2021-05-12 21:59:16 +02:00
XhmikosR
9c062df900 Update CI config
* add `FORCE_COLOR: 2` so that we get colored output
* update to `actions/setup-node@v2`
* fix formatting
2021-04-08 09:29:09 +03:00
7 changed files with 11520 additions and 226 deletions

View File

@@ -5,9 +5,12 @@ name: build
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
env:
FORCE_COLOR: 2
jobs:
build:
@@ -20,13 +23,12 @@ jobs:
# For now is not possible to target LTS verssions =/ check progress here https://github.com/actions/setup-node/issues/26
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm test

View File

@@ -1,6 +1,6 @@
{
"name": "clipboard",
"version": "2.0.8",
"version": "2.0.9",
"description": "Modern copy to clipboard. No Flash. Just 3kb",
"license": "MIT",
"main": "dist/clipboard.js",

45
dist/clipboard.js vendored
View File

@@ -1,5 +1,5 @@
/*!
* clipboard.js v2.0.8
* clipboard.js v2.0.9
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
@@ -17,7 +17,7 @@
return /******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 747:
/***/ 686:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -49,12 +49,12 @@ function command(type) {
return false;
}
}
;// CONCATENATED MODULE: ./src/clipboard-action-cut.js
;// CONCATENATED MODULE: ./src/actions/cut.js
/**
* Cut action wrapper.
* @param {HTMLElement} target
* @param {String|HTMLElement} target
* @return {String}
*/
@@ -64,7 +64,7 @@ var ClipboardActionCut = function ClipboardActionCut(target) {
return selectedText;
};
/* harmony default export */ var clipboard_action_cut = (ClipboardActionCut);
/* harmony default export */ var actions_cut = (ClipboardActionCut);
;// CONCATENATED MODULE: ./src/common/create-fake-element.js
/**
* Creates a fake textarea element with a value.
@@ -90,7 +90,7 @@ function createFakeElement(value) {
fakeElement.value = value;
return fakeElement;
}
;// CONCATENATED MODULE: ./src/clipboard-action-copy.js
;// CONCATENATED MODULE: ./src/actions/copy.js
@@ -121,8 +121,8 @@ var ClipboardActionCopy = function ClipboardActionCopy(target) {
return selectedText;
};
/* harmony default export */ var clipboard_action_copy = (ClipboardActionCopy);
;// CONCATENATED MODULE: ./src/clipboard-action-default.js
/* harmony default export */ var actions_copy = (ClipboardActionCopy);
;// CONCATENATED MODULE: ./src/actions/default.js
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
@@ -163,20 +163,20 @@ var ClipboardActionDefault = function ClipboardActionDefault() {
if (text) {
return clipboard_action_copy(text, {
return actions_copy(text, {
container: container
});
} // Defines which selection strategy based on `target` property.
if (target) {
return action === 'cut' ? clipboard_action_cut(target) : clipboard_action_copy(target, {
return action === 'cut' ? actions_cut(target) : actions_copy(target, {
container: container
});
}
};
/* harmony default export */ var clipboard_action_default = (ClipboardActionDefault);
/* harmony default export */ var actions_default = (ClipboardActionDefault);
;// CONCATENATED MODULE: ./src/clipboard.js
function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
@@ -241,8 +241,6 @@ var Clipboard = /*#__PURE__*/function (_Emitter) {
_classCallCheck(this, Clipboard);
_this = _super.call(this);
_this.ClipboardActionCut = clipboard_action_cut.bind(_assertThisInitialized(_this));
_this.ClipboardActionCopy = clipboard_action_copy.bind(_assertThisInitialized(_this));
_this.resolveOptions(options);
@@ -289,7 +287,7 @@ var Clipboard = /*#__PURE__*/function (_Emitter) {
key: "onClick",
value: function onClick(e) {
var trigger = e.delegateTarget || e.currentTarget;
var selectedText = clipboard_action_default({
var selectedText = actions_default({
action: this.action(trigger),
container: this.container,
target: this.target(trigger),
@@ -334,6 +332,13 @@ var Clipboard = /*#__PURE__*/function (_Emitter) {
return document.querySelector(selector);
}
}
/**
* Allow fire programmatically a copy action
* @param {String|HTMLElement} target
* @param {Object} options
* @returns Text copied.
*/
}, {
key: "defaultText",
@@ -359,12 +364,18 @@ var Clipboard = /*#__PURE__*/function (_Emitter) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
container: document.body
};
return clipboard_action_copy(target, options);
return actions_copy(target, options);
}
/**
* Allow fire programmatically a cut action
* @param {String|HTMLElement} target
* @returns Text cutted.
*/
}, {
key: "cut",
value: function cut(target) {
return clipboard_action_cut(target);
return actions_cut(target);
}
/**
* Returns the support of the given action, or all actions if no action is
@@ -858,7 +869,7 @@ module.exports.TinyEmitter = E;
/******/ // module exports must be returned from runtime so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ return __webpack_require__(747);
/******/ return __webpack_require__(686);
/******/ })()
.default;
});

View File

@@ -1,5 +1,5 @@
/*!
* clipboard.js v2.0.8
* clipboard.js v2.0.9
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha

11667
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
Package.describe({
name: 'zenorocha:clipboard',
summary: 'Modern copy to clipboard. No Flash. Just 3kb.',
version: '2.0.8',
version: '2.0.9',
git: 'https://github.com/zenorocha/clipboard.js',
});

View File

@@ -1,6 +1,6 @@
{
"name": "clipboard",
"version": "2.0.8",
"version": "2.0.9",
"description": "Modern copy to clipboard. No Flash. Just 2kb",
"homepage": "https://clipboardjs.com",
"repository": "zenorocha/clipboard.js",