first commit
This commit is contained in:
16
app_vue/node_modules/clipboardy/browser.js
generated
vendored
Normal file
16
app_vue/node_modules/clipboardy/browser.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
/* eslint-env browser */
|
||||
'use strict';
|
||||
|
||||
export const write = async text => {
|
||||
await navigator.clipboard.writeText(text);
|
||||
};
|
||||
|
||||
export const read = async () => navigator.clipboard.readText();
|
||||
|
||||
export const readSync = () => {
|
||||
throw new Error('`.readSync()` is not supported in browsers!');
|
||||
};
|
||||
|
||||
export const writeSync = () => {
|
||||
throw new Error('`.writeSync()` is not supported in browsers!');
|
||||
};
|
BIN
app_vue/node_modules/clipboardy/fallbacks/.DS_Store
generated
vendored
Normal file
BIN
app_vue/node_modules/clipboardy/fallbacks/.DS_Store
generated
vendored
Normal file
Binary file not shown.
BIN
app_vue/node_modules/clipboardy/fallbacks/linux/xsel
generated
vendored
Normal file
BIN
app_vue/node_modules/clipboardy/fallbacks/linux/xsel
generated
vendored
Normal file
Binary file not shown.
BIN
app_vue/node_modules/clipboardy/fallbacks/windows/.DS_Store
generated
vendored
Normal file
BIN
app_vue/node_modules/clipboardy/fallbacks/windows/.DS_Store
generated
vendored
Normal file
Binary file not shown.
BIN
app_vue/node_modules/clipboardy/fallbacks/windows/clipboard_i686.exe
generated
vendored
Normal file
BIN
app_vue/node_modules/clipboardy/fallbacks/windows/clipboard_i686.exe
generated
vendored
Normal file
Binary file not shown.
BIN
app_vue/node_modules/clipboardy/fallbacks/windows/clipboard_x86_64.exe
generated
vendored
Normal file
BIN
app_vue/node_modules/clipboardy/fallbacks/windows/clipboard_x86_64.exe
generated
vendored
Normal file
Binary file not shown.
37
app_vue/node_modules/clipboardy/index.d.ts
generated
vendored
Normal file
37
app_vue/node_modules/clipboardy/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
Write (copy) to the clipboard asynchronously.
|
||||
|
||||
@param text - The text to write to the clipboard.
|
||||
*/
|
||||
export function write(text: string): Promise<void>;
|
||||
|
||||
/**
|
||||
Write (copy) to the clipboard synchronously.
|
||||
|
||||
Doesn't work in browsers.
|
||||
|
||||
@param text - The text to write to the clipboard.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as clipboardy from 'clipboardy';
|
||||
|
||||
clipboardy.writeSync('🦄');
|
||||
|
||||
clipboardy.readSync();
|
||||
//=> '🦄'
|
||||
```
|
||||
*/
|
||||
export function writeSync(text: string): void;
|
||||
|
||||
/**
|
||||
Read (paste) from the clipboard asynchronously.
|
||||
*/
|
||||
export function read(): Promise<string>;
|
||||
|
||||
/**
|
||||
Read (paste) from the clipboard synchronously.
|
||||
|
||||
Doesn't work in browsers.
|
||||
*/
|
||||
export function readSync(): string;
|
48
app_vue/node_modules/clipboardy/index.js
generated
vendored
Normal file
48
app_vue/node_modules/clipboardy/index.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
const isWSL = require('is-wsl');
|
||||
const termux = require('./lib/termux.js');
|
||||
const linux = require('./lib/linux.js');
|
||||
const macos = require('./lib/macos.js');
|
||||
const windows = require('./lib/windows.js');
|
||||
|
||||
const platformLib = (() => {
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
return macos;
|
||||
case 'win32':
|
||||
return windows;
|
||||
case 'android':
|
||||
if (process.env.PREFIX !== '/data/data/com.termux/files/usr') {
|
||||
throw new Error('You need to install Termux for this module to work on Android: https://termux.com');
|
||||
}
|
||||
|
||||
return termux;
|
||||
default:
|
||||
// `process.platform === 'linux'` for WSL.
|
||||
if (isWSL) {
|
||||
return windows;
|
||||
}
|
||||
|
||||
return linux;
|
||||
}
|
||||
})();
|
||||
|
||||
exports.write = async text => {
|
||||
if (typeof text !== 'string') {
|
||||
throw new TypeError(`Expected a string, got ${typeof text}`);
|
||||
}
|
||||
|
||||
await platformLib.copy({input: text});
|
||||
};
|
||||
|
||||
exports.read = async () => platformLib.paste({stripEof: false});
|
||||
|
||||
exports.writeSync = text => {
|
||||
if (typeof text !== 'string') {
|
||||
throw new TypeError(`Expected a string, got ${typeof text}`);
|
||||
}
|
||||
|
||||
platformLib.copySync({input: text});
|
||||
};
|
||||
|
||||
exports.readSync = () => platformLib.pasteSync({stripEof: false}).stdout;
|
57
app_vue/node_modules/clipboardy/lib/linux.js
generated
vendored
Normal file
57
app_vue/node_modules/clipboardy/lib/linux.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const execa = require('execa');
|
||||
|
||||
const xsel = 'xsel';
|
||||
const xselFallback = path.join(__dirname, '../fallbacks/linux/xsel');
|
||||
|
||||
const copyArguments = ['--clipboard', '--input'];
|
||||
const pasteArguments = ['--clipboard', '--output'];
|
||||
|
||||
const makeError = (xselError, fallbackError) => {
|
||||
let error;
|
||||
if (xselError.code === 'ENOENT') {
|
||||
error = new Error('Couldn\'t find the `xsel` binary and fallback didn\'t work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel');
|
||||
} else {
|
||||
error = new Error('Both xsel and fallback failed');
|
||||
error.xselError = xselError;
|
||||
}
|
||||
|
||||
error.fallbackError = fallbackError;
|
||||
return error;
|
||||
};
|
||||
|
||||
const xselWithFallback = async (argumentList, options) => {
|
||||
try {
|
||||
return await execa.stdout(xsel, argumentList, options);
|
||||
} catch (xselError) {
|
||||
try {
|
||||
return await execa.stdout(xselFallback, argumentList, options);
|
||||
} catch (fallbackError) {
|
||||
throw makeError(xselError, fallbackError);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const xselWithFallbackSync = (argumentList, options) => {
|
||||
try {
|
||||
return execa.sync(xsel, argumentList, options);
|
||||
} catch (xselError) {
|
||||
try {
|
||||
return execa.sync(xselFallback, argumentList, options);
|
||||
} catch (fallbackError) {
|
||||
throw makeError(xselError, fallbackError);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
copy: async options => {
|
||||
await xselWithFallback(copyArguments, options);
|
||||
},
|
||||
copySync: options => {
|
||||
xselWithFallbackSync(copyArguments, options);
|
||||
},
|
||||
paste: options => xselWithFallback(pasteArguments, options),
|
||||
pasteSync: options => xselWithFallbackSync(pasteArguments, options)
|
||||
};
|
14
app_vue/node_modules/clipboardy/lib/macos.js
generated
vendored
Normal file
14
app_vue/node_modules/clipboardy/lib/macos.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
const execa = require('execa');
|
||||
|
||||
const env = {
|
||||
...process.env,
|
||||
LC_CTYPE: 'UTF-8'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
copy: async options => execa('pbcopy', {...options, env}),
|
||||
paste: async options => execa.stdout('pbpaste', {...options, env}),
|
||||
copySync: options => execa.sync('pbcopy', {...options, env}),
|
||||
pasteSync: options => execa.sync('pbpaste', {...options, env})
|
||||
};
|
41
app_vue/node_modules/clipboardy/lib/termux.js
generated
vendored
Normal file
41
app_vue/node_modules/clipboardy/lib/termux.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
'use strict';
|
||||
const execa = require('execa');
|
||||
|
||||
const handler = error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
throw new Error('Couldn\'t find the termux-api scripts. You can install them with: apt install termux-api');
|
||||
}
|
||||
|
||||
throw error;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
copy: async options => {
|
||||
try {
|
||||
await execa('termux-clipboard-set', options);
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
paste: async options => {
|
||||
try {
|
||||
return await execa.stdout('termux-clipboard-get', options);
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
copySync: options => {
|
||||
try {
|
||||
execa.sync('termux-clipboard-set', options);
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
pasteSync: options => {
|
||||
try {
|
||||
return execa.sync('termux-clipboard-get', options);
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
}
|
||||
};
|
16
app_vue/node_modules/clipboardy/lib/windows.js
generated
vendored
Normal file
16
app_vue/node_modules/clipboardy/lib/windows.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const execa = require('execa');
|
||||
const arch = require('arch');
|
||||
|
||||
// Binaries from: https://github.com/sindresorhus/win-clipboard
|
||||
const windowBinaryPath = arch() === 'x64' ?
|
||||
path.join(__dirname, '../fallbacks/windows/clipboard_x86_64.exe') :
|
||||
path.join(__dirname, '../fallbacks/windows/clipboard_i686.exe');
|
||||
|
||||
module.exports = {
|
||||
copy: async options => execa(windowBinaryPath, ['--copy'], options),
|
||||
paste: async options => execa.stdout(windowBinaryPath, ['--paste'], options),
|
||||
copySync: options => execa.sync(windowBinaryPath, ['--copy'], options),
|
||||
pasteSync: options => execa.sync(windowBinaryPath, ['--paste'], options)
|
||||
};
|
9
app_vue/node_modules/clipboardy/license
generated
vendored
Normal file
9
app_vue/node_modules/clipboardy/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
53
app_vue/node_modules/clipboardy/package.json
generated
vendored
Normal file
53
app_vue/node_modules/clipboardy/package.json
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "clipboardy",
|
||||
"version": "2.3.0",
|
||||
"description": "Access the system clipboard (copy/paste)",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/clipboardy",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"browser.js",
|
||||
"lib",
|
||||
"fallbacks"
|
||||
],
|
||||
"keywords": [
|
||||
"clipboard",
|
||||
"copy",
|
||||
"paste",
|
||||
"copy-paste",
|
||||
"pasteboard",
|
||||
"read",
|
||||
"write",
|
||||
"pbcopy",
|
||||
"clip",
|
||||
"xclip",
|
||||
"xsel"
|
||||
],
|
||||
"dependencies": {
|
||||
"arch": "^2.1.1",
|
||||
"execa": "^1.0.0",
|
||||
"is-wsl": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^2.1.0",
|
||||
"tsd": "^0.10.0",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"browser": "browser.js",
|
||||
"exports": {
|
||||
"browser": "./browser.js",
|
||||
"default": "./index.js"
|
||||
}
|
||||
}
|
69
app_vue/node_modules/clipboardy/readme.md
generated
vendored
Normal file
69
app_vue/node_modules/clipboardy/readme.md
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
# clipboardy [](https://travis-ci.org/sindresorhus/clipboardy)
|
||||
|
||||
> Access the system clipboard (copy/paste)
|
||||
|
||||
Cross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD, Android with [Termux](https://termux.com/), [modern browsers](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#Browser_compatibility).
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install clipboardy
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const clipboardy = require('clipboardy');
|
||||
|
||||
clipboardy.writeSync('🦄');
|
||||
|
||||
clipboardy.readSync();
|
||||
//=> '🦄'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### clipboardy
|
||||
|
||||
#### .write(text)
|
||||
|
||||
Write (copy) to the clipboard asynchronously. Returns a `Promise`.
|
||||
|
||||
##### text
|
||||
|
||||
Type: `string`
|
||||
|
||||
The text to write to the clipboard.
|
||||
|
||||
#### .read()
|
||||
|
||||
Read (paste) from the clipboard asynchronously. Returns a `Promise`.
|
||||
|
||||
#### .writeSync(text)
|
||||
|
||||
Write (copy) to the clipboard synchronously.
|
||||
|
||||
Doesn't work in browsers.
|
||||
|
||||
##### text
|
||||
|
||||
Type: `string`
|
||||
|
||||
The text to write to the clipboard.
|
||||
|
||||
#### .readSync()
|
||||
|
||||
Read (paste) from the clipboard synchronously.
|
||||
|
||||
Doesn't work in browsers.
|
||||
|
||||
## FAQ
|
||||
|
||||
#### Where can I find the source of the bundled binaries?
|
||||
|
||||
The [Linux binary](https://github.com/sindresorhus/clipboardy/blob/master/fallbacks/linux/xsel) is just a bundled version of [`xsel`](https://linux.die.net/man/1/xsel). The source for the [Windows binary](https://github.com/sindresorhus/clipboardy/blob/master/fallbacks/windows/clipboard_x86_64.exe) can be found [here](https://github.com/sindresorhus/win-clipboard).
|
||||
|
||||
## Related
|
||||
|
||||
- [clipboard-cli](https://github.com/sindresorhus/clipboard-cli) - CLI for this module
|
||||
- [copy-text-to-clipboard](https://github.com/sindresorhus/copy-text-to-clipboard) - Copy text to the clipboard in the browser
|
Reference in New Issue
Block a user