@tauri-apps/plugin-clipboard-manager 2.0.0-rc.2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,9 +2,17 @@
2
2
 
3
3
  Read and write to the system clipboard.
4
4
 
5
+ | Platform | Supported |
6
+ | -------- | --------- |
7
+ | Linux | ✓ |
8
+ | Windows | ✓ |
9
+ | macOS | ✓ |
10
+ | Android | ✓ |
11
+ | iOS | ✓ |
12
+
5
13
  ## Install
6
14
 
7
- _This plugin requires a Rust version of at least **1.75**_
15
+ _This plugin requires a Rust version of at least **1.77.2**_
8
16
 
9
17
  There are three general methods of installation that we can recommend.
10
18
 
@@ -18,7 +26,7 @@ Install the Core plugin by adding the following to your `Cargo.toml` file:
18
26
 
19
27
  ```toml
20
28
  [dependencies]
21
- tauri-plugin-clipboard-manager = "2.0.0-rc"
29
+ tauri-plugin-clipboard-manager = "2.0.0"
22
30
  # alternatively with Git:
23
31
  tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
24
32
  ```
package/dist-js/index.cjs CHANGED
@@ -44,6 +44,11 @@ async function readText() {
44
44
  }
45
45
  /**
46
46
  * Writes image buffer to the clipboard.
47
+ *
48
+ * #### Platform-specific
49
+ *
50
+ * - **Android / iOS:** Not supported.
51
+ *
47
52
  * @example
48
53
  * ```typescript
49
54
  * import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
@@ -67,12 +72,17 @@ async function writeImage(image$1) {
67
72
  }
68
73
  /**
69
74
  * Gets the clipboard content as Uint8Array image.
75
+ *
76
+ * #### Platform-specific
77
+ *
78
+ * - **Android / iOS:** Not supported.
79
+ *
70
80
  * @example
71
81
  * ```typescript
72
82
  * import { readImage } from '@tauri-apps/plugin-clipboard-manager';
73
83
  *
74
84
  * const clipboardImage = await readImage();
75
- * const blob = new Blob([clipboardImage.bytes], { type: 'image' })
85
+ * const blob = new Blob([await clipboardImage.rbga()], { type: 'image' })
76
86
  * const url = URL.createObjectURL(blob)
77
87
  * ```
78
88
  * @since 2.0.0
@@ -82,6 +92,11 @@ async function readImage() {
82
92
  }
83
93
  /**
84
94
  * * Writes HTML or fallbacks to write provided plain text to the clipboard.
95
+ *
96
+ * #### Platform-specific
97
+ *
98
+ * - **Android / iOS:** Not supported.
99
+ *
85
100
  * @example
86
101
  * ```typescript
87
102
  * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
@@ -94,10 +109,10 @@ async function readImage() {
94
109
  *
95
110
  * @since 2.0.0
96
111
  */
