@symbiote-native/clipboard 0.3.0 → 2.0.0
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 +59 -5
- package/package.json +27 -15
package/README.md
CHANGED
|
@@ -93,7 +93,7 @@ function ClipboardScreen() {
|
|
|
93
93
|
const handleCopy = (input: string) =>
|
|
94
94
|
setStringAsync(input).then(() => getStringAsync().then(setText));
|
|
95
95
|
|
|
96
|
-
return <
|
|
96
|
+
return <text>{text ?? 'checking…'}</text>;
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -122,10 +122,63 @@ function handleCopy(input: string): void {
|
|
|
122
122
|
}
|
|
123
123
|
</script>
|
|
124
124
|
<template>
|
|
125
|
-
<
|
|
125
|
+
<text>{{ text }}</text>
|
|
126
126
|
</template>
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
```svelte
|
|
130
|
+
<!-- Svelte -->
|
|
131
|
+
<script lang="ts">
|
|
132
|
+
import { getStringAsync, setStringAsync } from '@symbiote-native/clipboard';
|
|
133
|
+
import { useClipboard } from '@symbiote-native/clipboard/svelte';
|
|
134
|
+
|
|
135
|
+
let text = $state('checking…');
|
|
136
|
+
function refresh(): void {
|
|
137
|
+
void getStringAsync().then(value => (text = value));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const clipboard = useClipboard(); // { current: IClipboardEvent | null }
|
|
141
|
+
|
|
142
|
+
$effect(() => {
|
|
143
|
+
refresh();
|
|
144
|
+
});
|
|
145
|
+
$effect(() => {
|
|
146
|
+
if (clipboard.current !== null) refresh();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
function handleCopy(input: string): void {
|
|
150
|
+
void setStringAsync(input).then(refresh);
|
|
151
|
+
}
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<text>{text}</text>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
// Solid
|
|
159
|
+
import { createEffect, createSignal } from 'solid-js';
|
|
160
|
+
import { getStringAsync, setStringAsync } from '@symbiote-native/clipboard';
|
|
161
|
+
import { createClipboard } from '@symbiote-native/clipboard/solid';
|
|
162
|
+
|
|
163
|
+
function ClipboardScreen() {
|
|
164
|
+
const clipboardEvent = createClipboard(); // Accessor<IClipboardEvent | null>
|
|
165
|
+
const [text, setText] = createSignal('checking…');
|
|
166
|
+
|
|
167
|
+
function refresh(): void {
|
|
168
|
+
getStringAsync().then(setText);
|
|
169
|
+
}
|
|
170
|
+
refresh();
|
|
171
|
+
|
|
172
|
+
createEffect(() => {
|
|
173
|
+
if (clipboardEvent() !== null) refresh();
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const handleCopy = (input: string) => setStringAsync(input).then(refresh);
|
|
177
|
+
|
|
178
|
+
return <text>{text()}</text>;
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
129
182
|
```ts
|
|
130
183
|
// Angular
|
|
131
184
|
import { Component, Injector, effect, inject, signal } from '@angular/core';
|
|
@@ -163,6 +216,7 @@ export class ClipboardScreen {
|
|
|
163
216
|
|
|
164
217
|
These are trimmed from the real demo screens — `examples/expo-react/screens/ClipboardScreen.tsx`,
|
|
165
218
|
`examples/expo-vue-sfc/screens/ClipboardScreen.vue`, `examples/expo-vue-tsx/screens/ClipboardScreen.tsx`,
|
|
219
|
+
`examples/expo-svelte/screens/ClipboardScreen.svelte`, `examples/expo-solid/screens/ClipboardScreen.tsx`,
|
|
166
220
|
`examples/expo-angular/src/screens/ClipboardScreen.ts` — which additionally show `hasStringAsync()`
|
|
167
221
|
status badges and, iOS-only, the `getUrlAsync`/`setUrlAsync`/`hasUrlAsync` URL surface.
|
|
168
222
|
|
|
@@ -224,6 +278,6 @@ is a pure async-function + one-listener surface, never a view. Native rendering
|
|
|
224
278
|
on-device (see the parent [README](../../README.md) for the project's testing model).
|
|
225
279
|
|
|
226
280
|
Native autolinking wiring (Android's 3-layer registration, iOS Podfile/pod install) is done across
|
|
227
|
-
all
|
|
228
|
-
(`examples/react`, `examples/vue-sfc`, `examples/vue-tsx`, `examples/
|
|
229
|
-
depend on any `expo-modules-core` package today.
|
|
281
|
+
all six `examples/expo-*` canary apps. It isn't wired into the public non-Expo canaries
|
|
282
|
+
(`examples/react`, `examples/vue-sfc`, `examples/vue-tsx`, `examples/svelte`, `examples/solid`,
|
|
283
|
+
`examples/angular`) yet — those don't depend on any `expo-modules-core` package today.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/clipboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "expo-clipboard wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Reads and writes clipboard text, URLs, and images, plus a clipboard-change listener.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
"url": "https://github.com/OneEyed1366/symbiote-native/issues"
|
|
14
14
|
},
|
|
15
15
|
"author": "Andrey Prokopenko <psevdoproger@gmail.com>",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"react-native",
|
|
18
|
+
"symbiote-native",
|
|
19
|
+
"expo-clipboard",
|
|
20
|
+
"react",
|
|
21
|
+
"vue",
|
|
22
|
+
"svelte",
|
|
23
|
+
"solid",
|
|
24
|
+
"angular",
|
|
25
|
+
"clipboard",
|
|
26
|
+
"copy-paste"
|
|
27
|
+
],
|
|
16
28
|
"type": "module",
|
|
17
29
|
"main": "./build/core/index.js",
|
|
18
30
|
"module": "./build/core/index.js",
|
|
@@ -61,19 +73,19 @@
|
|
|
61
73
|
"expo-modules-core": "57.0.5"
|
|
62
74
|
},
|
|
63
75
|
"peerDependencies": {
|
|
64
|
-
"@symbiote-native/angular": ">=0.6.2",
|
|
65
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
66
|
-
"@symbiote-native/react": ">=0.2.8",
|
|
67
|
-
"@symbiote-native/solid": ">=0.0.1",
|
|
68
|
-
"@symbiote-native/svelte": ">=0.1.0",
|
|
69
|
-
"@symbiote-native/vue": ">=0.3.8",
|
|
70
76
|
"@angular/core": ">=20",
|
|
71
77
|
"@vue/runtime-core": "^3.5.13",
|
|
72
78
|
"react": ">=19.0.0",
|
|
73
79
|
"react-native": ">=0.86",
|
|
74
80
|
"solid-js": ">=1.9.0",
|
|
75
81
|
"svelte": ">=5.56.0",
|
|
76
|
-
"vue": ">=3.5.0"
|
|
82
|
+
"vue": ">=3.5.0",
|
|
83
|
+
"@symbiote-native/angular": "^2.0.0",
|
|
84
|
+
"@symbiote-native/engine": "^0.5.0",
|
|
85
|
+
"@symbiote-native/react": "^2.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^2.0.0",
|
|
87
|
+
"@symbiote-native/svelte": "^2.0.0",
|
|
88
|
+
"@symbiote-native/vue": "^2.0.0"
|
|
77
89
|
},
|
|
78
90
|
"peerDependenciesMeta": {
|
|
79
91
|
"@symbiote-native/angular": {
|
|
@@ -121,13 +133,13 @@
|
|
|
121
133
|
"solid-js": "^1.9.14",
|
|
122
134
|
"svelte": "^5.56.0",
|
|
123
135
|
"typescript": "~6.0.0",
|
|
124
|
-
"@symbiote-native/angular": "0.
|
|
125
|
-
"@symbiote-native/engine": "0.
|
|
126
|
-
"@symbiote-native/react": "0.
|
|
127
|
-
"@symbiote-native/solid": "0.
|
|
128
|
-
"@symbiote-native/svelte": "0.
|
|
129
|
-
"@symbiote-native/test-utils": "0.
|
|
130
|
-
"@symbiote-native/vue": "0.
|
|
136
|
+
"@symbiote-native/angular": "2.0.0",
|
|
137
|
+
"@symbiote-native/engine": "0.5.0",
|
|
138
|
+
"@symbiote-native/react": "2.0.0",
|
|
139
|
+
"@symbiote-native/solid": "2.0.0",
|
|
140
|
+
"@symbiote-native/svelte": "2.0.0",
|
|
141
|
+
"@symbiote-native/test-utils": "0.3.0",
|
|
142
|
+
"@symbiote-native/vue": "2.0.0"
|
|
131
143
|
},
|
|
132
144
|
"scripts": {
|
|
133
145
|
"typecheck": "tsc --build",
|