From 75a73dde552ea0dee6f765c2fad3331ec13ab8f6 Mon Sep 17 00:00:00 2001 From: Natxo Date: Sat, 9 May 2026 13:24:48 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20Readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..e7397f1 --- /dev/null +++ b/Readme.md @@ -0,0 +1,69 @@ +# SigPro Editor + +A minimalist, ultra-lightweight WYSIWYG editor for SigPro. + +## Features + +* **Tiny footprint** - No heavy dependencies (only SigPro). +* **Reactive** - Built-in support for SigPro signals. +* **Media Support** - Drag & drop images and file attachments. +* **Code View** - Toggle between rich text and raw HTML. +* **DaisyUI Ready** - Styled with Tailwind CSS and DaisyUI classes. + +## Installation + +```bash +npm install sigpro-editor + +``` + +## Quick Start + +```javascript +import { $ } from "sigpro"; +import { Editor } from "sigpro-editor"; + +const content = $("

Hello World

"); + +const myApp = () => div([ + Editor({ + value: content, + onchange: (html) => content(html), + class: "my-4 shadow-lg" + }) +]); + +``` + +## API + +### Props + +| Prop | Type | Description | +| --- | --- | --- | +| `value` | `string | Signal` | Initial content or reactive signal. | +| `onchange` | `(html: string) => void` | Callback triggered on every edit. | +| `class` | `string` | Custom CSS classes for the container. | + +## Keyboard Shortcuts + +* **Tab**: Indent text. +* **Formatting**: Supports standard `execCommand` shortcuts (Ctrl+B, Ctrl+I, etc. depending on browser). + +## Features Included + +* **Basic Styles**: Bold, Italic, Underline, Color Picker. +* **Alignment**: Left, Center, Right. +* **Lists**: Ordered and Unordered lists. +* **Blocks**: Blockquotes and Indentation. +* **Media**: +* **Images**: Resizable with a built-in fullscreen lightbox on click. +* **Attachments**: Clean UI for non-image file downloads. + + +* **Links**: Prompt-based link insertion. +* **Emojis**: Built-in quick picker. + +## License + +MIT \ No newline at end of file