97
- async function writeHtml(html, altHtml) {
112
+ async function writeHtml(html, altText) {
98
113
  await core.invoke('plugin:clipboard-manager|write_html', {
99
114
  html,
100
- altHtml
115
+ altText
101
116
  });
102
117
  }
103
118
  /**
@@ -27,6 +27,11 @@ declare function writeText(text: string, opts?: {
27
27
  declare function readText(): Promise<string>;
28
28
  /**
29
29
  * Writes image buffer to the clipboard.
30
+ *
31
+ * #### Platform-specific
32
+ *
33
+ * - **Android / iOS:** Not supported.
34
+ *
30
35
  * @example
31
36
  * ```typescript
32
37
  * import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
@@ -46,12 +51,17 @@ declare function readText(): Promise<string>;
46
51
  declare function writeImage(image: string | Image | Uint8Array | ArrayBuffer | number[]): Promise<void>;
47
52
  /**
48
53
  * Gets the clipboard content as Uint8Array image.
54
+ *
55
+ * #### Platform-specific
56
+ *
57
+ * - **Android / iOS:** Not supported.
58
+ *
49
59
  * @example
50
60
  * ```typescript
51
61
  * import { readImage } from '@tauri-apps/plugin-clipboard-manager';
52
62
  *
53
63
  * const clipboardImage = await readImage();
54
- * const blob = new Blob([clipboardImage.bytes], { type: 'image' })
64
+ * const blob = new Blob([await clipboardImage.rbga()], { type: 'image' })
55
65
  * const url = URL.createObjectURL(blob)
56
66
  * ```
57
67
  * @since 2.0.0
@@ -59,6 +69,11 @@ declare function writeImage(image: string | Image | Uint8Array | ArrayBuffer | n
59
69
  declare function readImage(): Promise<Image>;
60
70
  /**
61
71
  * * Writes HTML or fallbacks to write provided plain text to the clipboard.
72
+ *
73
+ * #### Platform-specific
74
+ *
75
+ * - **Android / iOS:** Not supported.
76
+ *
62
77
  * @example
63
78
  * ```typescript
64
79
  * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
@@ -71,7 +86,7 @@ declare function readImage(): Promise<Image>;
71
86
  *
72
87
  * @since 2.0.0
73
88
  */
74
- declare function writeHtml(html: string, altHtml?: string): Promise<void>;
89
+ declare function writeHtml(html: string, altText?: string): Promise<void>;
75
90
  /**
76
91
  * Clears the clipboard.
77
92
  *
package/dist-js/index.js CHANGED
@@ -42,6 +42,11 @@ async function readText() {
42
42
  }
43
43
  /**
44
44
  * Writes image buffer to the clipboard.
45
+ *
46
+ * #### Platform-specific
47
+ *
48
+ * - **Android / iOS:** Not supported.
49
+ *
45
50
  * @example
46
51
  * ```typescript
47
52
  * import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
@@ -65,12 +70,17 @@ async function writeImage(image) {
65
70
  }
66
71
  /**
67
72
  * Gets the clipboard content as Uint8Array image.
73
+ *
74
+ * #### Platform-specific
75
+ *
76
+ * - **Android / iOS:** Not supported.
77
+ *
68
78
  * @example
69
79
  * ```typescript
70
80
  * import { readImage } from '@tauri-apps/plugin-clipboard-manager';
71
81
  *
72
82
  * const clipboardImage = await readImage();
73
- * const blob = new Blob([clipboardImage.bytes], { type: 'image' })
83
+ * const blob = new Blob([await clipboardImage.rbga()], { type: 'image' })
74
84
  * const url = URL.createObjectURL(blob)
75
85
  * ```
76
86
  * @since 2.0.0
@@ -80,6 +90,11 @@ async function readImage() {
80
90
  }
81
91
  /**
82
92
  * * Writes HTML or fallbacks to write provided plain text to the clipboard.
93
+ *
94
+ * #### Platform-specific
95
+ *
96
+ * - **Android / iOS:** Not supported.
97
+ *
83
98
  * @example
84
99
  * ```typescript
85
100
  * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
@@ -92,10 +107,10 @@ async function readImage() {
92
107
  *
93
108
  * @since 2.0.0
94
109
  */
95
- async function writeHtml(html, altHtml) {
110
+ async function writeHtml(html, altText) {
96
111
  await invoke('plugin:clipboard-manager|write_html', {
97
112
  html,
98
- altHtml
113
+ altText
99
114
  });
100
115
  }
101
116
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-clipboard-manager",
3
- "version": "2.0.0-rc.2",
4
- "license": "MIT or APACHE-2.0",
3
+ "version": "2.0.1",
4
+ "license": "MIT OR Apache-2.0",
5
5
  "authors": [
6
6
  "Tauri Programme within The Commons Conservancy"
7
7
  ],
@@ -24,6 +24,6 @@
24
24
  "LICENSE"
25
25
  ],
26
26
  "dependencies": {
27
- "@tauri-apps/api": "^2.0.0-rc.4"
27
+ "@tauri-apps/api": "^2.0.0"
28
28
  }
29
29
  }