@civitai/blocks-react 0.76.0 → 0.76.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 +1 -1
- package/dist/hooks/useUploadImageBytes.d.ts +1 -1
- package/dist/hooks/useUploadImageBytes.js +1 -1
- package/dist/internal/mockHost.d.ts +3 -2
- package/dist/internal/uploadBytes.d.ts +2 -2
- package/dist/internal/uploadBytes.js +2 -2
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2253,7 +2253,7 @@ render), with no picker, so the app can then post it. Returns `{ upload }`.
|
|
|
2253
2253
|
sniffed type, whatever `filename` says.
|
|
2254
2254
|
- **The cap is 40 MiB.** The hook refuses a larger buffer before sending it,
|
|
2255
2255
|
with the host's error `file exceeds the maximum upload size`. The host also
|
|
2256
|
-
allows at most
|
|
2256
|
+
allows at most 8 uploads and 80 MiB per 60 seconds per page, and replies
|
|
2257
2257
|
`busy` past that.
|
|
2258
2258
|
- **The upload is blocking.** The host replies once the image is scanned, so
|
|
2259
2259
|
allow for a wait of up to a few minutes. An image above the SFW ceiling or
|
|
@@ -58,7 +58,7 @@ export interface UseUploadImageBytes {
|
|
|
58
58
|
* scope, so ask for it first with `useRequestConsent()`: the upload runs
|
|
59
59
|
* before any `useCreatePostFromApp()` call that would otherwise prompt.
|
|
60
60
|
* - **Images only:** PNG, WebP or JPEG by magic bytes. The cap is 40 MiB, and
|
|
61
|
-
* the host also allows at most
|
|
61
|
+
* the host also allows at most 8 uploads and 80 MiB per 60 s per page.
|
|
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.
|
|
@@ -25,7 +25,7 @@ export const UPLOAD_IMAGE_BYTES_NO_IMAGE_ERROR = 'the host returned no uploaded
|
|
|
25
25
|
* scope, so ask for it first with `useRequestConsent()`: the upload runs
|
|
26
26
|
* before any `useCreatePostFromApp()` call that would otherwise prompt.
|
|
27
27
|
* - **Images only:** PNG, WebP or JPEG by magic bytes. The cap is 40 MiB, and
|
|
28
|
-
* the host also allows at most
|
|
28
|
+
* the host also allows at most 8 uploads and 80 MiB per 60 s per page.
|
|
29
29
|
* - The buffer is COPIED across `postMessage`, never transferred, so the block
|
|
30
30
|
* can keep displaying it. Pass an `ArrayBuffer` (`await blob.arrayBuffer()`),
|
|
31
31
|
* not a `Blob` or a typed array, which the host refuses.
|
|
@@ -1190,8 +1190,9 @@ export interface MockHostOptions {
|
|
|
1190
1190
|
* non-empty `ArrayBuffer`, or `purpose: 'generationSource'` →
|
|
1191
1191
|
* `invalid image-upload request`; over 40 MiB →
|
|
1192
1192
|
* `file exceeds the maximum upload size` (checked FIRST); a full rolling
|
|
1193
|
-
* window (
|
|
1194
|
-
* WebP / JPEG by magic bytes →
|
|
1193
|
+
* window (8 uploads or 80 MiB per 60 s, per mounted page host; here, per mock
|
|
1194
|
+
* instance) → `busy`; not PNG / WebP / JPEG by magic bytes →
|
|
1195
|
+
* `file type is not allowed`; then
|
|
1195
1196
|
* {@link uploadImageBytesError}, standing in for the server persist and the
|
|
1196
1197
|
* scan. 🔴 What the mock cannot model: that the variant is PAGE-ONLY, the
|
|
1197
1198
|
* `posts:write:self` scope check (force `block lacks posts:write:self scope`
|
|
@@ -21,8 +21,8 @@ import { type SniffedImageType } from './saveBytes.js';
|
|
|
21
21
|
* app-sdk peer.
|
|
22
22
|
*/
|
|
23
23
|
export declare const UPLOAD_BYTES_MAX_BYTES: number;
|
|
24
|
-
/** The host's rolling window: at most this many admitted uploads… */
|
|
25
|
-
export declare const UPLOAD_BYTES_MAX_PER_WINDOW =
|
|
24
|
+
/** The host's rolling window: at most this many admitted uploads (8 since civitai/civitai#5888)… */
|
|
25
|
+
export declare const UPLOAD_BYTES_MAX_PER_WINDOW = 8;
|
|
26
26
|
/** …and this many admitted bytes… */
|
|
27
27
|
export declare const UPLOAD_BYTES_MAX_BYTES_PER_WINDOW: number;
|
|
28
28
|
/** …per this many milliseconds, per mounted page host. */
|
|
@@ -21,8 +21,8 @@ import { forceSaveBytesExtension, sanitizeSaveBytesFilename, sniffImageBytes, }
|
|
|
21
21
|
* app-sdk peer.
|
|
22
22
|
*/
|
|
23
23
|
export const UPLOAD_BYTES_MAX_BYTES = 40 * 1024 * 1024;
|
|
24
|
-
/** The host's rolling window: at most this many admitted uploads… */
|
|
25
|
-
export const UPLOAD_BYTES_MAX_PER_WINDOW =
|
|
24
|
+
/** The host's rolling window: at most this many admitted uploads (8 since civitai/civitai#5888)… */
|
|
25
|
+
export const UPLOAD_BYTES_MAX_PER_WINDOW = 8;
|
|
26
26
|
/** …and this many admitted bytes… */
|
|
27
27
|
export const UPLOAD_BYTES_MAX_BYTES_PER_WINDOW = 2 * UPLOAD_BYTES_MAX_BYTES;
|
|
28
28
|
/** …per this many milliseconds, per mounted page host. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* AUTOGENERATED from package.json by scripts/gen-version.mjs. DO NOT EDIT. */
|
|
2
2
|
/** This package's version, reported to the host as `sdkVersion` in `BLOCK_READY`. */
|
|
3
|
-
export const VERSION = "0.76.
|
|
3
|
+
export const VERSION = "0.76.1";
|
|
4
4
|
//# sourceMappingURL=version.generated.js.map
|