@vibes.diy/use-vibes-types 0.19.8-dev → 0.19.14-dev-cli
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 +27 -27
- package/image-gen-types.d.ts +4 -4
- package/index.d.ts +3 -3
- package/index.js +2 -2
- package/package.json +8 -3
- package/vibes-gen-types.d.ts +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ pnpm add use-vibes
|
|
|
11
11
|
## Basic Usage
|
|
12
12
|
|
|
13
13
|
```jsx
|
|
14
|
-
import { ImgGen } from
|
|
14
|
+
import { ImgGen } from "use-vibes";
|
|
15
15
|
|
|
16
16
|
function MyComponent() {
|
|
17
17
|
// You can use ImgGen without any props - it includes its own form UI
|
|
@@ -25,10 +25,10 @@ function MyComponent() {
|
|
|
25
25
|
For image manipulation using base64 data:
|
|
26
26
|
|
|
27
27
|
```jsx
|
|
28
|
-
import { base64ToFile } from
|
|
28
|
+
import { base64ToFile } from "use-vibes";
|
|
29
29
|
|
|
30
30
|
// Convert API response to a File object
|
|
31
|
-
const imageFile = base64ToFile(imageResponse.data[0].b64_json,
|
|
31
|
+
const imageFile = base64ToFile(imageResponse.data[0].b64_json, "my-image.png");
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## Core Features
|
|
@@ -91,7 +91,7 @@ const imageFile = base64ToFile(imageResponse.data[0].b64_json, 'my-image.png');
|
|
|
91
91
|
- **Image Quality Control**: Set quality levels for output images
|
|
92
92
|
|
|
93
93
|
```jsx
|
|
94
|
-
<ImgGen prompt="Detailed artwork" options={{ quality:
|
|
94
|
+
<ImgGen prompt="Detailed artwork" options={{ quality: "high" }} />
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
- **Image Editing with Uploads**: Process existing images with AI
|
|
@@ -127,7 +127,7 @@ const imageFile = base64ToFile(imageResponse.data[0].b64_json, 'my-image.png');
|
|
|
127
127
|
<ImgGen
|
|
128
128
|
prompt="Test error handling"
|
|
129
129
|
onError={(error) => {
|
|
130
|
-
console.error(
|
|
130
|
+
console.error("Generation failed:", error.message);
|
|
131
131
|
}}
|
|
132
132
|
/>
|
|
133
133
|
```
|
|
@@ -142,10 +142,10 @@ const imageFile = base64ToFile(imageResponse.data[0].b64_json, 'my-image.png');
|
|
|
142
142
|
- **Base64 Conversion**: Convert between base64 and File objects
|
|
143
143
|
|
|
144
144
|
```jsx
|
|
145
|
-
import { base64ToFile } from
|
|
145
|
+
import { base64ToFile } from "use-vibes";
|
|
146
146
|
|
|
147
147
|
// Convert API response to a File object
|
|
148
|
-
const imageFile = base64ToFile(imageResponse.data[0].b64_json,
|
|
148
|
+
const imageFile = base64ToFile(imageResponse.data[0].b64_json, "my-image.png");
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
## Integration Features
|
|
@@ -156,8 +156,8 @@ const imageFile = base64ToFile(imageResponse.data[0].b64_json, 'my-image.png');
|
|
|
156
156
|
```jsx
|
|
157
157
|
<ImgGen
|
|
158
158
|
prompt="Track this generation"
|
|
159
|
-
onComplete={() => console.log(
|
|
160
|
-
onError={(error) => console.error(
|
|
159
|
+
onComplete={() => console.log("Generation complete!")}
|
|
160
|
+
onError={(error) => console.error("Generation failed:", error)}
|
|
161
161
|
onDelete={(id) => console.log(`Document ${id} deleted`)}
|
|
162
162
|
onDocumentCreated={(id) => console.log(`New document created: ${id}`)}
|
|
163
163
|
/>
|
|
@@ -196,10 +196,10 @@ const imageFile = base64ToFile(imageResponse.data[0].b64_json, 'my-image.png');
|
|
|
196
196
|
<ImgGen
|
|
197
197
|
prompt="Styled component"
|
|
198
198
|
classes={{
|
|
199
|
-
root:
|
|
200
|
-
image:
|
|
201
|
-
overlay:
|
|
202
|
-
progress:
|
|
199
|
+
root: "my-custom-container",
|
|
200
|
+
image: "rounded-xl shadow-lg",
|
|
201
|
+
overlay: "bg-slate-800/70 text-white",
|
|
202
|
+
progress: "h-2 bg-green-500",
|
|
203
203
|
}}
|
|
204
204
|
/>
|
|
205
205
|
```
|
|
@@ -280,7 +280,7 @@ The ImgGen component uses inline styles with centralized theme constants, so **n
|
|
|
280
280
|
Add AI image generation to any React app with minimal code:
|
|
281
281
|
|
|
282
282
|
```jsx
|
|
283
|
-
import { ImgGen } from
|
|
283
|
+
import { ImgGen } from "use-vibes";
|
|
284
284
|
|
|
285
285
|
function MyComponent() {
|
|
286
286
|
return (
|
|
@@ -299,9 +299,9 @@ Configure image generation with the `options` prop:
|
|
|
299
299
|
<ImgGen
|
|
300
300
|
prompt="A detailed cityscape"
|
|
301
301
|
options={{
|
|
302
|
-
model:
|
|
303
|
-
quality:
|
|
304
|
-
size:
|
|
302
|
+
model: "gpt-image-1",
|
|
303
|
+
quality: "high",
|
|
304
|
+
size: "1024x1024",
|
|
305
305
|
debug: false,
|
|
306
306
|
}}
|
|
307
307
|
/>
|
|
@@ -369,7 +369,7 @@ The component supports one-click regeneration, preserving document history while
|
|
|
369
369
|
Set quality levels for output images:
|
|
370
370
|
|
|
371
371
|
```jsx
|
|
372
|
-
<ImgGen prompt="Detailed artwork" options={{ quality:
|
|
372
|
+
<ImgGen prompt="Detailed artwork" options={{ quality: "high" }} />
|
|
373
373
|
```
|
|
374
374
|
|
|
375
375
|
#### Image Editing with Uploads
|
|
@@ -407,8 +407,8 @@ Track the complete generation process with lifecycle events:
|
|
|
407
407
|
```jsx
|
|
408
408
|
<ImgGen
|
|
409
409
|
prompt="Track this generation"
|
|
410
|
-
onComplete={() => console.log(
|
|
411
|
-
onError={(error) => console.error(
|
|
410
|
+
onComplete={() => console.log("Generation complete!")}
|
|
411
|
+
onError={(error) => console.error("Generation failed:", error)}
|
|
412
412
|
onDelete={(id) => console.log(`Document ${id} deleted`)}
|
|
413
413
|
onDocumentCreated={(id) => console.log(`New document created: ${id}`)}
|
|
414
414
|
/>
|
|
@@ -437,10 +437,10 @@ The overlay includes:
|
|
|
437
437
|
Convert between base64 and File objects:
|
|
438
438
|
|
|
439
439
|
```jsx
|
|
440
|
-
import { base64ToFile } from
|
|
440
|
+
import { base64ToFile } from "use-vibes";
|
|
441
441
|
|
|
442
442
|
// Convert API response to a File object
|
|
443
|
-
const imageFile = base64ToFile(imageResponse.data[0].b64_json,
|
|
443
|
+
const imageFile = base64ToFile(imageResponse.data[0].b64_json, "my-image.png");
|
|
444
444
|
```
|
|
445
445
|
|
|
446
446
|
## Styling and Customization
|
|
@@ -457,11 +457,11 @@ For more granular control, provide a `classes` object with custom CSS classes fo
|
|
|
457
457
|
<ImgGen
|
|
458
458
|
prompt="Styled component"
|
|
459
459
|
classes={{
|
|
460
|
-
root:
|
|
461
|
-
image:
|
|
462
|
-
overlay:
|
|
463
|
-
progress:
|
|
464
|
-
button:
|
|
460
|
+
root: "my-custom-container",
|
|
461
|
+
image: "rounded-xl shadow-lg",
|
|
462
|
+
overlay: "bg-slate-800/70 text-white",
|
|
463
|
+
progress: "h-2 bg-green-500",
|
|
464
|
+
button: "hover:bg-blue-600",
|
|
465
465
|
}}
|
|
466
466
|
/>
|
|
467
467
|
```
|
package/image-gen-types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Database, DocWithId } from
|
|
2
|
-
import { ImageGenOptions, ImageResponse } from
|
|
1
|
+
import type { Database, DocWithId } from "@fireproof/use-fireproof";
|
|
2
|
+
import { ImageGenOptions, ImageResponse } from "call-ai";
|
|
3
3
|
export interface PromptEntry {
|
|
4
4
|
readonly text: string;
|
|
5
5
|
readonly created: number;
|
|
6
6
|
}
|
|
7
7
|
export interface ImageDocumentPlain {
|
|
8
8
|
readonly _rev?: string;
|
|
9
|
-
readonly type:
|
|
9
|
+
readonly type: "image";
|
|
10
10
|
readonly prompt?: string;
|
|
11
11
|
readonly prompts?: Record<string, PromptEntry>;
|
|
12
12
|
readonly created: number;
|
|
@@ -21,7 +21,7 @@ export interface VersionInfo {
|
|
|
21
21
|
readonly created: number;
|
|
22
22
|
readonly promptKey?: string;
|
|
23
23
|
}
|
|
24
|
-
export type GenerationPhase =
|
|
24
|
+
export type GenerationPhase = "idle" | "generating" | "complete" | "error";
|
|
25
25
|
export interface UseImageGenOptions {
|
|
26
26
|
readonly prompt: string;
|
|
27
27
|
readonly _id: string;
|
package/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface RuntimeError {
|
|
|
22
22
|
stack?: string;
|
|
23
23
|
reason?: string;
|
|
24
24
|
timestamp: string;
|
|
25
|
-
errorType?:
|
|
25
|
+
errorType?: "SyntaxError" | "ReferenceError" | "TypeError" | "DatabaseError" | "Other";
|
|
26
26
|
}
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
27
|
+
export * from "./vibes-gen-types.js";
|
|
28
|
+
export * from "./image-gen-types.js";
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./vibes-gen-types.js";
|
|
2
|
+
export * from "./image-gen-types.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/use-vibes-types",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.14-dev-cli",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core components and utilities for use-vibes (internal workspace package)",
|
|
6
6
|
"exports": {
|
|
@@ -11,8 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"@fireproof/core": "~0.24.12",
|
|
15
|
+
"@fireproof/core-keybag": "~0.24.12",
|
|
16
|
+
"@fireproof/core-runtime": "~0.24.12",
|
|
17
|
+
"@fireproof/core-types-base": "~0.24.12",
|
|
18
|
+
"@fireproof/core-types-protocols-cloud": "~0.24.12",
|
|
19
|
+
"@fireproof/use-fireproof": "~0.24.12",
|
|
20
|
+
"call-ai": "^0.19.14-dev-cli"
|
|
16
21
|
},
|
|
17
22
|
"peerDependencies": {
|
|
18
23
|
"react": ">=19.1.0"
|
package/vibes-gen-types.d.ts
CHANGED