@julach-earzan/email-template-builder 0.1.1 → 0.1.3

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,120 @@
1
+ {
2
+ "items": [
3
+ {
4
+ "id": "mock-template-001",
5
+ "name": "Welcome Offer",
6
+ "updatedAt": "2026-04-07T12:00:00.000Z",
7
+ "createdAt": "2026-04-05T09:20:00.000Z",
8
+ "template": {
9
+ "id": "mock-template-001",
10
+ "documentName": "Welcome Offer",
11
+ "meta": {
12
+ "subject": "Welcome to our store!",
13
+ "preheader": "Your first-order discount is here."
14
+ },
15
+ "width": "600px",
16
+ "bodyStyles": {
17
+ "backgroundColor": "#f8fafc",
18
+ "fontFamily": "Arial, sans-serif"
19
+ },
20
+ "sections": [
21
+ {
22
+ "id": "sec-1",
23
+ "styles": {
24
+ "backgroundColor": "#ffffff",
25
+ "padding": "24px"
26
+ },
27
+ "columns": [
28
+ {
29
+ "id": "col-1",
30
+ "components": [
31
+ {
32
+ "id": "cmp-1",
33
+ "type": "text",
34
+ "content": {
35
+ "text": "Welcome! Enjoy 10% off your first order.",
36
+ "variant": "h2"
37
+ },
38
+ "styles": {
39
+ "color": "#0f172a",
40
+ "textAlign": "left"
41
+ },
42
+ "settings": {}
43
+ },
44
+ {
45
+ "id": "cmp-2",
46
+ "type": "button",
47
+ "content": {
48
+ "label": "Shop now",
49
+ "href": "https://example.com/shop",
50
+ "icon": {
51
+ "src": "",
52
+ "alt": ""
53
+ }
54
+ },
55
+ "styles": {
56
+ "backgroundColor": "#4f46e5",
57
+ "color": "#ffffff",
58
+ "padding": "12px 20px",
59
+ "borderRadius": "8px",
60
+ "textAlign": "center"
61
+ },
62
+ "settings": {}
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ }
70
+ },
71
+ {
72
+ "id": "mock-template-002",
73
+ "name": "Gift Card Reminder",
74
+ "updatedAt": "2026-04-06T17:45:00.000Z",
75
+ "createdAt": "2026-04-04T08:10:00.000Z",
76
+ "template": {
77
+ "id": "mock-template-002",
78
+ "documentName": "Gift Card Reminder",
79
+ "meta": {
80
+ "subject": "Your gift card is waiting",
81
+ "preheader": "Use your balance before it expires."
82
+ },
83
+ "width": "600px",
84
+ "bodyStyles": {
85
+ "backgroundColor": "#ffffff",
86
+ "fontFamily": "Arial, sans-serif"
87
+ },
88
+ "sections": [
89
+ {
90
+ "id": "sec-2",
91
+ "styles": {
92
+ "backgroundColor": "#ffffff",
93
+ "padding": "20px"
94
+ },
95
+ "columns": [
96
+ {
97
+ "id": "col-2",
98
+ "components": [
99
+ {
100
+ "id": "cmp-3",
101
+ "type": "text",
102
+ "content": {
103
+ "text": "You still have balance on your gift card.",
104
+ "variant": "p"
105
+ },
106
+ "styles": {
107
+ "color": "#1e293b",
108
+ "textAlign": "left"
109
+ },
110
+ "settings": {}
111
+ }
112
+ ]
113
+ }
114
+ ]
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ ]
120
+ }
@@ -8,8 +8,10 @@ export type EmailStore = {
8
8
  updateDocument: (patch: Partial<Pick<EmailTemplate, 'width' | 'bodyStyles' | 'meta' | 'documentName'>>) => void;
9
9
  previewDevice: 'desktop' | 'mobile';
10
10
  setPreviewDevice: (d: 'desktop' | 'mobile') => void;
11
- canvasView: 'editor' | 'preview';
12
- setCanvasView: (v: 'editor' | 'preview') => void;
11
+ canvasView: 'editor' | 'preview' | 'templates';
12
+ setCanvasView: (v: 'editor' | 'preview' | 'templates') => void;
13
+ activeTemplateId: string | null;
14
+ setActiveTemplateId: (id: string | null) => void;
13
15
  select: (sel: EditorSelection | null) => void;
14
16
  addSection: (atIndex?: number) => void;
15
17
  removeSection: (sectionId: string) => void;
@@ -8,13 +8,21 @@ export type ApiEndpoint = {
8
8
  export type TemplateListItem = {
9
9
  id: string;
10
10
  name?: string;
11
+ description?: string;
12
+ thumbnail?: string;
13
+ isActive?: boolean;
14
+ templateJson?: unknown;
15
+ htmlOutput?: string;
11
16
  updatedAt?: string;
12
17
  createdAt?: string;
13
18
  };
14
19
  export type TemplateCrudPayload = {
15
20
  name: string;
21
+ description?: string;
16
22
  html: string;
17
23
  template: EmailTemplate;
24
+ thumbnail?: string;
25
+ isActive?: boolean;
18
26
  };
19
27
  export declare function normalizeHttpMethod(method: string): string;
20
28
  export declare function parseImageUrlFromResponse(data: unknown, custom?: (json: unknown) => string | undefined): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@julach-earzan/email-template-builder",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "React email template editor with drag-and-drop blocks, preview, HTML export, and optional upload/export API hooks.",
5
5
  "type": "module",
6
6
  "author": "julach-earzan",