@lakamark/modulo-editor 0.2.0-alpha.1
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 +73 -0
- package/dist/modulo-editor.js +1018 -0
- package/dist/modulo-editor.js.map +1 -0
- package/dist/modulo-editor.umd.cjs +5 -0
- package/dist/modulo-editor.umd.cjs.map +1 -0
- package/dist/types/commands/builtin/BoldCommand.d.ts +9 -0
- package/dist/types/commands/builtin/BoldCommand.d.ts.map +1 -0
- package/dist/types/commands/builtin/HeadingCommand.d.ts +8 -0
- package/dist/types/commands/builtin/HeadingCommand.d.ts.map +1 -0
- package/dist/types/commands/builtin/ItalicCommand.d.ts +6 -0
- package/dist/types/commands/builtin/ItalicCommand.d.ts.map +1 -0
- package/dist/types/commands/builtin/index.d.ts +11 -0
- package/dist/types/commands/builtin/index.d.ts.map +1 -0
- package/dist/types/commands/contracts/EditorCommand.d.ts +18 -0
- package/dist/types/commands/contracts/EditorCommand.d.ts.map +1 -0
- package/dist/types/commands/contracts/EditorCommandContext.d.ts +15 -0
- package/dist/types/commands/contracts/EditorCommandContext.d.ts.map +1 -0
- package/dist/types/commands/contracts/EditorInput.d.ts +14 -0
- package/dist/types/commands/contracts/EditorInput.d.ts.map +1 -0
- package/dist/types/commands/contracts/index.d.ts +4 -0
- package/dist/types/commands/contracts/index.d.ts.map +1 -0
- package/dist/types/commands/index.d.ts +5 -0
- package/dist/types/commands/index.d.ts.map +1 -0
- package/dist/types/commands/registry/EditorCommandRegistry.d.ts +28 -0
- package/dist/types/commands/registry/EditorCommandRegistry.d.ts.map +1 -0
- package/dist/types/commands/registry/EditorCommandsApi.d.ts +14 -0
- package/dist/types/commands/registry/EditorCommandsApi.d.ts.map +1 -0
- package/dist/types/commands/registry/RegistryEditorCommandsApi.d.ts +20 -0
- package/dist/types/commands/registry/RegistryEditorCommandsApi.d.ts.map +1 -0
- package/dist/types/commands/registry/index.d.ts +4 -0
- package/dist/types/commands/registry/index.d.ts.map +1 -0
- package/dist/types/commands/setup/assertCustomCommandsAreValid.d.ts +12 -0
- package/dist/types/commands/setup/assertCustomCommandsAreValid.d.ts.map +1 -0
- package/dist/types/commands/setup/builtin-command-names.d.ts +16 -0
- package/dist/types/commands/setup/builtin-command-names.d.ts.map +1 -0
- package/dist/types/commands/setup/index.d.ts +6 -0
- package/dist/types/commands/setup/index.d.ts.map +1 -0
- package/dist/types/commands/setup/resolveBuiltinCommands.d.ts +4 -0
- package/dist/types/commands/setup/resolveBuiltinCommands.d.ts.map +1 -0
- package/dist/types/commands/setup/setupEditorCommands.d.ts +30 -0
- package/dist/types/commands/setup/setupEditorCommands.d.ts.map +1 -0
- package/dist/types/core/Builder/DefaultModuloEditorBuilder.d.ts +117 -0
- package/dist/types/core/Builder/DefaultModuloEditorBuilder.d.ts.map +1 -0
- package/dist/types/core/Builder/index.d.ts +2 -0
- package/dist/types/core/Builder/index.d.ts.map +1 -0
- package/dist/types/core/DefaultEditorDocument.d.ts +11 -0
- package/dist/types/core/DefaultEditorDocument.d.ts.map +1 -0
- package/dist/types/core/ModuloEditor.d.ts +93 -0
- package/dist/types/core/ModuloEditor.d.ts.map +1 -0
- package/dist/types/core/contracts/EditorDocument.d.ts +16 -0
- package/dist/types/core/contracts/EditorDocument.d.ts.map +1 -0
- package/dist/types/core/contracts/ModuloEditorBuilder.d.ts +23 -0
- package/dist/types/core/contracts/ModuloEditorBuilder.d.ts.map +1 -0
- package/dist/types/core/contracts/ModuloEditorOptions.d.ts +52 -0
- package/dist/types/core/contracts/ModuloEditorOptions.d.ts.map +1 -0
- package/dist/types/core/contracts/index.d.ts +4 -0
- package/dist/types/core/contracts/index.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +6 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/dom/DefaultEditorDomResolver.d.ts +42 -0
- package/dist/types/dom/DefaultEditorDomResolver.d.ts.map +1 -0
- package/dist/types/dom/contracts/EditorDomResolver.d.ts +20 -0
- package/dist/types/dom/contracts/EditorDomResolver.d.ts.map +1 -0
- package/dist/types/dom/contracts/EditorDomSlots.d.ts +62 -0
- package/dist/types/dom/contracts/EditorDomSlots.d.ts.map +1 -0
- package/dist/types/dom/contracts/index.d.ts +3 -0
- package/dist/types/dom/contracts/index.d.ts.map +1 -0
- package/dist/types/dom/index.d.ts +2 -0
- package/dist/types/dom/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/input/EditorInputAdapter.d.ts +17 -0
- package/dist/types/input/EditorInputAdapter.d.ts.map +1 -0
- package/dist/types/input/EditorInputState.d.ts +6 -0
- package/dist/types/input/EditorInputState.d.ts.map +1 -0
- package/dist/types/input/TextareaInputAdapter.d.ts +18 -0
- package/dist/types/input/TextareaInputAdapter.d.ts.map +1 -0
- package/dist/types/input/index.d.ts +4 -0
- package/dist/types/input/index.d.ts.map +1 -0
- package/dist/types/markdown/config/ConfigurableHtmlSanitizer.d.ts +23 -0
- package/dist/types/markdown/config/ConfigurableHtmlSanitizer.d.ts.map +1 -0
- package/dist/types/markdown/config/DefaultHtmlSanitizerConfig.d.ts +6 -0
- package/dist/types/markdown/config/DefaultHtmlSanitizerConfig.d.ts.map +1 -0
- package/dist/types/markdown/config/HtmlSanitizerConfig.d.ts +14 -0
- package/dist/types/markdown/config/HtmlSanitizerConfig.d.ts.map +1 -0
- package/dist/types/markdown/config/index.d.ts +4 -0
- package/dist/types/markdown/config/index.d.ts.map +1 -0
- package/dist/types/markdown/contracts/HtmlSanitizer.d.ts +15 -0
- package/dist/types/markdown/contracts/HtmlSanitizer.d.ts.map +1 -0
- package/dist/types/markdown/contracts/MarkdownParser.d.ts +12 -0
- package/dist/types/markdown/contracts/MarkdownParser.d.ts.map +1 -0
- package/dist/types/markdown/contracts/MarkdownProcessor.d.ts +12 -0
- package/dist/types/markdown/contracts/MarkdownProcessor.d.ts.map +1 -0
- package/dist/types/markdown/contracts/index.d.ts +4 -0
- package/dist/types/markdown/contracts/index.d.ts.map +1 -0
- package/dist/types/markdown/index.d.ts +6 -0
- package/dist/types/markdown/index.d.ts.map +1 -0
- package/dist/types/markdown/parser/DefaultMarkdownProcessor.d.ts +18 -0
- package/dist/types/markdown/parser/DefaultMarkdownProcessor.d.ts.map +1 -0
- package/dist/types/markdown/parser/PlainTextMarkdownParser.d.ts +11 -0
- package/dist/types/markdown/parser/PlainTextMarkdownParser.d.ts.map +1 -0
- package/dist/types/markdown/parser/index.d.ts +3 -0
- package/dist/types/markdown/parser/index.d.ts.map +1 -0
- package/dist/types/markdown/sanitizers/DomPurifyHtmlSanitizer.d.ts +27 -0
- package/dist/types/markdown/sanitizers/DomPurifyHtmlSanitizer.d.ts.map +1 -0
- package/dist/types/markdown/sanitizers/NoopHtmlSanitizer.d.ts +11 -0
- package/dist/types/markdown/sanitizers/NoopHtmlSanitizer.d.ts.map +1 -0
- package/dist/types/markdown/sanitizers/index.d.ts +3 -0
- package/dist/types/markdown/sanitizers/index.d.ts.map +1 -0
- package/dist/types/output/EditorOutputAdapter.d.ts +25 -0
- package/dist/types/output/EditorOutputAdapter.d.ts.map +1 -0
- package/dist/types/output/HtmlPreviewAdapter.d.ts +20 -0
- package/dist/types/output/HtmlPreviewAdapter.d.ts.map +1 -0
- package/dist/types/output/index.d.ts +3 -0
- package/dist/types/output/index.d.ts.map +1 -0
- package/dist/types/plugins/contracts/EditorPlugin.d.ts +19 -0
- package/dist/types/plugins/contracts/EditorPlugin.d.ts.map +1 -0
- package/dist/types/plugins/contracts/EditorPluginApi.d.ts +11 -0
- package/dist/types/plugins/contracts/EditorPluginApi.d.ts.map +1 -0
- package/dist/types/plugins/contracts/index.d.ts +3 -0
- package/dist/types/plugins/contracts/index.d.ts.map +1 -0
- package/dist/types/plugins/index.d.ts +3 -0
- package/dist/types/plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/base/CommandButtonPlugin.d.ts +31 -0
- package/dist/types/plugins/toolbar/base/CommandButtonPlugin.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/base/CommandButtonPluginOptions.d.ts +23 -0
- package/dist/types/plugins/toolbar/base/CommandButtonPluginOptions.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/base/index.d.ts +3 -0
- package/dist/types/plugins/toolbar/base/index.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/buttons/BoldToolbarPlugin.d.ts +8 -0
- package/dist/types/plugins/toolbar/buttons/BoldToolbarPlugin.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/buttons/HeadingToolbarPlugin.d.ts +5 -0
- package/dist/types/plugins/toolbar/buttons/HeadingToolbarPlugin.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/buttons/ItalicToolbarPlugin.d.ts +5 -0
- package/dist/types/plugins/toolbar/buttons/ItalicToolbarPlugin.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/buttons/index.d.ts +4 -0
- package/dist/types/plugins/toolbar/buttons/index.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/createDefaultToolbarPlugins.d.ts +6 -0
- package/dist/types/plugins/toolbar/createDefaultToolbarPlugins.d.ts.map +1 -0
- package/dist/types/plugins/toolbar/index.d.ts +4 -0
- package/dist/types/plugins/toolbar/index.d.ts.map +1 -0
- package/dist/types/textarea/HiddenTextareaBridge.d.ts +12 -0
- package/dist/types/textarea/HiddenTextareaBridge.d.ts.map +1 -0
- package/dist/types/textarea/TextareaBridge.d.ts +24 -0
- package/dist/types/textarea/TextareaBridge.d.ts.map +1 -0
- package/dist/types/textarea/index.d.ts +3 -0
- package/dist/types/textarea/index.d.ts.map +1 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marc-Antoine Lacasse
|
|
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,73 @@
|
|
|
1
|
+
# ModuloEditor
|
|
2
|
+
Modular Markdown editor with plugins and textarea support.
|
|
3
|
+
|
|
4
|
+
> ⚠️ This project is in early alpha. The API is not stable yet. Do not use in production.
|
|
5
|
+
|
|
6
|
+
## Features (planned)
|
|
7
|
+
- Modular architecture
|
|
8
|
+
- Plugin API
|
|
9
|
+
- Interchangeable editor input
|
|
10
|
+
- Interchangeable preview output
|
|
11
|
+
- Safe HTML rendering
|
|
12
|
+
- Textarea form integration
|
|
13
|
+
- Toolbar extensions
|
|
14
|
+
- Command system
|
|
15
|
+
|
|
16
|
+
## HTML structure
|
|
17
|
+
```html
|
|
18
|
+
<div class="mo-editor" data-mo-editor>
|
|
19
|
+
<!-- Header editor -->
|
|
20
|
+
<div class="mo-editor__header" data-mo-editor-header>
|
|
21
|
+
<div class="mo-editor__toolbar" data-mo-editor-toolbar></div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Body editor -->
|
|
25
|
+
<div class="mo-editor__body" data-mo-editor-body>
|
|
26
|
+
<div class="mo-editor__input" data-mo-editor-input></div>
|
|
27
|
+
<div class="mo-editor__preview" data-mo-editor-preview></div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<!-- Footer editor -->
|
|
31
|
+
<div class="mo-editor__footer" data-mo-editor-footer>
|
|
32
|
+
<div class="mo-editor__status" data-mo-editor-status></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- Hidden textarea for a classic form submitted -->
|
|
36
|
+
<textarea id="content" name="content" hidden data-mo-editor-textarea></textarea>
|
|
37
|
+
</div>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Goals
|
|
41
|
+
ModuloEditor is designed to be:
|
|
42
|
+
* extensible
|
|
43
|
+
* framework-agnostic
|
|
44
|
+
* safe by default
|
|
45
|
+
* plugin driven
|
|
46
|
+
* form friendly
|
|
47
|
+
* TypeScript first
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
Install dependencies
|
|
52
|
+
```bash
|
|
53
|
+
npm install
|
|
54
|
+
```
|
|
55
|
+
## Run the playground
|
|
56
|
+
```bash
|
|
57
|
+
npm run dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Run tests
|
|
61
|
+
```bash
|
|
62
|
+
npm run test
|
|
63
|
+
```
|
|
64
|
+
## Run test in watch mode
|
|
65
|
+
```bash
|
|
66
|
+
npm run test:watch
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Status
|
|
70
|
+
Early development — core architecture in progress.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
MIT
|