@contractspec/lib.image-gen 0.2.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/dist/browser/docs/generators.docblock.js +36 -0
- package/dist/browser/docs/image-gen.docblock.js +47 -0
- package/dist/browser/generators/image-generator.js +525 -0
- package/dist/browser/generators/index.js +527 -0
- package/dist/browser/generators/prompt-builder.js +93 -0
- package/dist/browser/generators/style-resolver.js +90 -0
- package/dist/browser/i18n/catalogs/en.js +85 -0
- package/dist/browser/i18n/catalogs/es.js +85 -0
- package/dist/browser/i18n/catalogs/fr.js +85 -0
- package/dist/browser/i18n/catalogs/index.js +253 -0
- package/dist/browser/i18n/index.js +309 -0
- package/dist/browser/i18n/keys.js +33 -0
- package/dist/browser/i18n/locale.js +13 -0
- package/dist/browser/i18n/messages.js +265 -0
- package/dist/browser/index.js +623 -0
- package/dist/browser/presets/index.js +99 -0
- package/dist/browser/presets/marketing.js +35 -0
- package/dist/browser/presets/social.js +45 -0
- package/dist/browser/presets/video.js +25 -0
- package/dist/browser/types.js +5 -0
- package/dist/docs/generators.docblock.d.ts +1 -0
- package/dist/docs/generators.docblock.js +37 -0
- package/dist/docs/image-gen.docblock.d.ts +1 -0
- package/dist/docs/image-gen.docblock.js +48 -0
- package/dist/generators/image-generator.d.ts +12 -0
- package/dist/generators/image-generator.js +526 -0
- package/dist/generators/image-generator.test.d.ts +1 -0
- package/dist/generators/index.d.ts +4 -0
- package/dist/generators/index.js +528 -0
- package/dist/generators/prompt-builder.d.ts +21 -0
- package/dist/generators/prompt-builder.js +94 -0
- package/dist/generators/prompt-builder.test.d.ts +1 -0
- package/dist/generators/style-resolver.d.ts +9 -0
- package/dist/generators/style-resolver.js +91 -0
- package/dist/generators/style-resolver.test.d.ts +1 -0
- package/dist/i18n/catalogs/en.d.ts +8 -0
- package/dist/i18n/catalogs/en.js +86 -0
- package/dist/i18n/catalogs/es.d.ts +6 -0
- package/dist/i18n/catalogs/es.js +86 -0
- package/dist/i18n/catalogs/fr.d.ts +6 -0
- package/dist/i18n/catalogs/fr.js +86 -0
- package/dist/i18n/catalogs/index.d.ts +3 -0
- package/dist/i18n/catalogs/index.js +254 -0
- package/dist/i18n/i18n.test.d.ts +1 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.js +310 -0
- package/dist/i18n/keys.d.ts +78 -0
- package/dist/i18n/keys.js +34 -0
- package/dist/i18n/locale.d.ts +8 -0
- package/dist/i18n/locale.js +14 -0
- package/dist/i18n/messages.d.ts +14 -0
- package/dist/i18n/messages.js +266 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +624 -0
- package/dist/node/docs/generators.docblock.js +36 -0
- package/dist/node/docs/image-gen.docblock.js +47 -0
- package/dist/node/generators/image-generator.js +525 -0
- package/dist/node/generators/index.js +527 -0
- package/dist/node/generators/prompt-builder.js +93 -0
- package/dist/node/generators/style-resolver.js +90 -0
- package/dist/node/i18n/catalogs/en.js +85 -0
- package/dist/node/i18n/catalogs/es.js +85 -0
- package/dist/node/i18n/catalogs/fr.js +85 -0
- package/dist/node/i18n/catalogs/index.js +253 -0
- package/dist/node/i18n/index.js +309 -0
- package/dist/node/i18n/keys.js +33 -0
- package/dist/node/i18n/locale.js +13 -0
- package/dist/node/i18n/messages.js +265 -0
- package/dist/node/index.js +623 -0
- package/dist/node/presets/index.js +99 -0
- package/dist/node/presets/marketing.js +35 -0
- package/dist/node/presets/social.js +45 -0
- package/dist/node/presets/video.js +25 -0
- package/dist/node/types.js +5 -0
- package/dist/presets/index.d.ts +3 -0
- package/dist/presets/index.js +100 -0
- package/dist/presets/marketing.d.ts +8 -0
- package/dist/presets/marketing.js +36 -0
- package/dist/presets/presets.test.d.ts +1 -0
- package/dist/presets/social.d.ts +10 -0
- package/dist/presets/social.js +46 -0
- package/dist/presets/video.d.ts +6 -0
- package/dist/presets/video.js +26 -0
- package/dist/types.d.ts +56 -0
- package/dist/types.js +6 -0
- package/package.json +394 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
3
|
+
// src/presets/social.ts
|
|
4
|
+
function ogImageBrief(content) {
|
|
5
|
+
return {
|
|
6
|
+
content,
|
|
7
|
+
purpose: "social-og",
|
|
8
|
+
dimensions: IMAGE_PRESETS.ogImage,
|
|
9
|
+
format: "png",
|
|
10
|
+
style: "photorealistic"
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function twitterCardBrief(content) {
|
|
14
|
+
return {
|
|
15
|
+
content,
|
|
16
|
+
purpose: "social-twitter",
|
|
17
|
+
dimensions: IMAGE_PRESETS.twitterCard,
|
|
18
|
+
format: "png",
|
|
19
|
+
style: "photorealistic"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function instagramSquareBrief(content) {
|
|
23
|
+
return {
|
|
24
|
+
content,
|
|
25
|
+
purpose: "social-instagram",
|
|
26
|
+
dimensions: IMAGE_PRESETS.instagramSquare,
|
|
27
|
+
format: "jpg",
|
|
28
|
+
style: "photorealistic"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function instagramStoryBrief(content) {
|
|
32
|
+
return {
|
|
33
|
+
content,
|
|
34
|
+
purpose: "social-instagram",
|
|
35
|
+
dimensions: IMAGE_PRESETS.instagramStory,
|
|
36
|
+
format: "jpg",
|
|
37
|
+
style: "photorealistic"
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/presets/marketing.ts
|
|
42
|
+
function blogHeroBrief(content) {
|
|
43
|
+
return {
|
|
44
|
+
content,
|
|
45
|
+
purpose: "blog-hero",
|
|
46
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
47
|
+
format: "webp",
|
|
48
|
+
style: "photorealistic"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function landingHeroBrief(content) {
|
|
52
|
+
return {
|
|
53
|
+
content,
|
|
54
|
+
purpose: "landing-hero",
|
|
55
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
56
|
+
format: "webp",
|
|
57
|
+
style: "photorealistic"
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function emailHeaderBrief(content) {
|
|
61
|
+
return {
|
|
62
|
+
content,
|
|
63
|
+
purpose: "email-header",
|
|
64
|
+
dimensions: IMAGE_PRESETS.emailHeader,
|
|
65
|
+
format: "png",
|
|
66
|
+
style: "flat-design"
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/presets/video.ts
|
|
71
|
+
function videoThumbnailBrief(content) {
|
|
72
|
+
return {
|
|
73
|
+
content,
|
|
74
|
+
purpose: "video-thumbnail",
|
|
75
|
+
dimensions: IMAGE_PRESETS.thumbnail,
|
|
76
|
+
format: "png",
|
|
77
|
+
style: "photorealistic"
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function videoThumbnailWideBrief(content) {
|
|
81
|
+
return {
|
|
82
|
+
content,
|
|
83
|
+
purpose: "video-thumbnail",
|
|
84
|
+
dimensions: { width: 1280, height: 720 },
|
|
85
|
+
format: "png",
|
|
86
|
+
style: "photorealistic"
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
videoThumbnailWideBrief,
|
|
91
|
+
videoThumbnailBrief,
|
|
92
|
+
twitterCardBrief,
|
|
93
|
+
ogImageBrief,
|
|
94
|
+
landingHeroBrief,
|
|
95
|
+
instagramStoryBrief,
|
|
96
|
+
instagramSquareBrief,
|
|
97
|
+
emailHeaderBrief,
|
|
98
|
+
blogHeroBrief
|
|
99
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
3
|
+
// src/presets/marketing.ts
|
|
4
|
+
function blogHeroBrief(content) {
|
|
5
|
+
return {
|
|
6
|
+
content,
|
|
7
|
+
purpose: "blog-hero",
|
|
8
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
9
|
+
format: "webp",
|
|
10
|
+
style: "photorealistic"
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function landingHeroBrief(content) {
|
|
14
|
+
return {
|
|
15
|
+
content,
|
|
16
|
+
purpose: "landing-hero",
|
|
17
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
18
|
+
format: "webp",
|
|
19
|
+
style: "photorealistic"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function emailHeaderBrief(content) {
|
|
23
|
+
return {
|
|
24
|
+
content,
|
|
25
|
+
purpose: "email-header",
|
|
26
|
+
dimensions: IMAGE_PRESETS.emailHeader,
|
|
27
|
+
format: "png",
|
|
28
|
+
style: "flat-design"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
landingHeroBrief,
|
|
33
|
+
emailHeaderBrief,
|
|
34
|
+
blogHeroBrief
|
|
35
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
3
|
+
// src/presets/social.ts
|
|
4
|
+
function ogImageBrief(content) {
|
|
5
|
+
return {
|
|
6
|
+
content,
|
|
7
|
+
purpose: "social-og",
|
|
8
|
+
dimensions: IMAGE_PRESETS.ogImage,
|
|
9
|
+
format: "png",
|
|
10
|
+
style: "photorealistic"
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function twitterCardBrief(content) {
|
|
14
|
+
return {
|
|
15
|
+
content,
|
|
16
|
+
purpose: "social-twitter",
|
|
17
|
+
dimensions: IMAGE_PRESETS.twitterCard,
|
|
18
|
+
format: "png",
|
|
19
|
+
style: "photorealistic"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function instagramSquareBrief(content) {
|
|
23
|
+
return {
|
|
24
|
+
content,
|
|
25
|
+
purpose: "social-instagram",
|
|
26
|
+
dimensions: IMAGE_PRESETS.instagramSquare,
|
|
27
|
+
format: "jpg",
|
|
28
|
+
style: "photorealistic"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function instagramStoryBrief(content) {
|
|
32
|
+
return {
|
|
33
|
+
content,
|
|
34
|
+
purpose: "social-instagram",
|
|
35
|
+
dimensions: IMAGE_PRESETS.instagramStory,
|
|
36
|
+
format: "jpg",
|
|
37
|
+
style: "photorealistic"
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
twitterCardBrief,
|
|
42
|
+
ogImageBrief,
|
|
43
|
+
instagramStoryBrief,
|
|
44
|
+
instagramSquareBrief
|
|
45
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
3
|
+
// src/presets/video.ts
|
|
4
|
+
function videoThumbnailBrief(content) {
|
|
5
|
+
return {
|
|
6
|
+
content,
|
|
7
|
+
purpose: "video-thumbnail",
|
|
8
|
+
dimensions: IMAGE_PRESETS.thumbnail,
|
|
9
|
+
format: "png",
|
|
10
|
+
style: "photorealistic"
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function videoThumbnailWideBrief(content) {
|
|
14
|
+
return {
|
|
15
|
+
content,
|
|
16
|
+
purpose: "video-thumbnail",
|
|
17
|
+
dimensions: { width: 1280, height: 720 },
|
|
18
|
+
format: "png",
|
|
19
|
+
style: "photorealistic"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
videoThumbnailWideBrief,
|
|
24
|
+
videoThumbnailBrief
|
|
25
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/types.ts
|
|
3
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
4
|
+
// src/presets/social.ts
|
|
5
|
+
function ogImageBrief(content) {
|
|
6
|
+
return {
|
|
7
|
+
content,
|
|
8
|
+
purpose: "social-og",
|
|
9
|
+
dimensions: IMAGE_PRESETS.ogImage,
|
|
10
|
+
format: "png",
|
|
11
|
+
style: "photorealistic"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function twitterCardBrief(content) {
|
|
15
|
+
return {
|
|
16
|
+
content,
|
|
17
|
+
purpose: "social-twitter",
|
|
18
|
+
dimensions: IMAGE_PRESETS.twitterCard,
|
|
19
|
+
format: "png",
|
|
20
|
+
style: "photorealistic"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function instagramSquareBrief(content) {
|
|
24
|
+
return {
|
|
25
|
+
content,
|
|
26
|
+
purpose: "social-instagram",
|
|
27
|
+
dimensions: IMAGE_PRESETS.instagramSquare,
|
|
28
|
+
format: "jpg",
|
|
29
|
+
style: "photorealistic"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function instagramStoryBrief(content) {
|
|
33
|
+
return {
|
|
34
|
+
content,
|
|
35
|
+
purpose: "social-instagram",
|
|
36
|
+
dimensions: IMAGE_PRESETS.instagramStory,
|
|
37
|
+
format: "jpg",
|
|
38
|
+
style: "photorealistic"
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/presets/marketing.ts
|
|
43
|
+
function blogHeroBrief(content) {
|
|
44
|
+
return {
|
|
45
|
+
content,
|
|
46
|
+
purpose: "blog-hero",
|
|
47
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
48
|
+
format: "webp",
|
|
49
|
+
style: "photorealistic"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function landingHeroBrief(content) {
|
|
53
|
+
return {
|
|
54
|
+
content,
|
|
55
|
+
purpose: "landing-hero",
|
|
56
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
57
|
+
format: "webp",
|
|
58
|
+
style: "photorealistic"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function emailHeaderBrief(content) {
|
|
62
|
+
return {
|
|
63
|
+
content,
|
|
64
|
+
purpose: "email-header",
|
|
65
|
+
dimensions: IMAGE_PRESETS.emailHeader,
|
|
66
|
+
format: "png",
|
|
67
|
+
style: "flat-design"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/presets/video.ts
|
|
72
|
+
function videoThumbnailBrief(content) {
|
|
73
|
+
return {
|
|
74
|
+
content,
|
|
75
|
+
purpose: "video-thumbnail",
|
|
76
|
+
dimensions: IMAGE_PRESETS.thumbnail,
|
|
77
|
+
format: "png",
|
|
78
|
+
style: "photorealistic"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function videoThumbnailWideBrief(content) {
|
|
82
|
+
return {
|
|
83
|
+
content,
|
|
84
|
+
purpose: "video-thumbnail",
|
|
85
|
+
dimensions: { width: 1280, height: 720 },
|
|
86
|
+
format: "png",
|
|
87
|
+
style: "photorealistic"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
videoThumbnailWideBrief,
|
|
92
|
+
videoThumbnailBrief,
|
|
93
|
+
twitterCardBrief,
|
|
94
|
+
ogImageBrief,
|
|
95
|
+
landingHeroBrief,
|
|
96
|
+
instagramStoryBrief,
|
|
97
|
+
instagramSquareBrief,
|
|
98
|
+
emailHeaderBrief,
|
|
99
|
+
blogHeroBrief
|
|
100
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ImageBrief } from '../types';
|
|
2
|
+
import type { ContentBrief } from '@contractspec/lib.content-gen/types';
|
|
3
|
+
/** Create a blog hero image brief from content. */
|
|
4
|
+
export declare function blogHeroBrief(content: ContentBrief): ImageBrief;
|
|
5
|
+
/** Create a landing page hero image brief from content. */
|
|
6
|
+
export declare function landingHeroBrief(content: ContentBrief): ImageBrief;
|
|
7
|
+
/** Create an email header image brief from content. */
|
|
8
|
+
export declare function emailHeaderBrief(content: ContentBrief): ImageBrief;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/types.ts
|
|
3
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
4
|
+
// src/presets/marketing.ts
|
|
5
|
+
function blogHeroBrief(content) {
|
|
6
|
+
return {
|
|
7
|
+
content,
|
|
8
|
+
purpose: "blog-hero",
|
|
9
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
10
|
+
format: "webp",
|
|
11
|
+
style: "photorealistic"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function landingHeroBrief(content) {
|
|
15
|
+
return {
|
|
16
|
+
content,
|
|
17
|
+
purpose: "landing-hero",
|
|
18
|
+
dimensions: IMAGE_PRESETS.blogHero,
|
|
19
|
+
format: "webp",
|
|
20
|
+
style: "photorealistic"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function emailHeaderBrief(content) {
|
|
24
|
+
return {
|
|
25
|
+
content,
|
|
26
|
+
purpose: "email-header",
|
|
27
|
+
dimensions: IMAGE_PRESETS.emailHeader,
|
|
28
|
+
format: "png",
|
|
29
|
+
style: "flat-design"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
landingHeroBrief,
|
|
34
|
+
emailHeaderBrief,
|
|
35
|
+
blogHeroBrief
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ImageBrief } from '../types';
|
|
2
|
+
import type { ContentBrief } from '@contractspec/lib.content-gen/types';
|
|
3
|
+
/** Create an OG image brief from content. */
|
|
4
|
+
export declare function ogImageBrief(content: ContentBrief): ImageBrief;
|
|
5
|
+
/** Create a Twitter card image brief from content. */
|
|
6
|
+
export declare function twitterCardBrief(content: ContentBrief): ImageBrief;
|
|
7
|
+
/** Create an Instagram square image brief from content. */
|
|
8
|
+
export declare function instagramSquareBrief(content: ContentBrief): ImageBrief;
|
|
9
|
+
/** Create an Instagram story image brief from content. */
|
|
10
|
+
export declare function instagramStoryBrief(content: ContentBrief): ImageBrief;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/types.ts
|
|
3
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
4
|
+
// src/presets/social.ts
|
|
5
|
+
function ogImageBrief(content) {
|
|
6
|
+
return {
|
|
7
|
+
content,
|
|
8
|
+
purpose: "social-og",
|
|
9
|
+
dimensions: IMAGE_PRESETS.ogImage,
|
|
10
|
+
format: "png",
|
|
11
|
+
style: "photorealistic"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function twitterCardBrief(content) {
|
|
15
|
+
return {
|
|
16
|
+
content,
|
|
17
|
+
purpose: "social-twitter",
|
|
18
|
+
dimensions: IMAGE_PRESETS.twitterCard,
|
|
19
|
+
format: "png",
|
|
20
|
+
style: "photorealistic"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function instagramSquareBrief(content) {
|
|
24
|
+
return {
|
|
25
|
+
content,
|
|
26
|
+
purpose: "social-instagram",
|
|
27
|
+
dimensions: IMAGE_PRESETS.instagramSquare,
|
|
28
|
+
format: "jpg",
|
|
29
|
+
style: "photorealistic"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function instagramStoryBrief(content) {
|
|
33
|
+
return {
|
|
34
|
+
content,
|
|
35
|
+
purpose: "social-instagram",
|
|
36
|
+
dimensions: IMAGE_PRESETS.instagramStory,
|
|
37
|
+
format: "jpg",
|
|
38
|
+
style: "photorealistic"
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
twitterCardBrief,
|
|
43
|
+
ogImageBrief,
|
|
44
|
+
instagramStoryBrief,
|
|
45
|
+
instagramSquareBrief
|
|
46
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ImageBrief } from '../types';
|
|
2
|
+
import type { ContentBrief } from '@contractspec/lib.content-gen/types';
|
|
3
|
+
/** Create a video thumbnail image brief from content. */
|
|
4
|
+
export declare function videoThumbnailBrief(content: ContentBrief): ImageBrief;
|
|
5
|
+
/** Create a 16:9 video thumbnail brief from content. */
|
|
6
|
+
export declare function videoThumbnailWideBrief(content: ContentBrief): ImageBrief;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/types.ts
|
|
3
|
+
import { IMAGE_PRESETS } from "@contractspec/lib.contracts-integrations/integrations/providers/image";
|
|
4
|
+
// src/presets/video.ts
|
|
5
|
+
function videoThumbnailBrief(content) {
|
|
6
|
+
return {
|
|
7
|
+
content,
|
|
8
|
+
purpose: "video-thumbnail",
|
|
9
|
+
dimensions: IMAGE_PRESETS.thumbnail,
|
|
10
|
+
format: "png",
|
|
11
|
+
style: "photorealistic"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function videoThumbnailWideBrief(content) {
|
|
15
|
+
return {
|
|
16
|
+
content,
|
|
17
|
+
purpose: "video-thumbnail",
|
|
18
|
+
dimensions: { width: 1280, height: 720 },
|
|
19
|
+
format: "png",
|
|
20
|
+
style: "photorealistic"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
videoThumbnailWideBrief,
|
|
25
|
+
videoThumbnailBrief
|
|
26
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { LLMProvider } from '@contractspec/lib.contracts-integrations/integrations/providers/llm';
|
|
2
|
+
import type { ImageProvider, ImageDimensions, ImageFormat, ImageGenerationResult } from '@contractspec/lib.contracts-integrations/integrations/providers/image';
|
|
3
|
+
import { IMAGE_PRESETS } from '@contractspec/lib.contracts-integrations/integrations/providers/image';
|
|
4
|
+
import type { ContentBrief } from '@contractspec/lib.content-gen/types';
|
|
5
|
+
export type { ImageProvider, ImageDimensions, ImageFormat, ImageGenerationResult, };
|
|
6
|
+
export { IMAGE_PRESETS };
|
|
7
|
+
export interface ImageBrief {
|
|
8
|
+
content: ContentBrief;
|
|
9
|
+
purpose: ImagePurpose;
|
|
10
|
+
dimensions?: ImageDimensions;
|
|
11
|
+
format?: ImageFormat;
|
|
12
|
+
style?: ImageStyle;
|
|
13
|
+
brandColors?: BrandColorOverrides;
|
|
14
|
+
variants?: number;
|
|
15
|
+
locale?: string;
|
|
16
|
+
seed?: number;
|
|
17
|
+
}
|
|
18
|
+
export type ImagePurpose = 'blog-hero' | 'social-og' | 'social-twitter' | 'social-instagram' | 'landing-hero' | 'video-thumbnail' | 'email-header' | 'illustration' | 'icon';
|
|
19
|
+
export type ImageStyle = 'photorealistic' | 'illustration' | '3d-render' | 'flat-design' | 'abstract' | 'minimalist' | 'branded';
|
|
20
|
+
export interface BrandColorOverrides {
|
|
21
|
+
primary?: string;
|
|
22
|
+
accent?: string;
|
|
23
|
+
background?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ImageGeneratorOptions {
|
|
26
|
+
llm?: LLMProvider;
|
|
27
|
+
image?: ImageProvider;
|
|
28
|
+
model?: string;
|
|
29
|
+
temperature?: number;
|
|
30
|
+
locale?: string;
|
|
31
|
+
defaultStyle?: ImageStyle;
|
|
32
|
+
/** Injectable clock for deterministic testing. Defaults to `Date`. */
|
|
33
|
+
clock?: {
|
|
34
|
+
now(): number;
|
|
35
|
+
toISOString(): string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface ImageProject {
|
|
39
|
+
id: string;
|
|
40
|
+
prompt: ImagePrompt;
|
|
41
|
+
results?: ImageGenerationResult;
|
|
42
|
+
metadata: ImageProjectMetadata;
|
|
43
|
+
}
|
|
44
|
+
export interface ImagePrompt {
|
|
45
|
+
text: string;
|
|
46
|
+
negativeText?: string;
|
|
47
|
+
style: ImageStyle;
|
|
48
|
+
dimensions: ImageDimensions;
|
|
49
|
+
format: ImageFormat;
|
|
50
|
+
}
|
|
51
|
+
export interface ImageProjectMetadata {
|
|
52
|
+
purpose: ImagePurpose;
|
|
53
|
+
title: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
locale: string;
|
|
56
|
+
}
|