@econ-v1/ports 7.0.7 → 7.0.9
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/dist/clipboard.d.ts +12 -0
- package/dist/clipboard.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/clipboard.js +12 -0
package/dist/clipboard.d.ts
CHANGED
|
@@ -34,8 +34,20 @@
|
|
|
34
34
|
* adapter, or any caller — it is a secret in the invitation-code call site (see
|
|
35
35
|
* `identify-invitation.ts`'s own security note) and must flow straight from the browser API
|
|
36
36
|
* into the caller's live `<input>.value`, nowhere else.
|
|
37
|
+
* `writeText()` is the mirror image and obeys the same never-reject rule, resolving `false`
|
|
38
|
+
* on ANY failure — no Clipboard API, no write permission, an insecure context, or the write
|
|
39
|
+
* itself rejecting. It backs the profile node card's copyable identity and build values
|
|
40
|
+
* (`stages/profile/behavior/profile.js` emits `nodeos:profile-about-copy`; `app-shell.js`'s
|
|
41
|
+
* `#onProfileAboutCopy` does the writing), which is why a write seam exists here at all: the
|
|
42
|
+
* design drop is forbidden to touch a platform API, so the host owns the clipboard call.
|
|
43
|
+
* A boolean rather than `void` so a caller that wants to confirm the copy can, without any
|
|
44
|
+
* caller being forced to; nothing may throw at a call site whose only job is a copy button.
|
|
45
|
+
*
|
|
46
|
+
* The written text is subject to the same never-retained rule as the read text: it flows from
|
|
47
|
+
* the caller into the browser API and is held nowhere else.
|
|
37
48
|
*/
|
|
38
49
|
export type ClipboardPort = {
|
|
39
50
|
readText: () => Promise<string | undefined>;
|
|
51
|
+
writeText: (text: string) => Promise<boolean>;
|
|
40
52
|
};
|
|
41
53
|
//# sourceMappingURL=clipboard.d.ts.map
|
package/dist/clipboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../src/clipboard.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../src/clipboard.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkDc,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;eACjC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
package/src/clipboard.js
CHANGED
|
@@ -36,6 +36,18 @@ export {};
|
|
|
36
36
|
* adapter, or any caller — it is a secret in the invitation-code call site (see
|
|
37
37
|
* `identify-invitation.ts`'s own security note) and must flow straight from the browser API
|
|
38
38
|
* into the caller's live `<input>.value`, nowhere else.
|
|
39
|
+
* `writeText()` is the mirror image and obeys the same never-reject rule, resolving `false`
|
|
40
|
+
* on ANY failure — no Clipboard API, no write permission, an insecure context, or the write
|
|
41
|
+
* itself rejecting. It backs the profile node card's copyable identity and build values
|
|
42
|
+
* (`stages/profile/behavior/profile.js` emits `nodeos:profile-about-copy`; `app-shell.js`'s
|
|
43
|
+
* `#onProfileAboutCopy` does the writing), which is why a write seam exists here at all: the
|
|
44
|
+
* design drop is forbidden to touch a platform API, so the host owns the clipboard call.
|
|
45
|
+
* A boolean rather than `void` so a caller that wants to confirm the copy can, without any
|
|
46
|
+
* caller being forced to; nothing may throw at a call site whose only job is a copy button.
|
|
47
|
+
*
|
|
48
|
+
* The written text is subject to the same never-retained rule as the read text: it flows from
|
|
49
|
+
* the caller into the browser API and is held nowhere else.
|
|
39
50
|
* @typedef {object} ClipboardPort
|
|
40
51
|
* @property {() => Promise<string | undefined>} readText
|
|
52
|
+
* @property {(text: string) => Promise<boolean>} writeText
|
|
41
53
|
*/
|