dragble-angular-editor 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/README.md +526 -68
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -11,9 +11,9 @@
11
11
 
12
12
  # dragble-angular-editor
13
13
 
14
- AI-powered Angular component for building **email templates** with drag-and-drop. Embed a full-featured **AI-powered email editor** into your Angular app create responsive HTML emails, newsletters, transactional email templates, and email marketing campaigns visually without writing code.
14
+ The **fully AI-powered** Angular editor for **email templates** and **landing pages**. Your end-users design visually with drag-and-drop — or describe what they want and watch AI agents build it live on the canvas. Powered by the built-in **Model Context Protocol (MCP)** server, connect [Claude Code](https://claude.com/code), [OpenCode](https://opencode.ai), [Codex](https://github.com/openai/codex), [Cursor](https://cursor.com), or your own AI backend directly to the editor. Structured tool calls mean guaranteed-valid output no prompt engineering, no JSON hallucination, no broken layouts.
15
15
 
16
- [Dragble](https://dragble.com) is a modern **AI-powered email builder** and **email template editor** that lets your users design professional emails with a visual drag-and-drop interface.
16
+ [Dragble](https://dragble.com) brings two design experiences together in one Angular component: a polished visual editor for designers and a conversational AI surface for everyone else backed by structured tool calls that produce guaranteed-valid HTML emails and landing pages every time.
17
17
 
18
18
  [Website](https://dragble.com) | [Documentation](https://docs.dragble.com) | [Dashboard](https://developers.dragble.com)
19
19
 
@@ -24,6 +24,7 @@ AI-powered Angular component for building **email templates** with drag-and-drop
24
24
  ## Features
25
25
 
26
26
  - Drag-and-drop **email template builder** with 20+ content blocks
27
+ - **Fully AI-powered via MCP** — connect AI agents (Claude Code, OpenCode, Codex, Cursor) or your own AI backend to build designs live on the canvas. Structured tool calls mean guaranteed-valid output — no prompt engineering, no JSON hallucination
27
28
  - Responsive **HTML email** output compatible with all major email clients
28
29
  - **Newsletter editor** with merge tags, dynamic content, and display conditions
29
30
  - Visual **email designer** — no HTML/CSS knowledge required for end users
@@ -151,6 +152,302 @@ export class EditorComponent {
151
152
  }
152
153
  ```
153
154
 
155
+ ## Complete Example
156
+
157
+ ```typescript
158
+ import { Component, ViewChild } from "@angular/core";
159
+ import {
160
+ DragbleEditorComponent,
161
+ DesignJson,
162
+ DragbleSDK,
163
+ EditorOptions,
164
+ } from "dragble-angular-editor";
165
+
166
+ @Component({
167
+ selector: "app-advanced-email-builder",
168
+ standalone: true,
169
+ imports: [DragbleEditorComponent],
170
+ styles: [`
171
+ .advanced-email-builder {
172
+ height: 100vh;
173
+ display: flex;
174
+ flex-direction: column;
175
+ }
176
+
177
+ .toolbar {
178
+ padding: 12px;
179
+ border-bottom: 1px solid #ddd;
180
+ display: flex;
181
+ gap: 8px;
182
+ align-items: center;
183
+ }
184
+
185
+ .dirty-indicator {
186
+ color: orange;
187
+ }
188
+ `],
189
+ template: `
190
+ <div class="advanced-email-builder">
191
+ <div class="toolbar">
192
+ <button type="button" (click)="editor.undo()">Undo</button>
193
+ <button type="button" (click)="editor.redo()">Redo</button>
194
+ <button type="button" (click)="editor.showPreview('desktop')">
195
+ Preview
196
+ </button>
197
+ <button type="button" (click)="handleExportHtml()">Export HTML</button>
198
+ <button type="button" (click)="handleExportImage()">Export Image</button>
199
+ <span *ngIf="isDirty" class="dirty-indicator">Unsaved changes</span>
200
+ </div>
201
+
202
+ <dragble-editor
203
+ #editor
204
+ [editorKey]="'your-editor-key'"
205
+ [editorMode]="'email'"
206
+ [height]="'100%'"
207
+ [designMode]="'live'"
208
+ [options]="editorOptions"
209
+ (ready)="handleReady($event)"
210
+ (change)="handleChange($event)"
211
+ (error)="handleError($event)"
212
+ ></dragble-editor>
213
+ </div>
214
+ `,
215
+ })
216
+ export class AdvancedEmailBuilderComponent {
217
+ @ViewChild("editor") editor!: DragbleEditorComponent;
218
+
219
+ isDirty = false;
220
+
221
+ editorOptions: EditorOptions = {
222
+ appearance: { theme: "light" },
223
+ features: {
224
+ preview: true,
225
+ undoRedo: true,
226
+ imageEditor: true,
227
+ },
228
+ };
229
+
230
+ handleReady(editor: DragbleSDK): void {
231
+ // Set merge tags (must pass a MergeTagsConfig object)
232
+ editor.setMergeTags({
233
+ customMergeTags: [
234
+ { name: "First Name", value: "{{first_name}}" },
235
+ { name: "Last Name", value: "{{last_name}}" },
236
+ { name: "Company", value: "{{company}}" },
237
+ ],
238
+ excludeDefaults: false,
239
+ sort: true,
240
+ });
241
+
242
+ // Set custom fonts
243
+ editor.setFonts({
244
+ showDefaultFonts: true,
245
+ customFonts: [{ label: "Brand Font", value: "BrandFont, sans-serif" }],
246
+ });
247
+
248
+ // Load saved design if available
249
+ const savedDesign = localStorage.getItem("email-design");
250
+ if (savedDesign) {
251
+ editor.loadDesign(JSON.parse(savedDesign));
252
+ }
253
+ }
254
+
255
+ handleChange(data: { design: DesignJson; type: string }): void {
256
+ this.isDirty = true;
257
+ localStorage.setItem("email-design", JSON.stringify(data.design));
258
+ }
259
+
260
+ async handleExportHtml(): Promise<void> {
261
+ const html = await this.editor.exportHtml();
262
+ const blob = new Blob([html], { type: "text/html" });
263
+ const url = URL.createObjectURL(blob);
264
+ const a = document.createElement("a");
265
+ a.href = url;
266
+ a.download = "email.html";
267
+ a.click();
268
+ URL.revokeObjectURL(url);
269
+ }
270
+
271
+ async handleExportImage(): Promise<void> {
272
+ const data = await this.editor.exportImage();
273
+ window.open(data.url, "_blank");
274
+ }
275
+
276
+ handleError(error: Error): void {
277
+ console.error(error.message);
278
+ }
279
+ }
280
+ ```
281
+
282
+ ## MCP — AI Integration
283
+
284
+ Connect AI agents (Claude Code, OpenCode, Codex, Cursor, or your own AI backend) to the editor through the [Model Context Protocol](https://modelcontextprotocol.io). The AI calls structured tools — `add_row`, `add_heading`, `update_button`, `export_html` — that mutate design state live on the canvas. No prompt engineering, no JSON hallucination, no broken output.
285
+
286
+ ### Enabling MCP
287
+
288
+ MCP is off by default. Set `features: { mcp: true }` to opt in:
289
+
290
+ ```html
291
+ <dragble-editor
292
+ #editor
293
+ [editorKey]="'db_pxl81cxn92wignwx'"
294
+ [options]="{ features: { mcp: true } }"
295
+ ></dragble-editor>
296
+ ```
297
+
298
+ MCP also requires a **Starter plan or higher**. Both conditions must be true — plan allows it AND SDK enables it.
299
+
300
+ ### Quick example — your backend controls the AI
301
+
302
+ ```typescript
303
+ import { Component, ViewChild } from "@angular/core";
304
+ import { DragbleEditorComponent } from "dragble-angular-editor";
305
+
306
+ @Component({
307
+ selector: "app-editor",
308
+ template: `
309
+ <button (click)="handleConnectAI()">Connect AI</button>
310
+ <dragble-editor
311
+ #editor
312
+ [editorKey]="'db_pxl81cxn92wignwx'"
313
+ [options]="{ features: { mcp: true } }"
314
+ ></dragble-editor>
315
+ `,
316
+ })
317
+ export class EditorComponent {
318
+ @ViewChild("editor") editor!: DragbleEditorComponent;
319
+
320
+ async handleConnectAI() {
321
+ // The id is YOUR identifier — derive it from your own database/session
322
+ // so the same user editing the same document always gets the same MCP
323
+ // session. Example: if your logged-in user is "alice123" and they're
324
+ // editing document "campaign-summer-2026", build an id like this:
325
+ //
326
+ // const id = "alice123-campaign-summer-2026";
327
+ //
328
+ // Format rules: 8-128 chars, only letters/digits/hyphens/underscores.
329
+ const userIdFromAuth = "alice123"; // from your auth/session
330
+ const docIdFromRoute = "campaign-summer"; // from your URL or DB row
331
+ const id = `${userIdFromAuth}-${docIdFromRoute}`;
332
+ const { sessionId } =
333
+ await this.editor.editor!.connectMCP({ id });
334
+ // Pass sessionId to your backend — it calls MCP tools with your mcp_key
335
+ }
336
+ }
337
+ ```
338
+
339
+ ### Quick example — end-user pairs their own AI client
340
+
341
+ ```typescript
342
+ const handleLetUserPair = async () => {
343
+ const editor = this.editor.editor!;
344
+ // Same id you'd use anywhere else for this user+document combination.
345
+ // 8-128 chars, only letters/digits/hyphens/underscores.
346
+ const id = "alice123-campaign-summer-2026";
347
+ await editor.connectMCP({ id });
348
+
349
+ // Explicitly generate a pairing code (not auto-generated)
350
+ const { code, expiresAt } = await editor.getPairingCode();
351
+ alert(`Paste this into Claude Code: ${code}`);
352
+ };
353
+ ```
354
+
355
+ ### One controller per session
356
+
357
+ Each session can be controlled by **either** your backend **or** an end-user's AI client (Claude Code, OpenCode), never both at the same time:
358
+
359
+ - If your backend makes the first tool call → session is locked to **backend**. Pairing codes are rejected.
360
+ - If a user pairs via pairing code first → session is locked to **paired client**. Backend tool calls are rejected.
361
+
362
+ This prevents two AI controllers from conflicting on the same design.
363
+
364
+ ### How it works
365
+
366
+ 1. **Enable MCP** in the SDK config: `features: { mcp: true }`.
367
+ 2. **Generate an MCP key** in the Dragble dashboard: Project → MCP Key → Generate. Store it in your backend env vars — never in browser code.
368
+ 3. **Call `editor.connectMCP({ id })`** where `id` is a stable identifier you control (see below).
369
+ 4. **Choose your AI path**: either your backend calls MCP tools directly (using the mcp_key), or you generate a pairing code for the end-user to connect their own AI client.
370
+ 5. **Mutations stream live** onto the editor canvas as the AI works.
371
+
372
+ ### The `id` parameter — why it matters
373
+
374
+ The `id` you pass to `connectMCP()` is a **Bring Your Own ID (BYOI)** that maps to your domain entities. It is NOT a random token — it is how Dragble identifies the session across browser refreshes, server restarts, and device switches.
375
+
376
+ **Rules:**
377
+ - 8–128 characters long
378
+ - Only letters, numbers, hyphens, and underscores (`a-z A-Z 0-9 - _`)
379
+ - Must be deterministic — the same user editing the same document should always produce the same `id`
380
+
381
+ **Why these rules?**
382
+ - The `id` is used in database lookups, URL paths, and storage keys — special characters or extreme lengths would break routing
383
+ - Same `id` = resume the same session. Random UUIDs mean every page refresh creates a new session and loses AI context
384
+ - Short IDs (< 8 chars) are too easy to guess, long IDs (> 128 chars) waste storage
385
+
386
+ ```typescript
387
+ // Recommended: derive from your domain — concrete examples
388
+ editor.connectMCP({ id: "alice123-campaign-summer-2026" }); // user + doc
389
+ editor.connectMCP({ id: "workspace_acme_template_welcome" }); // workspace + template
390
+ editor.connectMCP({ id: "org-uber-eats-promo-q4-2026" }); // org + campaign
391
+ editor.connectMCP({ id: "tenant_42_invoice_template_v3" }); // tenant + entity
392
+
393
+ // Valid but NOT recommended — random IDs break session continuity
394
+ // (every page refresh creates a brand new session, AI loses context)
395
+ editor.connectMCP({ id: crypto.randomUUID() });
396
+ ```
397
+
398
+ ### Storage modes (compliance)
399
+
400
+ Choose how much of the session lives on Dragble's servers:
401
+
402
+ | Mode | Persistence | Use case |
403
+ |---|---|---|
404
+ | `full` (default) | Metadata + design content | Standard SaaS; survives refresh, restart, device switch |
405
+ | `metadata-only` | Metadata only | Audit logs without storing customer content |
406
+ | `memory-only` | None — RAM only | HIPAA / SOC2 / strict data residency |
407
+
408
+ ```typescript
409
+ editor.connectMCP({
410
+ id: "user-42-doc-99",
411
+ storage: "full", // default — best UX, refresh + cross-device resume
412
+ // "metadata-only" // audit metadata only, no design content persisted
413
+ // "memory-only" // nothing persisted (HIPAA / SOC2 / data residency)
414
+ });
415
+ ```
416
+
417
+ ### Disconnecting
418
+
419
+ `disconnectMCP()` permanently destroys the session — the database record is deleted and the session cannot be reopened:
420
+
421
+ ```typescript
422
+ const { destroyed } = await editor.disconnectMCP();
423
+ ```
424
+
425
+ Your backend can also force-destroy a session server-side (e.g., when a user's subscription ends):
426
+
427
+ ```bash
428
+ curl -X DELETE https://mcp.dragble.io/sessions/user-42-doc-99 \
429
+ -H "X-API-Key: db_mcp_your_key_here"
430
+ ```
431
+
432
+ Idle sessions are reaped after 2 hours of inactivity. Active sessions never expire — each tool call resets the timer.
433
+
434
+ ### MCP method reference
435
+
436
+ | Method | Returns |
437
+ |---|---|
438
+ | `editor.connectMCP({ id, storage?, editorMode? })` | `{ sessionId, storageMode?, resumed? }` |
439
+ | `editor.disconnectMCP()` | `{ destroyed }` — permanently deletes session |
440
+ | `editor.getPairingCode()` | `{ code, expiresAt }` — generate a pairing code for end-user AI clients |
441
+ | `editor.endPairing()` | `{ revoked }` — invalidate the active pairing code |
442
+ | `editor.getMCPStatus()` | `{ paired: true, sessionId } \| { paired: false, reason? }` |
443
+ | `editor.onAIToolFired(cb)` | unsubscribe fn — fires when AI calls any tool |
444
+
445
+ ### Full documentation
446
+
447
+ - [MCP Overview](https://docs.dragble.com/mcp-server/overview)
448
+ - [Credentials & Security](https://docs.dragble.com/mcp-server/credentials)
449
+ - [AI Client Setup (OpenCode, Claude Code, Codex, etc.)](https://docs.dragble.com/mcp-server/ai-client-setup)
450
+
154
451
  ## Inputs
155
452
 
156
453
  | Input | Type | Default | Description |
@@ -199,82 +496,243 @@ export class EditorComponent {
199
496
  | `error` | `Error` | Emitted when an error occurs |
200
497
  | `commentAction` | `CommentAction` | Emitted on comment events |
201
498
 
202
- ## Methods
499
+ ## SDK Methods Reference
203
500
 
204
- Access methods via `@ViewChild`:
501
+ Access methods through `@ViewChild` on the Angular component. The wrapper exposes SDK methods directly, so call `this.editor.exportHtml()` from your component class. All export and getter methods return Promises.
205
502
 
206
503
  ```typescript
207
- @ViewChild('editor') editor!: DragbleEditorComponent;
504
+ @ViewChild("editor") editor!: DragbleEditorComponent;
505
+
506
+ const html = await this.editor.exportHtml();
208
507
  ```
209
508
 
210
509
  ### Design
211
510
 
212
- | Method | Returns | Description |
213
- | ------------------------------ | --------- | ---------------------- |
214
- | `loadDesign(design, options?)` | `void` | Load a design |
215
- | `loadBlank(options?)` | `void` | Load a blank design |
216
- | `getDesign()` | `Promise` | Get the current design |
511
+ ```typescript
512
+ this.editor.loadDesign(design, options?); // void
513
+ const result = await this.editor.loadDesignAsync(design, options?);
514
+ // => { success, validRowsCount, invalidRowsCount, errors? }
515
+ this.editor.loadBlank(options?); // void
516
+ const { html, json } = await this.editor.getDesign(); // Promise
517
+ ```
217
518
 
218
519
  ### Export
219
520
 
220
- | Method | Returns | Description |
221
- | ----------------------- | -------------------------- | -------------------- |
222
- | `exportHtml(options?)` | `Promise<string>` | Export as HTML |
223
- | `exportJson()` | `Promise<DesignJson>` | Export as JSON |
224
- | `exportPlainText()` | `Promise<string>` | Export as plain text |
225
- | `exportImage(options?)` | `Promise<ExportImageData>` | Export as image |
226
- | `exportPdf(options?)` | `Promise<ExportPdfData>` | Export as PDF |
227
- | `exportZip(options?)` | `Promise<ExportZipData>` | Export as ZIP |
228
-
229
- ### Configuration
230
-
231
- | Method | Returns | Description |
232
- | ---------------------------------- | ------- | ------------------------- |
233
- | `setMergeTags(config)` | `void` | Update merge tags |
234
- | `setSpecialLinks(config)` | `void` | Update special links |
235
- | `setModules(modules)` | `void` | Update custom modules |
236
- | `setFonts(config)` | `void` | Update fonts |
237
- | `setBodyValues(values)` | `void` | Update body values |
238
- | `setToolsConfig(config)` | `void` | Update tools config |
239
- | `setAppearance(config)` | `void` | Update appearance |
240
- | `setEditorMode(mode)` | `void` | Change editor mode |
241
- | `setEditorConfig(config)` | `void` | Update editor config |
242
- | `setLocale(locale, translations?)` | `void` | Change locale |
243
- | `setTextDirection(direction)` | `void` | Set text direction |
244
- | `setLanguage(language)` | `void` | Set template language |
245
- | `setDisplayConditions(config)` | `void` | Update display conditions |
246
- | `setOptions(options)` | `void` | Update editor options |
247
- | `setBrandingColors(config)` | `void` | Update branding colors |
248
-
249
- ### Editor Actions
250
-
251
- | Method | Returns | Description |
252
- | ---------------------- | ---------------------- | -------------------------- |
253
- | `save()` | `void` | Trigger a save event |
254
- | `undo()` | `void` | Undo last action |
255
- | `redo()` | `void` | Redo last action |
256
- | `canUndo()` | `Promise<boolean>` | Check if undo is available |
257
- | `canRedo()` | `Promise<boolean>` | Check if redo is available |
258
- | `showPreview(device?)` | `void` | Show design preview |
259
- | `hidePreview()` | `void` | Hide preview |
260
- | `audit(options?)` | `Promise<AuditResult>` | Run design audit |
261
-
262
- ### Tools & Widgets
263
-
264
- | Method | Returns | Description |
265
- | ---------------------- | --------- | ---------------------- |
266
- | `registerTool(config)` | `Promise` | Register a custom tool |
267
- | `unregisterTool(id)` | `Promise` | Unregister a tool |
268
- | `getTools()` | `Promise` | Get registered tools |
269
- | `createWidget(config)` | `Promise` | Create a widget |
270
- | `removeWidget(name)` | `Promise` | Remove a widget |
271
-
272
- ### Events
273
-
274
- | Method | Returns | Description |
275
- | -------------------------------------- | ------------ | --------------------------------------------------- |
276
- | `addEventListener(event, callback)` | `() => void` | Subscribe to an event; returns unsubscribe function |
277
- | `removeEventListener(event, callback)` | `void` | Remove an event listener |
521
+ All export methods are **Promise-based**. There are no callback overloads.
522
+
523
+ ```typescript
524
+ const html = await this.editor.exportHtml(options?); // Promise<string>
525
+ const json = await this.editor.exportJson(); // Promise<DesignJson>
526
+ const text = await this.editor.exportPlainText(); // Promise<string>
527
+ const imageData = await this.editor.exportImage(options?); // Promise<ExportImageData>
528
+ const pdfData = await this.editor.exportPdf(options?); // Promise<ExportPdfData>
529
+ const zipData = await this.editor.exportZip(options?); // Promise<ExportZipData>
530
+ const values = await this.editor.getPopupValues(); // Promise<PopupValues | null>
531
+ ```
532
+
533
+ ### Merge Tags
534
+
535
+ `setMergeTags` accepts a `MergeTagsConfig` object, not a plain array.
536
+
537
+ ```typescript
538
+ this.editor.setMergeTags({
539
+ customMergeTags: [
540
+ { name: "First Name", value: "{{first_name}}" },
541
+ { name: "Company", value: "{{company}}" },
542
+ ],
543
+ excludeDefaults: false,
544
+ sort: true,
545
+ });
546
+ const tags = await this.editor.getMergeTags(); // Promise<(MergeTag | MergeTagGroup)[]>
547
+ ```
548
+
549
+ ### Special Links
550
+
551
+ `setSpecialLinks` accepts a `SpecialLinksConfig` object.
552
+
553
+ ```typescript
554
+ this.editor.setSpecialLinks({
555
+ customSpecialLinks: [{ name: "Unsubscribe", href: "{{unsubscribe_url}}" }],
556
+ excludeDefaults: false,
557
+ });
558
+ const links = await this.editor.getSpecialLinks(); // Promise<(SpecialLink | SpecialLinkGroup)[]>
559
+ ```
560
+
561
+ ### Modules
562
+
563
+ ```typescript
564
+ this.editor.setModules(modules); // void
565
+ this.editor.setModulesLoading(loading); // void
566
+ const modules = await this.editor.getModules(); // Promise<Module[]>
567
+ ```
568
+
569
+ ### Fonts
570
+
571
+ ```typescript
572
+ this.editor.setFonts(config); // void
573
+ const fonts = await this.editor.getFonts(); // Promise<FontsConfig>
574
+ ```
575
+
576
+ ### Body Values
577
+
578
+ ```typescript
579
+ this.editor.setBodyValues({
580
+ backgroundColor: "#f5f5f5",
581
+ contentWidth: "600px",
582
+ });
583
+ const values = await this.editor.getBodyValues(); // Promise<SetBodyValuesOptions>
584
+ ```
585
+
586
+ ### Editor Configuration
587
+
588
+ ```typescript
589
+ this.editor.setOptions(options); // void — Partial<EditorOptions>
590
+ this.editor.setToolsConfig(toolsConfig); // void
591
+ this.editor.setEditorMode(mode); // void
592
+ this.editor.setEditorConfig(config); // void
593
+ const config = await this.editor.getEditorConfig(); // Promise<EditorBehaviorConfig>
594
+ ```
595
+
596
+ ### Locale, Language & Text Direction
597
+
598
+ ```typescript
599
+ this.editor.setLocale(locale, translations?); // void
600
+ this.editor.setLanguage(language); // void
601
+ const lang = await this.editor.getLanguage(); // Promise<Language | null>
602
+ this.editor.setTextDirection(direction); // void — 'ltr' | 'rtl'
603
+ const dir = await this.editor.getTextDirection(); // Promise<TextDirection>
604
+ ```
605
+
606
+ ### Appearance
607
+
608
+ ```typescript
609
+ this.editor.setAppearance(appearance); // void
610
+ ```
611
+
612
+ ### Undo / Redo / Save
613
+
614
+ ```typescript
615
+ this.editor.undo(); // void
616
+ this.editor.redo(); // void
617
+ const canUndo = await this.editor.canUndo(); // Promise<boolean>
618
+ const canRedo = await this.editor.canRedo(); // Promise<boolean>
619
+ this.editor.save(); // void
620
+ ```
621
+
622
+ ### Preview
623
+
624
+ ```typescript
625
+ this.editor.showPreview(device?); // void — 'desktop' | 'tablet' | 'mobile'
626
+ this.editor.hidePreview(); // void
627
+ ```
628
+
629
+ ### Custom Tools
630
+
631
+ ```typescript
632
+ await this.editor.registerTool(config); // Promise<void>
633
+ await this.editor.unregisterTool(toolId); // Promise<void>
634
+ const tools = await this.editor.getTools(); // Promise<Array<{ id, label, baseToolType }>>
635
+ ```
636
+
637
+ ### Custom Widgets
638
+
639
+ ```typescript
640
+ await this.editor.createWidget(config); // Promise<void>
641
+ await this.editor.removeWidget(widgetName); // Promise<void>
642
+ ```
643
+
644
+ ### Collaboration & Comments
645
+
646
+ ```typescript
647
+ this.editor.showComment(commentId); // void
648
+ this.editor.openCommentPanel(rowId); // void
649
+ ```
650
+
651
+ ### Tabs & Branding
652
+
653
+ ```typescript
654
+ this.editor.updateTabs(tabs); // void
655
+ this.editor.setBrandingColors(config); // void
656
+ this.editor.registerColumns(cells); // void
657
+ ```
658
+
659
+ ### Display Conditions
660
+
661
+ ```typescript
662
+ this.editor.setDisplayConditions(config); // void
663
+ ```
664
+
665
+ ### Audit
666
+
667
+ ```typescript
668
+ const result = await this.editor.audit(options?); // Promise<AuditResult>
669
+ ```
670
+
671
+ ### Asset Management
672
+
673
+ ```typescript
674
+ const { success, url, error } = await this.editor.uploadImage(file, options?);
675
+ const { assets, total } = await this.editor.listAssets(options?);
676
+ const { success, error } = await this.editor.deleteAsset(assetId);
677
+ const folders = await this.editor.listAssetFolders(parentId?);
678
+ const folder = await this.editor.createAssetFolder(name, parentId?);
679
+ const info = await this.editor.getStorageInfo();
680
+ ```
681
+
682
+ ### Status & Lifecycle
683
+
684
+ ```typescript
685
+ this.editor.isReady(); // boolean
686
+ this.editor.destroy(); // void
687
+ ```
688
+
689
+ ## Events
690
+
691
+ Angular outputs (`(ready)`, `(load)`, `(change)`, `(error)`, `(commentAction)`) cover the common component integration points. For lower-level SDK events, subscribe with `addEventListener` after the editor is ready:
692
+
693
+ ```typescript
694
+ const unsubscribe = this.editor.addEventListener("design:updated", (data) => {
695
+ console.log("Design changed:", data);
696
+ });
697
+
698
+ // Or remove manually
699
+ this.editor.removeEventListener("design:updated", callback);
700
+ ```
701
+
702
+ ### Available Events
703
+
704
+ | Event | Description |
705
+ | -------------------------- | --------------------------- |
706
+ | `editor:ready` | Editor initialized |
707
+ | `design:loaded` | Design loaded |
708
+ | `design:updated` | Design changed |
709
+ | `design:saved` | Design saved |
710
+ | `row:selected` | Row selected |
711
+ | `row:unselected` | Row unselected |
712
+ | `column:selected` | Column selected |
713
+ | `column:unselected` | Column unselected |
714
+ | `content:selected` | Content block selected |
715
+ | `content:unselected` | Content block unselected |
716
+ | `content:modified` | Content block modified |
717
+ | `content:added` | Content block added |
718
+ | `content:deleted` | Content block deleted |
719
+ | `preview:shown` | Preview opened |
720
+ | `preview:hidden` | Preview closed |
721
+ | `image:uploaded` | Image uploaded successfully |
722
+ | `image:error` | Image upload error |
723
+ | `export:html` | HTML exported |
724
+ | `export:plainText` | Plain text exported |
725
+ | `export:image` | Image exported |
726
+ | `save` | Save triggered |
727
+ | `save:success` | Save succeeded |
728
+ | `save:error` | Save failed |
729
+ | `template:requested` | Template requested |
730
+ | `element:selected` | Element selected |
731
+ | `element:deselected` | Element deselected |
732
+ | `export` | Export triggered |
733
+ | `displayCondition:applied` | Display condition applied |
734
+ | `displayCondition:removed` | Display condition removed |
735
+ | `displayCondition:updated` | Display condition updated |
278
736
 
279
737
  ## TypeScript
280
738
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragble-angular-editor",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "AI-powered Angular email editor component. Drag-and-drop email builder for creating responsive email templates and newsletters. Build HTML emails visually with Dragble.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",