mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
refactor: rename clipboard plugin to clipboard-manager (#400)
This commit is contained in:
committed by
GitHub
parent
26d993cfea
commit
b259baa17e
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard"
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.0.0-alpha.0"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
links = "tauri-plugin-clipboard"
|
||||
links = "tauri-plugin-clipboard-manager"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { workspace = true }
|
||||
@@ -1,4 +1,4 @@
|
||||
# Clipboard
|
||||
# Clipboard Manager
|
||||
|
||||
Read and write to the system clipboard.
|
||||
|
||||
@@ -18,9 +18,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file:
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
tauri-plugin-clipboard = "2.0.0-alpha"
|
||||
tauri-plugin-clipboard-manager = "2.0.0-alpha"
|
||||
# alternatively with Git:
|
||||
tauri-plugin-clipboard = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||
tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||
```
|
||||
|
||||
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
|
||||
@@ -28,18 +28,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add @tauri-apps/plugin-clipboard
|
||||
pnpm add @tauri-apps/plugin-clipboard-manager
|
||||
# or
|
||||
npm add @tauri-apps/plugin-clipboard
|
||||
npm add @tauri-apps/plugin-clipboard-manager
|
||||
# or
|
||||
yarn add @tauri-apps/plugin-clipboard
|
||||
yarn add @tauri-apps/plugin-clipboard-manager
|
||||
|
||||
# alternatively with Git:
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard#v2
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-clipboard#v2
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-clipboard#v2
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -51,7 +51,7 @@ First you need to register the core plugin with Tauri:
|
||||
```rust
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_clipboard::init())
|
||||
.plugin(tauri_plugin_clipboard_manager::init())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
@@ -60,7 +60,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { writeText, readText } from "@tauri-apps/plugin-clipboard";
|
||||
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
await writeText("Tauri is awesome!");
|
||||
assert(await readText(), "Tauri is awesome!");
|
||||
```
|
||||
Vendored
@@ -25,7 +25,7 @@ type ClipResponse = Clip<"PlainText", string>;
|
||||
* Writes plain text to the clipboard.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { writeText, readText } from '@tauri-apps/plugin-clipboard';
|
||||
* import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager';
|
||||
* await writeText('Tauri is awesome!');
|
||||
* assert(await readText(), 'Tauri is awesome!');
|
||||
* ```
|
||||
@@ -53,7 +53,7 @@ async function writeText(
|
||||
* Gets the clipboard content as plain text.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { readText } from '@tauri-apps/plugin-clipboard';
|
||||
* import { readText } from '@tauri-apps/plugin-clipboard-manager';
|
||||
* const clipboardText = await readText();
|
||||
* ```
|
||||
* @since 2.0.0
|
||||
@@ -6,16 +6,16 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "tauri-plugin-clipboard",
|
||||
name: "tauri-plugin-clipboard-manager",
|
||||
platforms: [
|
||||
.iOS(.v13),
|
||||
],
|
||||
products: [
|
||||
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||
.library(
|
||||
name: "tauri-plugin-clipboard",
|
||||
name: "tauri-plugin-clipboard-manager",
|
||||
type: .static,
|
||||
targets: ["tauri-plugin-clipboard"]),
|
||||
targets: ["tauri-plugin-clipboard-manager"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(name: "Tauri", path: "../.tauri/tauri-api")
|
||||
@@ -24,7 +24,7 @@ let package = Package(
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
||||
.target(
|
||||
name: "tauri-plugin-clipboard",
|
||||
name: "tauri-plugin-clipboard-manager",
|
||||
dependencies: [
|
||||
.byName(name: "Tauri")
|
||||
],
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-clipboard",
|
||||
"name": "@tauri-apps/plugin-clipboard-manager",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
@@ -0,0 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_CLIPBOARDMANAGER__=function(_){"use strict";return _.readText=async function(){return(await window.__TAURI_INVOKE__("plugin:clipboard|read")).options},_.writeText=async function(_,n){return window.__TAURI_INVOKE__("plugin:clipboard|write",{data:{kind:"PlainText",options:{label:null==n?void 0:n.label,text:_}}})},_}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_CLIPBOARDMANAGER__})}
|
||||
@@ -1 +0,0 @@
|
||||
if("__TAURI__"in window){var __TAURI_CLIPBOARD__=function(_){"use strict";return _.readText=async function(){return(await window.__TAURI_INVOKE__("plugin:clipboard|read")).options},_.writeText=async function(_,i){return window.__TAURI_INVOKE__("plugin:clipboard|write",{data:{kind:"PlainText",options:{label:null==i?void 0:i.label,text:_}}})},_}({});Object.defineProperty(window.__TAURI__,"clipboard",{value:__TAURI_CLIPBOARD__})}
|
||||
+1
-1
@@ -2,7 +2,7 @@ app
|
||||
authenticator
|
||||
autostart
|
||||
cli
|
||||
clipboard
|
||||
clipboard-manager
|
||||
dialog
|
||||
fs
|
||||
global-shortcut
|
||||
|
||||
Reference in New Issue
Block a user