@civitai/blocks-react 0.67.0 → 0.67.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
|
@@ -1249,11 +1249,35 @@ neither an image nor an error. If no reply arrives within 10 minutes it
|
|
|
1249
1249
|
rejects with a `RequestTimeoutError`; the host may still have stored the
|
|
1250
1250
|
image, so retrying after a timeout can create a duplicate.
|
|
1251
1251
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1252
|
+
The hook ships in `@civitai/blocks-react` 0.67.0, and the `bytes` payload type
|
|
1253
|
+
it sends is in `@civitai/app-sdk` 0.62.0.
|
|
1254
|
+
|
|
1255
|
+
What the upload does and does not give you on civitai.com:
|
|
1256
|
+
|
|
1257
|
+
- 🔴 **Generation metadata embedded in the file is not read.** The posted
|
|
1258
|
+
image has no generation details (prompt, resources, sampler settings),
|
|
1259
|
+
whatever the PNG or JPEG carries. In the example below the healed pixels are
|
|
1260
|
+
posted, and the metadata the app repaired is not shown on the post.
|
|
1261
|
+
- 🔴 **Each uploaded image goes into exactly one post.** Once a post holds it,
|
|
1262
|
+
`createPost()` refuses that `imageId` with `an image is not available to post`.
|
|
1263
|
+
To post the same picture again, upload it again.
|
|
1264
|
+
- **An uploaded image never appears in `useGatedImages()`.** That read returns
|
|
1265
|
+
only what the app published with `usePublishGenerationOutputs()`. Keep the
|
|
1266
|
+
`imageId` and `url` that `upload` resolves with if you need to show it.
|
|
1267
|
+
- **A post holds at most 20 images and names at most 10 sources.** Past 20
|
|
1268
|
+
images the server refuses with `a post may contain at most 20 images`.
|
|
1269
|
+
- **Posting from apps is still being rolled out.** A viewer who does not have it
|
|
1270
|
+
yet is refused with `posting from apps is not enabled`, and the refusal
|
|
1271
|
+
arrives from `upload` as well as from `createPost()`. Handle it as an
|
|
1272
|
+
ordinary error branch, not as a bug in your app.
|
|
1273
|
+
- **Creating the post needs an account with a verified email or a linked
|
|
1274
|
+
sign-in provider.** Other account checks apply too: onboarding must be
|
|
1275
|
+
finished, the account must not be brand new, and it must not be muted or
|
|
1276
|
+
banned. `upload` refuses a banned account but checks none of the rest, so a
|
|
1277
|
+
viewer can upload and then be refused at `createPost()`.
|
|
1278
|
+
- **Server-side limits also apply**, to the upload and to the post, beyond the
|
|
1279
|
+
host's per-page window above. A `busy` reply or a rate-limit error such as
|
|
1280
|
+
`Rate limit exceeded, please retry shortly.` means wait and retry.
|
|
1257
1281
|
|
|
1258
1282
|
```tsx
|
|
1259
1283
|
import {
|
|
@@ -62,12 +62,8 @@ export interface UseUploadImageBytes {
|
|
|
62
62
|
* - The buffer is COPIED across `postMessage`, never transferred, so the block
|
|
63
63
|
* can keep displaying it. Pass an `ArrayBuffer` (`await blob.arrayBuffer()`),
|
|
64
64
|
* not a `Blob` or a typed array, which the host refuses.
|
|
65
|
-
* -
|
|
66
|
-
*
|
|
67
|
-
* `the host returned no uploaded image` on a dismiss. It needs
|
|
68
|
-
* civitai/civitai#5639 merged and deployed to civitai.com; that PR is still
|
|
69
|
-
* changing, so no intermediate head of it is enough. Do not ship a block
|
|
70
|
-
* relying on this before then.
|
|
65
|
+
* - Ships in `@civitai/blocks-react` 0.67.0; the `bytes` payload type it sends
|
|
66
|
+
* is in `@civitai/app-sdk` 0.62.0.
|
|
71
67
|
*
|
|
72
68
|
* Under `createMockHost` / `Harness` the host's admission rules are modelled
|
|
73
69
|
* (see `MockHostOptions.uploadImageBytesResult`). `dev:live` has no bytes
|
|
@@ -28,12 +28,8 @@ export const UPLOAD_IMAGE_BYTES_NO_IMAGE_ERROR = 'the host returned no uploaded
|
|
|
28
28
|
* - The buffer is COPIED across `postMessage`, never transferred, so the block
|
|
29
29
|
* can keep displaying it. Pass an `ArrayBuffer` (`await blob.arrayBuffer()`),
|
|
30
30
|
* not a `Blob` or a typed array, which the host refuses.
|
|
31
|
-
* -
|
|
32
|
-
*
|
|
33
|
-
* `the host returned no uploaded image` on a dismiss. It needs
|
|
34
|
-
* civitai/civitai#5639 merged and deployed to civitai.com; that PR is still
|
|
35
|
-
* changing, so no intermediate head of it is enough. Do not ship a block
|
|
36
|
-
* relying on this before then.
|
|
31
|
+
* - Ships in `@civitai/blocks-react` 0.67.0; the `bytes` payload type it sends
|
|
32
|
+
* is in `@civitai/app-sdk` 0.62.0.
|
|
37
33
|
*
|
|
38
34
|
* Under `createMockHost` / `Harness` the host's admission rules are modelled
|
|
39
35
|
* (see `MockHostOptions.uploadImageBytesResult`). `dev:live` has no bytes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civitai/blocks-react",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.1",
|
|
4
4
|
"description": "React hooks and iframe transport for Civitai Apps. Pairs with @civitai/app-sdk/blocks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"node": ">=20"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@civitai/
|
|
41
|
-
"@civitai/
|
|
40
|
+
"@civitai/theme": "^0.5.2",
|
|
41
|
+
"@civitai/components": "^0.9.3"
|
|
42
42
|
},
|
|
43
43
|
"comment-peerDependencies": "This floor is DERIVED, not chosen — the lowest published app-sdk that exports every symbol this package imports. Do not edit it without reading ./PEER_FLOOR.md (in-repo, unpublished) and tests/guards/blocks-react-peer-floor.test.mjs.",
|
|
44
44
|
"peerDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"typescript": "^5.9.2",
|
|
59
59
|
"vite": "^8.0.14",
|
|
60
60
|
"vitest": "^4.1.11",
|
|
61
|
-
"@civitai/app-sdk": "^0.
|
|
61
|
+
"@civitai/app-sdk": "^0.63.0"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|