# jeffrey-flo/quill_html_editor architecture

> Architecture diagram of the GitHub repository jeffrey-flo/quill_html_editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeffrey-flo/quill_html_editor
- Repository: https://github.com/jeffrey-flo/quill_html_editor

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Editor Components:
- QuillHtmlEditor Widget
- ToolBar Widget
- QuillEditorController
- WebView Component (WebViewX)

b) Supporting Components:
- Asset Management (JavaScript integration)
- Utility Services
- Widget Components
- Platform-specific Implementations

**┌─ Presentation Layer ─────────────────────┐**
- QuillHtmlEditor Widget               │
- ToolBar Widget                       │
- Custom Widgets (ColorPicker, etc.)   │
- ┬────────────────────┘
- ↓
**┌─ Controller Layer ─────────────────────┐**
- QuillEditorController              │
- WebViewX Controller                │
- ┬────────────────────┘
- ↓
**┌─ Core Layer ──────────────────────────┐**
- WebViewX Implementation            │
- QuillJS Integration               │
- Platform-specific Handlers        │
- ┬────────────────────┘
- ↓
**┌─ Utility Layer ───────────────────────┐**
- Format Utilities                   │
- URL Validator                      │
- String Utils                      │
- ┘

##### Implementation Details to Highlight

- Relationship between QuillEditorController and WebViewX
- Communication flow between Flutter and JavaScript
- Demonstrate how the ToolBar interacts with the editor
- Custom widget integration points

##### Additional Elements

Callouts for:
- Supported platforms (Web, iOS, Android)
- File format handling (Delta, HTML)
- Custom font support
- Image and media handling

##### The event handling system for editor interactions

Keep the abstraction level high enough to show the overall architecture while including sufficient detail to understand the component interactions and data flow. Focus on showing how the editor integrates with both Flutter and QuillJS while maintaining platform independence.

Remember to highlight the extensibility points for custom buttons and styling, as these are key features of the package.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Presentation
        QE["QuillHtmlEditor Widget"]
        TB["ToolBar Widget"]
        CW["Custom Widgets"]
        subgraph CustomWidgets
            CP["Color Picker"]
            IP["Image Picker"]
            TP["Table Picker"]
            UI["URL Input"]
        end
    end

    subgraph Controller
        QC["QuillEditorController"]
        WC["WebView Controller"]
        subgraph WebControllers
            WCI["Controller Interface"]
            WCM["Mobile Controller"]
            WCW["Web Controller"]
        end
    end

    subgraph Core
        WV["WebView Component"]
        QJ["QuillJS Integration"]
        subgraph PlatformImpl
            MI["Mobile Implementation"]
            WI["Web Implementation"]
        end
    end

    subgraph Utilities
        FU["Format Utilities"]
        UV["URL Validator"]
        SU["String Utils"]
    end

    %% Relationships
    QE --> QC
    TB --> QC
    CW --> TB
    QC --> WC
    WC --> WV
    WV --> QJ
    WC --> PlatformImpl
    QC -.-> Utilities

    %% Custom Widget Relationships
    CP --> TB
    IP --> TB
    TP --> TB
    UI --> TB

    %% WebView Controller Relationships
    WCI --> WCM
    WCI --> WCW
    WCM --> MI
    WCW --> WI

    %% Styling
    classDef presentation fill:#e1f5fe,stroke:#01579b
    classDef controller fill:#fff3e0,stroke:#ff6f00
    classDef core fill:#e8f5e9,stroke:#1b5e20
    classDef utilities fill:#fce4ec,stroke:#880e4f
    classDef customWidgets fill:#f3e5f5,stroke:#4a148c

    class QE,TB presentation
    class QC,WC,WCI,WCM,WCW controller
    class WV,QJ,MI,WI core
    class FU,UV,SU utilities
    class CP,IP,TP,UI customWidgets

    %% Click Events
    click QE "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/quill_editor_wrapper.dart"
    click TB "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/tool_bar.dart"
    click WV "https://github.com/jeffrey-flo/quill_html_editor/tree/main/lib/src/widgets/webviewx/"
    click MI "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/webviewx/src/view/impl/mobile.dart"
    click WI "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/webviewx/src/view/impl/web.dart"
    click QJ "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/assets/scripts/quill_2.0.0_4_min.js"
    click FU "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/utils/format_config.dart"
    click UV "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/utils/url_validator.dart"
    click SU "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/utils/string_util.dart"
    click CP "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/color_picker.dart"
    click IP "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/image_picker.dart"
    click TP "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/table_picker.dart"
    click UI "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/input_url_widget.dart"
    click WCI "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/webviewx/src/controller/interface.dart"
    click WCM "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/webviewx/src/controller/impl/mobile.dart"
    click WCW "https://github.com/jeffrey-flo/quill_html_editor/blob/main/lib/src/widgets/webviewx/src/controller/impl/web.dart"
```
