easy-email-pro-theme 1.57.13 → 1.58.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.
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { type AiAgentAttachment, type EasyEmailProAiAgentProps } from "./App";
3
+ import { type AiAgentHistory, type AiAgentHistoryChange, type AiAgentSnapshot } from "./useAiAgentSession";
4
+ import type { AiChatHandler } from "./client";
5
+ export type AiAgentPanelSnapshotOptions = {
6
+ onCreate?: (snapshot: AiAgentSnapshot) => void | Promise<void>;
7
+ onRestore?: (snapshotId: string) => AiAgentSnapshot | null | Promise<AiAgentSnapshot | null>;
8
+ };
9
+ export type AiAgentUploadResult = string | AiAgentAttachment;
10
+ export type AiAgentUploadHandler = (file: File) => Promise<AiAgentUploadResult>;
11
+ export type AiAgentPanelProps = {
12
+ className?: string;
13
+ disabled?: boolean;
14
+ onChat: AiChatHandler;
15
+ history?: AiAgentHistory;
16
+ onHistoryChange?: (history: AiAgentHistory, change: AiAgentHistoryChange) => void;
17
+ snapshots?: false | AiAgentPanelSnapshotOptions;
18
+ initialMessages?: EasyEmailProAiAgentProps["messages"];
19
+ onError?: (error: Error) => void;
20
+ onUpload?: AiAgentUploadHandler;
21
+ quickActions?: EasyEmailProAiAgentProps["quickActions"];
22
+ placeholder?: string;
23
+ };
24
+ export declare function AiAgentPanel({ className, disabled, history, onHistoryChange, snapshots, initialMessages, onError, onUpload: uploadOverride, onChat, quickActions, placeholder, }: AiAgentPanelProps): React.JSX.Element;
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import type { AiDecisionChoice, AiDecisionRequestPayload, AiDecisionResponsePayload, AiTokenUsage, AiWebSource } from "./client";
3
+ export type AiChangeVersion = {
4
+ id: string;
5
+ label: string;
6
+ title: string;
7
+ summary: string;
8
+ time: string;
9
+ changes: string[];
10
+ };
11
+ export type AiAgentMessage = {
12
+ id: string;
13
+ role: "user" | "assistant";
14
+ content: string;
15
+ time: string;
16
+ createdAt?: string;
17
+ status?: "ready" | "running" | "error" | "pending_apply";
18
+ snapshotId?: string | null;
19
+ usage?: AiTokenUsage;
20
+ sources?: AiWebSource[];
21
+ attachments?: AiAgentAttachment[];
22
+ };
23
+ export type AiAgentAttachment = {
24
+ id: string;
25
+ type: "image";
26
+ name: string;
27
+ url: string;
28
+ mimeType?: string;
29
+ dataUrl?: string;
30
+ size?: number;
31
+ };
32
+ export type AiQuickAction = string | {
33
+ label: string;
34
+ prompt: string;
35
+ };
36
+ export type EasyEmailProAiAgentProps = {
37
+ className?: string;
38
+ status?: "ready" | "running" | "error";
39
+ model?: string;
40
+ currentVersionId?: string;
41
+ versions?: AiChangeVersion[];
42
+ messages?: AiAgentMessage[];
43
+ activity?: string;
44
+ disabled?: boolean;
45
+ sendDisabled?: boolean;
46
+ quickActions?: AiQuickAction[];
47
+ pendingAction?: {
48
+ label: string;
49
+ disabled?: boolean;
50
+ onClick: () => void | Promise<void>;
51
+ };
52
+ pendingDecision?: AiDecisionRequestPayload | null;
53
+ placeholder?: string;
54
+ onSend?: (message: string, attachments?: AiAgentAttachment[]) => void | Promise<void>;
55
+ onUpload?: (file: File) => Promise<AiAgentAttachment>;
56
+ onChooseDecision?: (choice: AiDecisionChoice, response: AiDecisionResponsePayload) => void | Promise<void>;
57
+ onCancelDecision?: () => void;
58
+ onRestoreSnapshot?: (snapshotId: string) => void | Promise<void>;
59
+ onRestoreVersion?: (version: AiChangeVersion) => void;
60
+ onStepVersion?: (version: AiChangeVersion, direction: "previous" | "next") => void;
61
+ onQuickAction?: (action: string) => void | Promise<void>;
62
+ onClose?: () => void;
63
+ };
64
+ export declare function EasyEmailProAiAgent({ className, messages, activity, disabled, sendDisabled, quickActions, pendingAction, pendingDecision, placeholder, onSend, onUpload, onChooseDecision, onCancelDecision, onRestoreSnapshot, onQuickAction, }: EasyEmailProAiAgentProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { parseEasyEmailAiStream, resolveAiChatResult, } from "easy-email-pro-core";
2
+ export type { AiAgentEvent, AiAgentImageAttachment, AiAgentStatus, AiChatHandler, AiChatRequest, AiChatResult, AiDecisionChoice, AiDecisionRequestPayload, AiDecisionResponsePayload, AiEditorContextPayload, AiTokenUsage, AiWebSource, EasyEmailAnswerPayload, EasyEmailImageResultPayload, EasyEmailResultPayload, RespondEasyEmailBody, } from "easy-email-pro-core";
@@ -0,0 +1,10 @@
1
+ import "./styles.css";
2
+ export { EasyEmailProAiAgent } from "./App";
3
+ export { AiAgentPanel } from "./AiAgentPanel";
4
+ export { useAiAgentSession } from "./useAiAgentSession";
5
+ export type { AiAgentPanelProps, AiAgentPanelSnapshotOptions, } from "./AiAgentPanel";
6
+ export type { AiAgentAttachment, AiAgentMessage, AiChangeVersion, AiQuickAction, EasyEmailProAiAgentProps, } from "./App";
7
+ export type { AiToolApplyResult, AiToolCall, AiToolTarget, EasyEmailToolCallsPayload, } from "./tools";
8
+ export type { AiAgentHistory, AiAgentHistoryChange, AiAgentPendingChange, AiAgentRuntimeStatus, AiAgentSnapshot, AiAgentSnapshotMeta, UseAiAgentSessionOptions, } from "./useAiAgentSession";
9
+ export { parseEasyEmailAiStream, resolveAiChatResult, } from "./client";
10
+ export type { AiAgentEvent, AiAgentStatus, AiChatHandler, AiChatRequest, AiChatResult, AiTokenUsage, AiWebSource, AiEditorContextPayload, AiAgentImageAttachment, EasyEmailAnswerPayload, EasyEmailResultPayload, } from "./client";
@@ -0,0 +1 @@
1
+ export type { AiAppliedChange, AiToolApplyResult, AiToolCall, AiToolTarget, EasyEmailToolCallsPayload, } from "easy-email-pro-core";
@@ -0,0 +1,77 @@
1
+ import type { AiAgentMessage, AiAgentAttachment } from "./App";
2
+ import { type AiChatHandler, type AiDecisionChoice, type AiDecisionRequestPayload, type AiDecisionResponsePayload, type AiAgentImageAttachment, type AiEditorContextPayload } from "./client";
3
+ import type { AiToolApplyResult, AiToolCall, EasyEmailToolCallsPayload } from "./tools";
4
+ export type AiAgentRuntimeStatus = "ready" | "running" | "error";
5
+ export type AiAgentSnapshotMeta = {
6
+ id: string;
7
+ title?: string;
8
+ summary?: string | null;
9
+ createdAt: string;
10
+ };
11
+ export type AiAgentSnapshot = AiAgentSnapshotMeta & {
12
+ template: unknown;
13
+ reason: "before-ai-run" | "after-ai-apply";
14
+ messageId?: string;
15
+ };
16
+ export type AiAgentHistory = {
17
+ messages: AiAgentMessage[];
18
+ currentSnapshotId?: string;
19
+ snapshots?: AiAgentSnapshotMeta[];
20
+ };
21
+ export type AiAgentHistoryChange = {
22
+ type: "message.appended";
23
+ messages: AiAgentMessage[];
24
+ } | {
25
+ type: "message.updated";
26
+ messageId: string;
27
+ patch: Partial<AiAgentMessage>;
28
+ } | {
29
+ type: "snapshot.created";
30
+ snapshot: AiAgentSnapshotMeta;
31
+ } | {
32
+ type: "snapshot.restored";
33
+ snapshotId: string;
34
+ };
35
+ export type UseAiAgentSessionOptions = {
36
+ getTemplate: () => unknown;
37
+ getEditorContext?: () => AiEditorContextPayload | undefined;
38
+ onChat: AiChatHandler;
39
+ onApplyTemplate?: (template: unknown) => void;
40
+ onApplyToolCalls?: (toolCalls: AiToolCall[], payload: EasyEmailToolCallsPayload) => void | AiToolApplyResult | Promise<void | AiToolApplyResult>;
41
+ onUploadGeneratedImage?: (image: AiAgentImageAttachment) => AiAgentImageAttachment | Promise<AiAgentImageAttachment>;
42
+ history?: AiAgentHistory;
43
+ onHistoryChange?: (history: AiAgentHistory, change: AiAgentHistoryChange) => void;
44
+ snapshotsEnabled?: boolean;
45
+ onSnapshotCreate?: (snapshot: AiAgentSnapshot) => void | Promise<void>;
46
+ onRestoreSnapshot?: (snapshotId: string) => void | Promise<void>;
47
+ initialMessages?: AiAgentMessage[];
48
+ onError?: (error: Error) => void;
49
+ };
50
+ export type AiAgentPendingChange = {
51
+ kind: "tool_calls";
52
+ assistantMessageId: string;
53
+ payload: EasyEmailToolCallsPayload;
54
+ toolCalls: AiToolCall[];
55
+ } | {
56
+ kind: "template";
57
+ assistantMessageId: string;
58
+ template: unknown;
59
+ summary?: string | null;
60
+ };
61
+ export declare function useAiAgentSession(options: UseAiAgentSessionOptions): {
62
+ history: AiAgentHistory;
63
+ messages: AiAgentMessage[];
64
+ snapshots: AiAgentSnapshotMeta[];
65
+ currentSnapshotId: string | undefined;
66
+ status: AiAgentRuntimeStatus;
67
+ activity: string;
68
+ pendingChange: AiAgentPendingChange | null;
69
+ pendingDecision: AiDecisionRequestPayload | null;
70
+ applyingPendingChange: boolean;
71
+ applyPendingChange: () => Promise<void>;
72
+ chooseDecision: (choice: AiDecisionChoice, response: AiDecisionResponsePayload) => Promise<void>;
73
+ clearPendingDecision: () => void;
74
+ restoreSnapshot: (snapshotId: string) => Promise<void>;
75
+ send: (message: string, attachments?: AiAgentAttachment[], decisionResponse?: AiDecisionResponsePayload) => Promise<void>;
76
+ stop: () => Promise<void>;
77
+ };
@@ -1,9 +1,12 @@
1
1
  import React from "react";
2
2
  import "overlayscrollbars/css/OverlayScrollbars.css";
3
- export declare const FullHeightOverlayScrollbars: React.FC<{
3
+ import { OverlayScrollbarsComponent } from "overlayscrollbars-react";
4
+ export declare const FullHeightOverlayScrollbars: React.ForwardRefExoticComponent<({
4
5
  height: string | number;
5
6
  children: React.ReactNode;
7
+ className?: string | undefined;
6
8
  } | {
7
9
  maxHeight: string | number;
8
10
  children: React.ReactNode;
9
- }>;
11
+ className?: string | undefined;
12
+ }) & React.RefAttributes<OverlayScrollbarsComponent>>;
@@ -1,11 +1,12 @@
1
- /// <reference types="react" />
2
1
  import { WidgetConfigPanel, WidgetTypeOptions } from "./ConfigurationPanel/components/WidgetConfigPanel";
3
2
  import { AIAssistant } from "./HoveringToolbar/componens/AIAssistant";
4
3
  import { ElementStyleGallery } from "./ElementStyleGallery";
5
4
  export { enhancer } from "./Form";
6
5
  export * from "./Providers";
6
+ export * from "./AIAgent";
7
7
  import { SocialItem } from "./ConfigurationPanel/Elements/Social";
8
8
  import { NavbarLink } from "./ConfigurationPanel/Elements/Navbar";
9
+ import type { ComponentType } from "react";
9
10
  export declare const SharedComponents: {
10
11
  PreviewEmailDrawer: ({ children, }: {
11
12
  children: import("react").ReactNode;
@@ -86,13 +87,15 @@ export declare const SharedComponents: {
86
87
  UnsplashImages: (props: import("./UnsplashImages").UnsplashImagesProps) => import("react").JSX.Element;
87
88
  UnsplashImagesDrawer: import("react").ForwardRefExoticComponent<import("./UnsplashImagesDrawer").UnsplashImagesDrawerProps & import("react").RefAttributes<unknown>>;
88
89
  WidgetConfigPanel: typeof WidgetConfigPanel;
89
- FullHeightOverlayScrollbars: import("react").FC<{
90
+ FullHeightOverlayScrollbars: import("react").ForwardRefExoticComponent<({
90
91
  height: string | number;
91
92
  children: import("react").ReactNode;
93
+ className?: string | undefined;
92
94
  } | {
93
95
  maxHeight: string | number;
94
96
  children: import("react").ReactNode;
95
- }>;
97
+ className?: string | undefined;
98
+ }) & import("react").RefAttributes<import("overlayscrollbars-react").OverlayScrollbarsComponent>>;
96
99
  BlockList: ({ tab, }: {
97
100
  tab: "Default" | "Universal" | "Prebuilt";
98
101
  }) => import("react").JSX.Element;
@@ -167,6 +170,7 @@ export declare const SharedComponents: {
167
170
  }>;
168
171
  SocialItem: typeof SocialItem;
169
172
  NavbarLink: typeof NavbarLink;
173
+ AiAgent: ComponentType<{}> | undefined;
170
174
  };
171
175
  export { CollapseWrapper } from "./ConfigurationPanel/components/CollapseWrapper";
172
176
  export { AttributesPanelWrapper } from "./ConfigurationPanel/components/AttributesPanelWrapper";
@@ -8,3 +8,4 @@ export { useEditorThemeState } from "./useEditorThemeState";
8
8
  export { useColorContext } from "./useColorContext";
9
9
  export { useMinimalistContext } from "./useMinimalistContext";
10
10
  export { useBlocksDrawer } from "./useBlocksDrawer";
11
+ export { useApplyAiToolCalls, type AiEditorToolApplyResult, type AiEditorToolCall, type AiEditorToolTarget, } from "./useApplyAiToolCalls";
@@ -0,0 +1,85 @@
1
+ export type AiEditorToolTarget = {
2
+ selected: true;
3
+ } | {
4
+ id: string;
5
+ } | {
6
+ uid: string;
7
+ } | {
8
+ type: string;
9
+ index?: number;
10
+ };
11
+ export type AiEditorToolCall = {
12
+ name: "update_text";
13
+ target: AiEditorToolTarget;
14
+ text: string;
15
+ } | {
16
+ name: "update_attribute";
17
+ target: AiEditorToolTarget;
18
+ key: string;
19
+ value: unknown;
20
+ } | {
21
+ name: "update_mobile_attribute";
22
+ target: AiEditorToolTarget;
23
+ key: string;
24
+ value: unknown;
25
+ } | {
26
+ name: "update_attributes";
27
+ target: AiEditorToolTarget;
28
+ attributes: Record<string, unknown>;
29
+ scope?: "desktop" | "mobile";
30
+ } | {
31
+ name: "update_data";
32
+ target: AiEditorToolTarget;
33
+ key: string;
34
+ value: unknown;
35
+ } | {
36
+ name: "replace_children";
37
+ target: AiEditorToolTarget;
38
+ children: unknown[];
39
+ } | {
40
+ name: "set_visibility";
41
+ target: AiEditorToolTarget;
42
+ desktop: boolean;
43
+ mobile: boolean;
44
+ } | {
45
+ name: "replace_block";
46
+ target: AiEditorToolTarget;
47
+ block: unknown;
48
+ } | {
49
+ name: "update_link";
50
+ target: AiEditorToolTarget;
51
+ href: string;
52
+ blank?: boolean;
53
+ title?: string;
54
+ } | {
55
+ name: "move_up" | "move_down" | "duplicate" | "delete_node";
56
+ target: AiEditorToolTarget;
57
+ } | {
58
+ name: "add_block_after";
59
+ target: AiEditorToolTarget;
60
+ block: unknown;
61
+ } | {
62
+ name: "add_block_before";
63
+ target: AiEditorToolTarget;
64
+ block: unknown;
65
+ } | {
66
+ name: "select_node";
67
+ target: AiEditorToolTarget;
68
+ } | {
69
+ name: "apply_template";
70
+ template: unknown;
71
+ };
72
+ export type AiEditorToolApplyResult = {
73
+ applied: number;
74
+ skipped: number;
75
+ errors: string[];
76
+ changes?: AiEditorAppliedChange[];
77
+ };
78
+ export type AiEditorAppliedChange = {
79
+ id: string;
80
+ label: string;
81
+ description: string;
82
+ target: AiEditorToolTarget;
83
+ path?: number[];
84
+ };
85
+ export declare function useApplyAiToolCalls(): (toolCalls: AiEditorToolCall[]) => AiEditorToolApplyResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.57.13",
3
+ "version": "1.58.0",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"