@orangecatai/adgen-canvas 0.0.9 → 0.0.11
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/dev/{chunk-NAJI32NW.js → chunk-L2SRPAV4.js} +2 -2
- package/dist/dev/{chunk-NAJI32NW.js.map → chunk-L2SRPAV4.js.map} +1 -1
- package/dist/dev/{chunk-LMXW7R5C.js → chunk-WPLXSZYF.js} +3 -3
- package/dist/dev/data/{image-BF774COP.js → image-OGBTIAY6.js} +3 -3
- package/dist/dev/index.css +114 -0
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +3368 -1964
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-UX5BMIBN.js → chunk-CH6IVVSC.js} +2 -2
- package/dist/prod/{chunk-WHNMS6DF.js → chunk-JCRT6UGN.js} +1 -1
- package/dist/prod/data/image-5RHEPPT6.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +206 -68
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/components/AIChatPanel.d.ts +35 -0
- package/dist/types/excalidraw/components/ImageEditToolbar.d.ts +1 -0
- package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +23 -0
- package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +181 -0
- package/dist/types/excalidraw/components/ai-chat/reviewerAgent.d.ts +64 -0
- package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +8 -0
- package/dist/types/excalidraw/components/template-builder/TemplateBuilderPanelHost.d.ts +4 -0
- package/dist/types/excalidraw/components/template-builder/TemplateBuilderTray.d.ts +4 -0
- package/dist/types/excalidraw/components/template-builder/slotTypes.d.ts +43 -0
- package/dist/types/excalidraw/components/template-builder/templateBuilderStore.d.ts +19 -0
- package/dist/types/excalidraw/index.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +58 -0
- package/package.json +1 -1
- package/dist/prod/data/image-UMAJZASC.js +0 -1
- /package/dist/dev/{chunk-LMXW7R5C.js.map → chunk-WPLXSZYF.js.map} +0 -0
- /package/dist/dev/data/{image-BF774COP.js.map → image-OGBTIAY6.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-JCRT6UGN.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-JCRT6UGN.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type ToolAction } from "./ai-chat/agentLoop";
|
|
3
|
+
import type { ReviewerFeedback } from "./ai-chat/reviewerAgent";
|
|
3
4
|
import "./AIChatPanel.scss";
|
|
4
5
|
import type { ExcalidrawImperativeAPI } from "../types";
|
|
5
6
|
export type ChatMessage = {
|
|
@@ -13,6 +14,8 @@ export type ChatMessage = {
|
|
|
13
14
|
type: "image" | "text";
|
|
14
15
|
dataUrl?: string;
|
|
15
16
|
}>;
|
|
17
|
+
/** Reviewer feedback attached to an assistant message after HTML ad generation */
|
|
18
|
+
reviewFeedback?: ReviewerFeedback;
|
|
16
19
|
};
|
|
17
20
|
export type ChatSession = {
|
|
18
21
|
id: string;
|
|
@@ -78,5 +81,37 @@ export type AIChatPanelProps = {
|
|
|
78
81
|
* brand font files are also registered in the canvas.
|
|
79
82
|
*/
|
|
80
83
|
brandContext?: import("../types").BrandContext;
|
|
84
|
+
onSearchBrandAssets?: (query: string, type?: string) => Promise<Array<{
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
tags: string[];
|
|
88
|
+
assetType: string;
|
|
89
|
+
blobUrl: string;
|
|
90
|
+
}>>;
|
|
91
|
+
onListBrandTemplates?: (campaignTag?: string) => Promise<Array<{
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
campaignTag?: string;
|
|
95
|
+
variants: Array<{
|
|
96
|
+
id: string;
|
|
97
|
+
label: string;
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
thumbnailBlobUrl?: string;
|
|
101
|
+
}>;
|
|
102
|
+
}>>;
|
|
103
|
+
onGetTemplateVariant?: (variantId: string) => Promise<{
|
|
104
|
+
canvasJson: string;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* OpenRouter model tag for the reviewer agent. Must be vision-capable.
|
|
108
|
+
* Defaults to the same model as chatModel.
|
|
109
|
+
*/
|
|
110
|
+
reviewerModel?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Maximum number of reviewer rounds per banner before the reviewer is skipped.
|
|
113
|
+
* @default 2
|
|
114
|
+
*/
|
|
115
|
+
maxReviewRounds?: number;
|
|
81
116
|
};
|
|
82
117
|
export declare const AIChatPanel: React.ForwardRefExoticComponent<AIChatPanelProps & React.RefAttributes<AIChatPanelRef>>;
|
|
@@ -7,6 +7,7 @@ export interface ImageEditToolbarCallbacks {
|
|
|
7
7
|
onRemoveBG?: () => void;
|
|
8
8
|
onCrop?: () => void;
|
|
9
9
|
onDownload?: () => void;
|
|
10
|
+
onSwapAsset?: (elementId: string) => Promise<void>;
|
|
10
11
|
}
|
|
11
12
|
export declare const ImageEditToolbar: ({ element, app, callbacks, }: {
|
|
12
13
|
element: ExcalidrawImageElement & NonDeletedExcalidrawElement;
|
|
@@ -41,11 +41,22 @@ export type AgentUpdate = {
|
|
|
41
41
|
type: "status" | "tool_start" | "tool_done" | "final" | "content_delta";
|
|
42
42
|
message: string;
|
|
43
43
|
toolAction?: ToolAction;
|
|
44
|
+
} | {
|
|
45
|
+
type: "review_start";
|
|
46
|
+
message: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: "review_done";
|
|
49
|
+
message: string;
|
|
50
|
+
feedback: import("./reviewerAgent").ReviewerFeedback;
|
|
44
51
|
};
|
|
45
52
|
export type AgentResult = {
|
|
46
53
|
reply: string;
|
|
47
54
|
toolActions: ToolAction[];
|
|
48
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Converts a BrandContext object to a concise system message string.
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildBrandContextMessage(ctx: BrandContext): string;
|
|
49
60
|
export type FileAttachment = {
|
|
50
61
|
name: string;
|
|
51
62
|
type: "image" | "text";
|
|
@@ -84,5 +95,17 @@ export declare function runAgentLoop(opts: {
|
|
|
84
95
|
* Kept for API compatibility but no longer used internally.
|
|
85
96
|
*/
|
|
86
97
|
customFontIds?: number[];
|
|
98
|
+
/**
|
|
99
|
+
* OpenRouter model tag for the reviewer agent. Must be vision-capable.
|
|
100
|
+
* Defaults to the same model as chatModel.
|
|
101
|
+
*/
|
|
102
|
+
reviewerModel?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Maximum number of reviewer rounds per banner.
|
|
105
|
+
* After this many rounds the reviewer is skipped and the outer MAX_ITERATIONS
|
|
106
|
+
* cap handles loop termination.
|
|
107
|
+
* @default 2
|
|
108
|
+
*/
|
|
109
|
+
maxReviewRounds?: number;
|
|
87
110
|
}): Promise<AgentResult>;
|
|
88
111
|
export {};
|
|
@@ -436,6 +436,161 @@ export declare const BANNER_TOOLS: readonly [{
|
|
|
436
436
|
readonly additionalProperties: false;
|
|
437
437
|
};
|
|
438
438
|
};
|
|
439
|
+
}, {
|
|
440
|
+
readonly type: "function";
|
|
441
|
+
readonly function: {
|
|
442
|
+
readonly name: "search_brand_assets";
|
|
443
|
+
readonly description: "Search the brand asset bank for existing product shots, logos, and lifestyle images. ALWAYS call this before generate_image to check if a brand asset already exists.";
|
|
444
|
+
readonly parameters: {
|
|
445
|
+
readonly type: "object";
|
|
446
|
+
readonly properties: {
|
|
447
|
+
readonly query: {
|
|
448
|
+
readonly type: "string";
|
|
449
|
+
readonly description: "Search query — name or tag keywords";
|
|
450
|
+
};
|
|
451
|
+
readonly type: {
|
|
452
|
+
readonly type: "string";
|
|
453
|
+
readonly enum: readonly ["product", "logo", "lifestyle", "auxiliary"];
|
|
454
|
+
readonly description: "Optional filter by asset type";
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly required: readonly ["query"];
|
|
458
|
+
readonly additionalProperties: false;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
}, {
|
|
462
|
+
readonly type: "function";
|
|
463
|
+
readonly function: {
|
|
464
|
+
readonly name: "list_brand_templates";
|
|
465
|
+
readonly description: "List available brand templates. Call this when the user mentions a campaign, template, or asks for multiple sizes.";
|
|
466
|
+
readonly parameters: {
|
|
467
|
+
readonly type: "object";
|
|
468
|
+
readonly properties: {
|
|
469
|
+
readonly campaignTag: {
|
|
470
|
+
readonly type: "string";
|
|
471
|
+
readonly description: "Optional campaign tag to filter templates";
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
readonly required: readonly [];
|
|
475
|
+
readonly additionalProperties: false;
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
}, {
|
|
479
|
+
readonly type: "function";
|
|
480
|
+
readonly function: {
|
|
481
|
+
readonly name: "get_template_variant";
|
|
482
|
+
readonly description: "Fetch the full canvas JSON for a specific template by its ID.";
|
|
483
|
+
readonly parameters: {
|
|
484
|
+
readonly type: "object";
|
|
485
|
+
readonly properties: {
|
|
486
|
+
readonly variantId: {
|
|
487
|
+
readonly type: "string";
|
|
488
|
+
readonly description: "The template ID to fetch";
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
readonly required: readonly ["variantId"];
|
|
492
|
+
readonly additionalProperties: false;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
}, {
|
|
496
|
+
readonly type: "function";
|
|
497
|
+
readonly function: {
|
|
498
|
+
readonly name: "load_template_into_frame";
|
|
499
|
+
readonly description: "Load a template into an existing frame, replacing its contents with the template elements.";
|
|
500
|
+
readonly parameters: {
|
|
501
|
+
readonly type: "object";
|
|
502
|
+
readonly properties: {
|
|
503
|
+
readonly frameId: {
|
|
504
|
+
readonly type: "string";
|
|
505
|
+
readonly description: "The frame ID to load the template into";
|
|
506
|
+
};
|
|
507
|
+
readonly variantId: {
|
|
508
|
+
readonly type: "string";
|
|
509
|
+
readonly description: "The template ID to load (from list_brand_templates)";
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
readonly required: readonly ["frameId", "variantId"];
|
|
513
|
+
readonly additionalProperties: false;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
}, {
|
|
517
|
+
readonly type: "function";
|
|
518
|
+
readonly function: {
|
|
519
|
+
readonly name: "fill_template_slots";
|
|
520
|
+
readonly description: "Fill the slot elements inside a frame with content. Use this after load_template_into_frame to populate slots with actual content.";
|
|
521
|
+
readonly parameters: {
|
|
522
|
+
readonly type: "object";
|
|
523
|
+
readonly properties: {
|
|
524
|
+
readonly frameId: {
|
|
525
|
+
readonly type: "string";
|
|
526
|
+
readonly description: "The frame ID containing slot elements";
|
|
527
|
+
};
|
|
528
|
+
readonly headline: {
|
|
529
|
+
readonly type: "string";
|
|
530
|
+
readonly description: "Text for the headline slot";
|
|
531
|
+
};
|
|
532
|
+
readonly subhead: {
|
|
533
|
+
readonly type: "string";
|
|
534
|
+
readonly description: "Text for the subhead slot";
|
|
535
|
+
};
|
|
536
|
+
readonly cta: {
|
|
537
|
+
readonly type: "string";
|
|
538
|
+
readonly description: "Text for the CTA slot";
|
|
539
|
+
};
|
|
540
|
+
readonly signoff: {
|
|
541
|
+
readonly type: "string";
|
|
542
|
+
readonly description: "Text for the signoff slot";
|
|
543
|
+
};
|
|
544
|
+
readonly product_image_url: {
|
|
545
|
+
readonly type: "string";
|
|
546
|
+
readonly description: "URL for the product image slot (from search_brand_assets blobUrl, or a generated image data URL)";
|
|
547
|
+
};
|
|
548
|
+
readonly product_image_asset_id: {
|
|
549
|
+
readonly type: "string";
|
|
550
|
+
readonly description: "Asset ID for the product image (from search_brand_assets [id:...] field). Required when using a brand asset so the image can be swapped later.";
|
|
551
|
+
};
|
|
552
|
+
readonly logo_url: {
|
|
553
|
+
readonly type: "string";
|
|
554
|
+
readonly description: "URL for the logo slot (from search_brand_assets blobUrl)";
|
|
555
|
+
};
|
|
556
|
+
readonly logo_asset_id: {
|
|
557
|
+
readonly type: "string";
|
|
558
|
+
readonly description: "Asset ID for the logo (from search_brand_assets [id:...] field). Required when using a brand asset.";
|
|
559
|
+
};
|
|
560
|
+
readonly auxiliary_image_url: {
|
|
561
|
+
readonly type: "string";
|
|
562
|
+
readonly description: "URL for the auxiliary image slot";
|
|
563
|
+
};
|
|
564
|
+
readonly auxiliary_image_asset_id: {
|
|
565
|
+
readonly type: "string";
|
|
566
|
+
readonly description: "Asset ID for the auxiliary image (from search_brand_assets [id:...] field). Required when using a brand asset.";
|
|
567
|
+
};
|
|
568
|
+
readonly background_color: {
|
|
569
|
+
readonly type: "string";
|
|
570
|
+
readonly description: "Hex color (e.g. #000000) for the background slot";
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
readonly required: readonly ["frameId"];
|
|
574
|
+
readonly additionalProperties: false;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
}, {
|
|
578
|
+
readonly type: "function";
|
|
579
|
+
readonly function: {
|
|
580
|
+
readonly name: "finalize_ad";
|
|
581
|
+
readonly description: "Call this when ALL elements are placed on the canvas — brand assets, generated images, and the HTML text overlay. Captures a screenshot of the complete frame for review. Do NOT call this before all assets are in place.";
|
|
582
|
+
readonly parameters: {
|
|
583
|
+
readonly type: "object";
|
|
584
|
+
readonly properties: {
|
|
585
|
+
readonly frameId: {
|
|
586
|
+
readonly type: "string";
|
|
587
|
+
readonly description: "ID of the frame to capture for review";
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
readonly required: readonly ["frameId"];
|
|
591
|
+
readonly additionalProperties: false;
|
|
592
|
+
};
|
|
593
|
+
};
|
|
439
594
|
}];
|
|
440
595
|
export declare function serializeElements(elements: readonly ExcalidrawElement[]): Record<string, unknown>[];
|
|
441
596
|
export type FrameInfo = {
|
|
@@ -472,6 +627,32 @@ export type ToolExecutionContext = {
|
|
|
472
627
|
name: string;
|
|
473
628
|
dataUrl?: string;
|
|
474
629
|
}>;
|
|
630
|
+
onSearchBrandAssets?: (query: string, type?: string) => Promise<Array<{
|
|
631
|
+
id: string;
|
|
632
|
+
name: string;
|
|
633
|
+
tags: string[];
|
|
634
|
+
assetType: string;
|
|
635
|
+
blobUrl: string;
|
|
636
|
+
}>>;
|
|
637
|
+
onListBrandTemplates?: (campaignTag?: string) => Promise<Array<{
|
|
638
|
+
id: string;
|
|
639
|
+
name: string;
|
|
640
|
+
campaignTag?: string;
|
|
641
|
+
label?: string;
|
|
642
|
+
width?: number;
|
|
643
|
+
height?: number;
|
|
644
|
+
thumbnailBlobUrl?: string;
|
|
645
|
+
}>>;
|
|
646
|
+
onGetTemplateVariant?: (variantId: string) => Promise<{
|
|
647
|
+
canvasJson: string;
|
|
648
|
+
}>;
|
|
649
|
+
/**
|
|
650
|
+
* Internal cache: populated by execGetTemplateVariant so that
|
|
651
|
+
* execLoadTemplateIntoFrame can reuse the already-fetched JSON without a
|
|
652
|
+
* second round-trip. Avoids the "double fetch → silent {} fallback → crash"
|
|
653
|
+
* failure mode for private Vercel Blob URLs.
|
|
654
|
+
*/
|
|
655
|
+
_templateJsonCache?: Map<string, string>;
|
|
475
656
|
};
|
|
476
657
|
export type ToolResult = {
|
|
477
658
|
success: boolean;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* reviewerAgent.ts
|
|
3
|
+
*
|
|
4
|
+
* Stateless reviewer module. After generate_html_banner succeeds, this
|
|
5
|
+
* agent receives a partial, focused context (rendered screenshot, HTML
|
|
6
|
+
* source, frame dimensions, brand guidelines, original user brief) and
|
|
7
|
+
* returns precise layout/readability critique — NOT the full agent
|
|
8
|
+
* conversation history.
|
|
9
|
+
*
|
|
10
|
+
* The reviewer is a separate LLM call from the main agent loop so it
|
|
11
|
+
* brings an independent eye to the generated banner.
|
|
12
|
+
*/
|
|
13
|
+
import type { BrandContext } from "../../types";
|
|
14
|
+
export type ReviewIssue = {
|
|
15
|
+
/** Which design element is affected */
|
|
16
|
+
element: "headline" | "subheadline" | "cta" | "image" | "layout" | "brand";
|
|
17
|
+
/** How bad it is */
|
|
18
|
+
severity: "critical" | "major" | "minor";
|
|
19
|
+
/** What is wrong — one sentence */
|
|
20
|
+
problem: string;
|
|
21
|
+
/** One-line direction for the fix */
|
|
22
|
+
fix: string;
|
|
23
|
+
/**
|
|
24
|
+
* Precise instruction with numeric coordinates or px values.
|
|
25
|
+
* Examples:
|
|
26
|
+
* "Reduce headline font-size from 72px to 48px"
|
|
27
|
+
* "Move CTA button to x=380,y=440 (bottom-right quadrant)"
|
|
28
|
+
* "Shift text container left boundary from x=0 to x=20 so it clears the image at x=260"
|
|
29
|
+
*/
|
|
30
|
+
preciseInstruction: string;
|
|
31
|
+
};
|
|
32
|
+
export type ReviewerFeedback = {
|
|
33
|
+
/** true = no actionable issues; main agent should finalize */
|
|
34
|
+
approved: boolean;
|
|
35
|
+
/** empty when approved */
|
|
36
|
+
issues: ReviewIssue[];
|
|
37
|
+
/** 1-2 sentence overall verdict */
|
|
38
|
+
summary: string;
|
|
39
|
+
/** which reviewer round produced this (1-based) */
|
|
40
|
+
iteration: number;
|
|
41
|
+
};
|
|
42
|
+
export declare function runReviewerAgent(opts: {
|
|
43
|
+
screenshotDataUrl: string;
|
|
44
|
+
htmlSource: string;
|
|
45
|
+
frame: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
50
|
+
imagePlacement?: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
/** Original user request — first message only, not full conversation history */
|
|
57
|
+
userBrief: string;
|
|
58
|
+
brandContext?: BrandContext;
|
|
59
|
+
apiKey: string;
|
|
60
|
+
/** OpenRouter model tag. Must be vision-capable. Defaults to gemini-3.1-flash-lite-preview */
|
|
61
|
+
reviewerModel?: string;
|
|
62
|
+
signal?: AbortSignal;
|
|
63
|
+
iteration: number;
|
|
64
|
+
}): Promise<ReviewerFeedback>;
|
|
@@ -16,6 +16,8 @@ export type DimensionResult = {
|
|
|
16
16
|
export type ProgressCallback = (dimensionIndex: number, total: number, phase: "bg-regen" | "layout" | "inserting" | "done" | "error", label: string) => void;
|
|
17
17
|
type ForegroundEl = {
|
|
18
18
|
kind: "text";
|
|
19
|
+
elementId: string;
|
|
20
|
+
slotType?: string;
|
|
19
21
|
relX: number;
|
|
20
22
|
relY: number;
|
|
21
23
|
width: number;
|
|
@@ -28,6 +30,8 @@ type ForegroundEl = {
|
|
|
28
30
|
opacity: number;
|
|
29
31
|
} | {
|
|
30
32
|
kind: "image";
|
|
33
|
+
elementId: string;
|
|
34
|
+
slotType?: string;
|
|
31
35
|
relX: number;
|
|
32
36
|
relY: number;
|
|
33
37
|
width: number;
|
|
@@ -36,6 +40,8 @@ type ForegroundEl = {
|
|
|
36
40
|
opacity: number;
|
|
37
41
|
} | {
|
|
38
42
|
kind: "rect";
|
|
43
|
+
elementId: string;
|
|
44
|
+
slotType?: string;
|
|
39
45
|
relX: number;
|
|
40
46
|
relY: number;
|
|
41
47
|
width: number;
|
|
@@ -49,9 +55,11 @@ type SourceFrameInfo = {
|
|
|
49
55
|
background: {
|
|
50
56
|
type: "solid";
|
|
51
57
|
color: string;
|
|
58
|
+
elementId?: string;
|
|
52
59
|
} | {
|
|
53
60
|
type: "image";
|
|
54
61
|
dataUrl: string;
|
|
62
|
+
elementId?: string;
|
|
55
63
|
} | {
|
|
56
64
|
type: "none";
|
|
57
65
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const SLOT_TYPES: readonly [{
|
|
2
|
+
readonly id: "background";
|
|
3
|
+
readonly label: "Background";
|
|
4
|
+
readonly color: "#94a3b8";
|
|
5
|
+
readonly kind: "rect";
|
|
6
|
+
}, {
|
|
7
|
+
readonly id: "logo";
|
|
8
|
+
readonly label: "Logo";
|
|
9
|
+
readonly color: "#f97316";
|
|
10
|
+
readonly kind: "image";
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "product_image";
|
|
13
|
+
readonly label: "Product Image";
|
|
14
|
+
readonly color: "#22c55e";
|
|
15
|
+
readonly kind: "image";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "headline";
|
|
18
|
+
readonly label: "Headline";
|
|
19
|
+
readonly color: "#3b82f6";
|
|
20
|
+
readonly kind: "text";
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: "subhead";
|
|
23
|
+
readonly label: "Subhead";
|
|
24
|
+
readonly color: "#8b5cf6";
|
|
25
|
+
readonly kind: "text";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "cta";
|
|
28
|
+
readonly label: "CTA";
|
|
29
|
+
readonly color: "#ef4444";
|
|
30
|
+
readonly kind: "text";
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "signoff";
|
|
33
|
+
readonly label: "Signoff";
|
|
34
|
+
readonly color: "#64748b";
|
|
35
|
+
readonly kind: "text";
|
|
36
|
+
}, {
|
|
37
|
+
readonly id: "auxiliary_image";
|
|
38
|
+
readonly label: "Aux Image";
|
|
39
|
+
readonly color: "#14b8a6";
|
|
40
|
+
readonly kind: "image";
|
|
41
|
+
}];
|
|
42
|
+
export type SlotType = typeof SLOT_TYPES[number];
|
|
43
|
+
export type SlotTypeId = SlotType["id"];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type TemplateBuilderState = {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
isBuilding: boolean;
|
|
4
|
+
templateName: string;
|
|
5
|
+
campaignTag: string;
|
|
6
|
+
/** The frame element ID that triggered the template builder (set by FrameToolbar). */
|
|
7
|
+
sourceFrameId: string | null;
|
|
8
|
+
};
|
|
9
|
+
type Listener = (state: TemplateBuilderState) => void;
|
|
10
|
+
export declare const templateBuilderStore: {
|
|
11
|
+
open(sourceFrameId?: string): void;
|
|
12
|
+
close(): void;
|
|
13
|
+
setBuilding(b: boolean): void;
|
|
14
|
+
setName(name: string): void;
|
|
15
|
+
setCampaignTag(tag: string): void;
|
|
16
|
+
getState(): TemplateBuilderState;
|
|
17
|
+
subscribe(fn: Listener): () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -53,3 +53,4 @@ export type { AppState, BinaryFiles, BinaryFileData, ExcalidrawProps, Excalidraw
|
|
|
53
53
|
export type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, OrderedExcalidrawElement, ExcalidrawElementType, } from "@orangecatai/element/types";
|
|
54
54
|
export type { ImageEditToolbarCallbacks } from "./components/ImageEditToolbar";
|
|
55
55
|
export type { CustomFontSpec, BrandContext } from "./types";
|
|
56
|
+
export type { ReviewerFeedback, ReviewIssue } from "./components/ai-chat/reviewerAgent";
|
|
@@ -628,6 +628,14 @@ export interface ExcalidrawProps {
|
|
|
628
628
|
* @example "gemini-3.1-flash-image-preview"
|
|
629
629
|
*/
|
|
630
630
|
agentImageModel?: string;
|
|
631
|
+
/**
|
|
632
|
+
* OpenRouter model tag used by the auto-resize engine for HTML layout
|
|
633
|
+
* generation. This is the LLM call that figures out how to reflow the ad
|
|
634
|
+
* content into the target dimensions before Gemini regenerates the background.
|
|
635
|
+
* @default "google/gemini-3.1-flash-lite-preview"
|
|
636
|
+
* @example "openai/gpt-4o"
|
|
637
|
+
*/
|
|
638
|
+
chatModel?: string;
|
|
631
639
|
/**
|
|
632
640
|
* Show the Library sidebar trigger button. Defaults to `false`.
|
|
633
641
|
* Set to `true` to show the library icon in the top-right area.
|
|
@@ -646,6 +654,56 @@ export interface ExcalidrawProps {
|
|
|
646
654
|
* matches the given familyId.
|
|
647
655
|
*/
|
|
648
656
|
customFonts?: CustomFontSpec[];
|
|
657
|
+
/**
|
|
658
|
+
* Called when the user saves a template from the Template Builder.
|
|
659
|
+
*/
|
|
660
|
+
onSaveTemplate?: (template: {
|
|
661
|
+
name: string;
|
|
662
|
+
campaignTag?: string;
|
|
663
|
+
label?: string;
|
|
664
|
+
width?: number;
|
|
665
|
+
height?: number;
|
|
666
|
+
canvasJson?: string;
|
|
667
|
+
thumbnailDataUrl?: string;
|
|
668
|
+
}) => void;
|
|
669
|
+
/**
|
|
670
|
+
* Fetch all available brand assets for the asset picker (in-canvas swap).
|
|
671
|
+
*/
|
|
672
|
+
onFetchAllAssets?: () => Promise<Array<{
|
|
673
|
+
id: string;
|
|
674
|
+
name: string;
|
|
675
|
+
tags: string[];
|
|
676
|
+
assetType: string;
|
|
677
|
+
blobUrl: string;
|
|
678
|
+
}>>;
|
|
679
|
+
/**
|
|
680
|
+
* Search brand assets by query and optional type filter.
|
|
681
|
+
*/
|
|
682
|
+
onSearchBrandAssets?: (query: string, type?: string) => Promise<Array<{
|
|
683
|
+
id: string;
|
|
684
|
+
name: string;
|
|
685
|
+
tags: string[];
|
|
686
|
+
assetType: string;
|
|
687
|
+
blobUrl: string;
|
|
688
|
+
}>>;
|
|
689
|
+
/**
|
|
690
|
+
* List brand templates, optionally filtered by campaignTag.
|
|
691
|
+
*/
|
|
692
|
+
onListBrandTemplates?: (campaignTag?: string) => Promise<Array<{
|
|
693
|
+
id: string;
|
|
694
|
+
name: string;
|
|
695
|
+
campaignTag?: string;
|
|
696
|
+
label?: string;
|
|
697
|
+
width?: number;
|
|
698
|
+
height?: number;
|
|
699
|
+
thumbnailBlobUrl?: string;
|
|
700
|
+
}>>;
|
|
701
|
+
/**
|
|
702
|
+
* Fetch the full canvas JSON for a specific template by ID.
|
|
703
|
+
*/
|
|
704
|
+
onGetTemplateVariant?: (templateId: string) => Promise<{
|
|
705
|
+
canvasJson: string;
|
|
706
|
+
}>;
|
|
649
707
|
}
|
|
650
708
|
export type SceneData = {
|
|
651
709
|
elements?: ImportedDataState["elements"];
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as a,U as b,V as c}from"../chunk-UX5BMIBN.js";import"../chunk-WHNMS6DF.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};
|
|
File without changes
|
|
File without changes
|