@seyamali/aurelia-editor 0.1.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.
- package/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/core/commands.d.ts +1 -0
- package/dist/core/engine.d.ts +11 -0
- package/dist/core/registry.d.ts +13 -0
- package/dist/core/sdk.d.ts +57 -0
- package/dist/counter.d.ts +1 -0
- package/dist/horizontal-rule-plugin-DdpCd1us.js +20 -0
- package/dist/index-C9G087KG.js +54332 -0
- package/dist/index.d.ts +4 -0
- package/dist/main.d.ts +0 -0
- package/dist/omni-editor.js +6 -0
- package/dist/omni-editor.umd.cjs +822 -0
- package/dist/plugins/advanced/asset-link-node.d.ts +18 -0
- package/dist/plugins/advanced/code-block-node.d.ts +33 -0
- package/dist/plugins/advanced/code-blocks.d.ts +13 -0
- package/dist/plugins/advanced/footnote-node.d.ts +59 -0
- package/dist/plugins/advanced/footnote-plugin.d.ts +6 -0
- package/dist/plugins/advanced/footnote.d.ts +8 -0
- package/dist/plugins/advanced/html-snippet-node.d.ts +16 -0
- package/dist/plugins/advanced/markdown.d.ts +5 -0
- package/dist/plugins/advanced/media-embed.d.ts +4 -0
- package/dist/plugins/advanced/placeholder-node.d.ts +22 -0
- package/dist/plugins/advanced/placeholder.d.ts +18 -0
- package/dist/plugins/advanced/revision-history.d.ts +22 -0
- package/dist/plugins/advanced/source-view.d.ts +37 -0
- package/dist/plugins/advanced/style-node.d.ts +18 -0
- package/dist/plugins/advanced/youtube-node.d.ts +34 -0
- package/dist/plugins/collaboration/revision-history.d.ts +25 -0
- package/dist/plugins/collaboration/revision-ui.d.ts +2 -0
- package/dist/plugins/collaboration/suggestion-node.d.ts +21 -0
- package/dist/plugins/collaboration/track-changes.d.ts +8 -0
- package/dist/plugins/configuration/accessibility.d.ts +11 -0
- package/dist/plugins/configuration/context-aware-toolbar.d.ts +66 -0
- package/dist/plugins/configuration/i18n.d.ts +40 -0
- package/dist/plugins/configuration/toolbar-config.d.ts +73 -0
- package/dist/plugins/configuration/toolbar-customization-ui.d.ts +73 -0
- package/dist/plugins/configuration/toolbar-customization.d.ts +12 -0
- package/dist/plugins/configuration/toolbar-system.d.ts +25 -0
- package/dist/plugins/configuration/toolbar-ui.d.ts +1 -0
- package/dist/plugins/custom-plugin-demo.d.ts +11 -0
- package/dist/plugins/essentials/clipboard.d.ts +4 -0
- package/dist/plugins/essentials/history.d.ts +12 -0
- package/dist/plugins/essentials/horizontal-rule-plugin.d.ts +2 -0
- package/dist/plugins/export/pdf-export.d.ts +4 -0
- package/dist/plugins/export/word-export.d.ts +4 -0
- package/dist/plugins/formatting/basic-styles.d.ts +33 -0
- package/dist/plugins/formatting/custom-heading-node.d.ts +17 -0
- package/dist/plugins/formatting/custom-link-node.d.ts +17 -0
- package/dist/plugins/formatting/custom-paragraph-node.d.ts +16 -0
- package/dist/plugins/formatting/icon-node.d.ts +22 -0
- package/dist/plugins/formatting/span-node.d.ts +18 -0
- package/dist/plugins/import/word-import.d.ts +5 -0
- package/dist/plugins/layout/headings.d.ts +7 -0
- package/dist/plugins/layout/indent.d.ts +2 -0
- package/dist/plugins/layout/layout-node.d.ts +22 -0
- package/dist/plugins/layout/lists.d.ts +22 -0
- package/dist/plugins/layout/table-resizer.d.ts +5 -0
- package/dist/plugins/layout/tables.d.ts +16 -0
- package/dist/plugins/media/custom-image-node.d.ts +23 -0
- package/dist/plugins/media/embed-plugin.d.ts +9 -0
- package/dist/plugins/media/image-drag-move.d.ts +2 -0
- package/dist/plugins/media/image-node.d.ts +70 -0
- package/dist/plugins/media/image-popover-ui.d.ts +2 -0
- package/dist/plugins/media/image-resizer.d.ts +6 -0
- package/dist/plugins/media/image-url-modal.d.ts +3 -0
- package/dist/plugins/media/images.d.ts +4 -0
- package/dist/plugins/media/link-popover-ui.d.ts +3 -0
- package/dist/plugins/media/links.d.ts +3 -0
- package/dist/plugins/media/unified-image-modal.d.ts +3 -0
- package/dist/plugins/page-layout/page-break-node.d.ts +20 -0
- package/dist/plugins/page-layout/page-break.d.ts +7 -0
- package/dist/plugins/page-layout/toc-node.d.ts +46 -0
- package/dist/plugins/page-layout/toc-plugin.d.ts +8 -0
- package/dist/plugins/productivity/autosave.d.ts +6 -0
- package/dist/plugins/productivity/case-change.d.ts +11 -0
- package/dist/plugins/productivity/document-outline.d.ts +12 -0
- package/dist/plugins/productivity/emoji-ui.d.ts +2 -0
- package/dist/plugins/productivity/emoji.d.ts +9 -0
- package/dist/plugins/productivity/find-replace-ui.d.ts +2 -0
- package/dist/plugins/productivity/find-replace.d.ts +26 -0
- package/dist/plugins/productivity/format-painter.d.ts +10 -0
- package/dist/plugins/productivity/minimap.d.ts +6 -0
- package/dist/plugins/productivity/productivity-pack.d.ts +5 -0
- package/dist/plugins/productivity/slash-commands.d.ts +5 -0
- package/dist/plugins/productivity/slash-menu-ui.d.ts +25 -0
- package/dist/plugins/upload/adapters.d.ts +16 -0
- package/dist/plugins/upload/upload-manager.d.ts +20 -0
- package/dist/shared/dialog-system.d.ts +28 -0
- package/dist/spare.d.ts +7 -0
- package/dist/ui/code-block-popover-ui.d.ts +5 -0
- package/dist/ui/components/editor-main-html.d.ts +1 -0
- package/dist/ui/components/modals-html.d.ts +1 -0
- package/dist/ui/components/status-bar-html.d.ts +1 -0
- package/dist/ui/components/toolbar-html.d.ts +1 -0
- package/dist/ui/icons.d.ts +53 -0
- package/dist/ui/layout.d.ts +1 -0
- package/dist/ui/revision-history-ui.d.ts +2 -0
- package/dist/ui/table-grid-picker.d.ts +3 -0
- package/dist/ui/table-popover-ui.d.ts +2 -0
- package/dist/ui/toolbar-delegation.d.ts +6 -0
- package/dist/ui/toolbar-logic/advanced-logic.d.ts +2 -0
- package/dist/ui/toolbar-logic/basic-logic.d.ts +2 -0
- package/dist/ui/toolbar-logic/document-logic.d.ts +2 -0
- package/dist/ui/toolbar-logic/state-logic.d.ts +1 -0
- package/dist/ui/toolbar-setup.d.ts +6 -0
- package/dist/ui/toolbar.d.ts +3 -0
- package/dist/ui/track-changes-ui.d.ts +2 -0
- package/dist/vite.svg +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Seyam Ali
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Aurelia Editor
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@seyamali/aurelia-editor)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
|
|
7
|
+
**Aurelia Editor** is a powerful, customizable, and framework-agnostic rich text editor built on top of [Lexical](https://lexical.dev/). It is designed for modern content creation, offering a clean, "Notion-style" interface combined with enterprise-grade features like MS Word compatibility, PDF export, and advanced layout tools.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ✨ Features
|
|
14
|
+
|
|
15
|
+
**Aurelia Editor** delivers a premium writing experience with a "batteries-included" philosophy:
|
|
16
|
+
|
|
17
|
+
### 📝 Core Editing
|
|
18
|
+
* **Rich Text**: Bold, Italic, Underline, Strikethrough, Subscript, Superscript, Inline Code.
|
|
19
|
+
* **Typography**: Hierarchical headings (H1-H6), Blockquotes, Dividers.
|
|
20
|
+
* **Fonts & Color**: Custom font families, text colors, and background highlights.
|
|
21
|
+
* **Lists**: Nested bullet and numbered lists with indentation controls.
|
|
22
|
+
* **Case Converter**: Toggle text between Uppercase, Lowercase, and Title Case.
|
|
23
|
+
* **Clear Formatting**: Instantly strip styles from copied text.
|
|
24
|
+
|
|
25
|
+
### 🖼️ Media & Embeds
|
|
26
|
+
* **Smart Images**: Drag & drop upload, resize, alignment positioning, captions, and link support.
|
|
27
|
+
* **Video Embedding**: YouTube integration with preview.
|
|
28
|
+
* **HTML Snippets**: Insert raw HTML for custom widgets or layouts.
|
|
29
|
+
* **Files**: Support for generic file attachments (extensible).
|
|
30
|
+
|
|
31
|
+
### 📊 Structured Content
|
|
32
|
+
* **Advanced Tables**: Header rows, cell merging, splitting, column resizing, and row/column management.
|
|
33
|
+
* **Code Blocks**: Syntax highlighting for multiple languages with copy support.
|
|
34
|
+
* **Table of Contents**: Auto-generated TOC based on document headings with scroll-spy.
|
|
35
|
+
* **Footnotes**: Academic-style referencing and footnotes.
|
|
36
|
+
* **Page Layout**: Page breaks and print-ready styles.
|
|
37
|
+
|
|
38
|
+
### 🚀 Productivity Tools
|
|
39
|
+
* **Slash Commands**: Type `/` to access a unified menu for all tools.
|
|
40
|
+
* **Format Painter**: Copy and paste styles between text blocks.
|
|
41
|
+
* **Find & Replace**: Search with match highlighting and bulk replacement.
|
|
42
|
+
* **Autosave**: Automatic local backup to prevent data loss.
|
|
43
|
+
* **Mentions & Tags**: Support for `@user` mentions or custom tags (configurable).
|
|
44
|
+
* **Placeholders / Merge Fields**: Insert dynamic variables like `{{FirstName}}`.
|
|
45
|
+
* **Emoji Picker**: Built-in library for expressive writing.
|
|
46
|
+
|
|
47
|
+
### 👀 View & Analysis
|
|
48
|
+
* **Document Outline**: Sidebar navigation for long documents.
|
|
49
|
+
* **Minimap**: VS Code-style minimap for quick scrolling.
|
|
50
|
+
* **Zen Mode**: Distraction-free full-screen writing.
|
|
51
|
+
* **Source View**: Edit the underlying HTML directly.
|
|
52
|
+
* **Word Count**: Real-time statistics.
|
|
53
|
+
|
|
54
|
+
### 🔄 Collaboration & History
|
|
55
|
+
* **Track Changes**: Suggestion mode (Accept/Reject changes).
|
|
56
|
+
* **Revision History**: visual history of edits (if backend connected).
|
|
57
|
+
* **Comments**: Threaded comments support (framework ready).
|
|
58
|
+
|
|
59
|
+
### 📤 Import / Export
|
|
60
|
+
* **PDF Export**: High-fidelity client-side PDF generation.
|
|
61
|
+
* **Word Support**: Import `.docx` files and export content to Word.
|
|
62
|
+
* **Markdown**: Full Markdown shortcut support (`##`, `*`, `>`).
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 📦 Installation
|
|
67
|
+
|
|
68
|
+
Install the package via npm:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install @seyamali/aurelia-editor
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🛠️ Usage
|
|
77
|
+
|
|
78
|
+
### Basic Setup
|
|
79
|
+
Initialize the editor by mounting it to a DOM element:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { AureliaEditor } from '@seyamali/aurelia-editor';
|
|
83
|
+
import '@seyamali/aurelia-editor/dist/style.css';
|
|
84
|
+
|
|
85
|
+
const editor = new AureliaEditor({
|
|
86
|
+
element: document.getElementById('editor-root'),
|
|
87
|
+
theme: 'default',
|
|
88
|
+
placeholder: 'Start writing...'
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
editor.render();
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Retrieval & Events
|
|
95
|
+
Listen to changes or get the content:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// Get HTML content
|
|
99
|
+
const html = editor.getHTML();
|
|
100
|
+
|
|
101
|
+
// Get JSON State
|
|
102
|
+
const jsonState = editor.getEditorState();
|
|
103
|
+
|
|
104
|
+
// Listen for updates
|
|
105
|
+
editor.on('update', (content) => {
|
|
106
|
+
console.log('Document updated:', content);
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## ⚙️ Configuration
|
|
113
|
+
|
|
114
|
+
Aurelia Editor features a dynamic toolbar system. You can switch between built-in presets or define your own configuration.
|
|
115
|
+
|
|
116
|
+
### Toolbar Presets
|
|
117
|
+
Available presets: `standard`, `minimal`, `blogging`, `full`.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { ToolbarConfigManager } from '@seyamali/aurelia-editor';
|
|
121
|
+
|
|
122
|
+
// Switch to a minimal, distraction-free interface
|
|
123
|
+
ToolbarConfigManager.applyPreset('minimal');
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## ⌨️ Shortcuts
|
|
129
|
+
|
|
130
|
+
| Context | Shortcut | Action |
|
|
131
|
+
| :--- | :--- | :--- |
|
|
132
|
+
| **Formatting** | `Ctrl + B` | Bold |
|
|
133
|
+
| | `Ctrl + I` | Italic |
|
|
134
|
+
| | `Ctrl + U` | Underline |
|
|
135
|
+
| **History** | `Ctrl + Z` | Undo |
|
|
136
|
+
| | `Ctrl + Y` | Redo |
|
|
137
|
+
| **Tools** | `/` | Slash Menu |
|
|
138
|
+
| | `Ctrl + F` | Find & Replace |
|
|
139
|
+
| | `Ctrl + S` | Save (Autosave trigger) |
|
|
140
|
+
| **Navigation** | `Ctrl + K` | Insert Link |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 📄 License & Attribution
|
|
145
|
+
|
|
146
|
+
This project is open-source software licensed under the **MIT License**.
|
|
147
|
+
|
|
148
|
+
### Terms of Use:
|
|
149
|
+
* ✅ **Commercial Use**: Allowed
|
|
150
|
+
* ✅ **Modification**: Allowed
|
|
151
|
+
* ✅ **Private Use**: Allowed
|
|
152
|
+
* ⚠️ **Attribution Required**: You must retain the copyright notice and license file in your source code.
|
|
153
|
+
|
|
154
|
+
**Copyright © 2026 Seyam Ali**. All rights reserved.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { EditorPlugin } from './registry';
|
|
3
|
+
export declare class AureliaEditor {
|
|
4
|
+
private editor;
|
|
5
|
+
private registry;
|
|
6
|
+
constructor(element: HTMLDivElement);
|
|
7
|
+
use(plugin: EditorPlugin): void;
|
|
8
|
+
execute(command: any, payload?: any): void;
|
|
9
|
+
update(updateFn: () => void): void;
|
|
10
|
+
getInternalEditor(): LexicalEditor;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { EditorSDK } from './sdk';
|
|
3
|
+
export interface EditorPlugin {
|
|
4
|
+
name: string;
|
|
5
|
+
init: (sdk: EditorSDK) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class PluginRegistry {
|
|
8
|
+
private plugins;
|
|
9
|
+
private sdk;
|
|
10
|
+
constructor(editor: LexicalEditor);
|
|
11
|
+
register(plugin: EditorPlugin): void;
|
|
12
|
+
getSDK(): EditorSDK;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LexicalEditor, LexicalCommand, CommandListenerPriority } from 'lexical';
|
|
2
|
+
/**
|
|
3
|
+
* The EditorSDK provides a stable, simplified interface for plugin developers
|
|
4
|
+
* to interact with the AureliaEditor without needing deep knowledge of Lexical internals.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EditorSDK {
|
|
7
|
+
private editor;
|
|
8
|
+
constructor(editor: LexicalEditor);
|
|
9
|
+
/**
|
|
10
|
+
* Get the underlying Lexical editor instance.
|
|
11
|
+
*/
|
|
12
|
+
getLexicalEditor(): LexicalEditor;
|
|
13
|
+
/**
|
|
14
|
+
* Dispatch a command to the editor.
|
|
15
|
+
*/
|
|
16
|
+
dispatchCommand<T>(command: LexicalCommand<T>, payload: T): void;
|
|
17
|
+
/**
|
|
18
|
+
* Register a command with the editor.
|
|
19
|
+
*/
|
|
20
|
+
registerCommand<P>(command: LexicalCommand<P>, handler: (payload: P) => boolean, priority: CommandListenerPriority): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Register an update listener.
|
|
23
|
+
*/
|
|
24
|
+
registerUpdateListener(listener: any): () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Run an update on the editor state.
|
|
27
|
+
*/
|
|
28
|
+
update(updateFn: () => void): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get the editor root element.
|
|
31
|
+
*/
|
|
32
|
+
getRootElement(): HTMLElement | null;
|
|
33
|
+
/**
|
|
34
|
+
* Check if nodes are registered.
|
|
35
|
+
*/
|
|
36
|
+
hasNodes(nodes: Array<any>): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Get a node element by its key.
|
|
39
|
+
*/
|
|
40
|
+
getElementByKey(key: string): HTMLElement | null;
|
|
41
|
+
/**
|
|
42
|
+
* Announce a message to screen readers (Accessibility).
|
|
43
|
+
*/
|
|
44
|
+
announce(message: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Register a new button on the toolbar programmatically.
|
|
47
|
+
* @param buttonConfig Configuration for the new button.
|
|
48
|
+
*/
|
|
49
|
+
addToolbarButton(config: {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
icon?: string;
|
|
53
|
+
onClick: () => void;
|
|
54
|
+
tooltip?: string;
|
|
55
|
+
i18nKey?: string;
|
|
56
|
+
}): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupCounter(element: HTMLButtonElement): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { J as r, f as i } from "./index-C9G087KG.js";
|
|
2
|
+
import { $getSelection as n, COMMAND_PRIORITY_EDITOR as a } from "lexical";
|
|
3
|
+
import { $insertNodeToNearestRoot as l } from "@lexical/utils";
|
|
4
|
+
const d = {
|
|
5
|
+
name: "HorizontalRulePlugin",
|
|
6
|
+
init: (e) => {
|
|
7
|
+
const t = e.getLexicalEditor();
|
|
8
|
+
t.registerCommand(
|
|
9
|
+
r,
|
|
10
|
+
() => t.getEditorState().read(() => n()) ? (t.update(() => {
|
|
11
|
+
const o = i();
|
|
12
|
+
l(o);
|
|
13
|
+
}), !0) : !1,
|
|
14
|
+
a
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
d as HorizontalRulePlugin
|
|
20
|
+
};
|