@malva-ui/editor 0.1.12 → 0.1.14
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 +80 -0
- package/fesm2022/malva-ui-editor-ai.mjs +17 -0
- package/fesm2022/malva-ui-editor-ai.mjs.map +1 -0
- package/fesm2022/malva-ui-editor.mjs +10227 -0
- package/fesm2022/malva-ui-editor.mjs.map +1 -0
- package/package.json +47 -26
- package/types/malva-ui-editor-ai.d.ts +1 -0
- package/types/malva-ui-editor.d.ts +2995 -0
- package/ai/index.d.ts +0 -12
- package/ai/malva-ui-editor-ai.d.ts +0 -5
- package/esm2022/ai/index.js +0 -12
- package/esm2022/ai/index.js.map +0 -1
- package/esm2022/ai/malva-ui-editor-ai.js +0 -5
- package/esm2022/ai/malva-ui-editor-ai.js.map +0 -1
- package/esm2022/index.js +0 -37
- package/esm2022/index.js.map +0 -1
- package/esm2022/lib/ai/editor-ai-actions.js +0 -69
- package/esm2022/lib/ai/editor-ai-actions.js.map +0 -1
- package/esm2022/lib/ai/editor-ai-context.js +0 -612
- package/esm2022/lib/ai/editor-ai-context.js.map +0 -1
- package/esm2022/lib/ai/editor-ai-menu.js +0 -288
- package/esm2022/lib/ai/editor-ai-menu.js.map +0 -1
- package/esm2022/lib/ai/editor-ai-review-bar.js +0 -223
- package/esm2022/lib/ai/editor-ai-review-bar.js.map +0 -1
- package/esm2022/lib/ai/editor-ai-stream.js +0 -677
- package/esm2022/lib/ai/editor-ai-stream.js.map +0 -1
- package/esm2022/lib/ai/editor-ai-suggestions.js +0 -751
- package/esm2022/lib/ai/editor-ai-suggestions.js.map +0 -1
- package/esm2022/lib/ai/editor-ai.tokens.js +0 -10
- package/esm2022/lib/ai/editor-ai.tokens.js.map +0 -1
- package/esm2022/lib/ai/editor-ai.types.js +0 -1
- package/esm2022/lib/ai/editor-ai.types.js.map +0 -1
- package/esm2022/lib/editor/editor.js +0 -985
- package/esm2022/lib/editor/editor.js.map +0 -1
- package/esm2022/lib/editor-extension-preflight.js +0 -83
- package/esm2022/lib/editor-extension-preflight.js.map +0 -1
- package/esm2022/lib/editor-serialization.js +0 -152
- package/esm2022/lib/editor-serialization.js.map +0 -1
- package/esm2022/lib/editor-toolbar-context.js +0 -259
- package/esm2022/lib/editor-toolbar-context.js.map +0 -1
- package/esm2022/lib/editor.tokens.js +0 -10
- package/esm2022/lib/editor.tokens.js.map +0 -1
- package/esm2022/lib/editor.types.js +0 -48
- package/esm2022/lib/editor.types.js.map +0 -1
- package/esm2022/lib/extensions/editor-block-handle.js +0 -760
- package/esm2022/lib/extensions/editor-block-handle.js.map +0 -1
- package/esm2022/lib/extensions/editor-extensions.js +0 -321
- package/esm2022/lib/extensions/editor-extensions.js.map +0 -1
- package/esm2022/lib/extensions/editor-markdown-compatibility.js +0 -162
- package/esm2022/lib/extensions/editor-markdown-compatibility.js.map +0 -1
- package/esm2022/lib/extensions/editor-upload-placeholder.js +0 -156
- package/esm2022/lib/extensions/editor-upload-placeholder.js.map +0 -1
- package/esm2022/lib/status/editor-status.js +0 -64
- package/esm2022/lib/status/editor-status.js.map +0 -1
- package/esm2022/lib/toolbar/editor-alignment.js +0 -203
- package/esm2022/lib/toolbar/editor-alignment.js.map +0 -1
- package/esm2022/lib/toolbar/editor-block-insert.js +0 -101
- package/esm2022/lib/toolbar/editor-block-insert.js.map +0 -1
- package/esm2022/lib/toolbar/editor-color-control.js +0 -71
- package/esm2022/lib/toolbar/editor-color-control.js.map +0 -1
- package/esm2022/lib/toolbar/editor-command-button.js +0 -115
- package/esm2022/lib/toolbar/editor-command-button.js.map +0 -1
- package/esm2022/lib/toolbar/editor-heading.js +0 -266
- package/esm2022/lib/toolbar/editor-heading.js.map +0 -1
- package/esm2022/lib/toolbar/editor-highlight.js +0 -84
- package/esm2022/lib/toolbar/editor-highlight.js.map +0 -1
- package/esm2022/lib/toolbar/editor-image-upload-dialog.js +0 -289
- package/esm2022/lib/toolbar/editor-image-upload-dialog.js.map +0 -1
- package/esm2022/lib/toolbar/editor-image-upload.js +0 -315
- package/esm2022/lib/toolbar/editor-image-upload.js.map +0 -1
- package/esm2022/lib/toolbar/editor-inline-marks.js +0 -124
- package/esm2022/lib/toolbar/editor-inline-marks.js.map +0 -1
- package/esm2022/lib/toolbar/editor-link.js +0 -265
- package/esm2022/lib/toolbar/editor-link.js.map +0 -1
- package/esm2022/lib/toolbar/editor-list.js +0 -249
- package/esm2022/lib/toolbar/editor-list.js.map +0 -1
- package/esm2022/lib/toolbar/editor-table.js +0 -292
- package/esm2022/lib/toolbar/editor-table.js.map +0 -1
- package/esm2022/lib/toolbar/editor-text-color.js +0 -82
- package/esm2022/lib/toolbar/editor-text-color.js.map +0 -1
- package/esm2022/lib/toolbar/editor-toolbar-widget.js +0 -41
- package/esm2022/lib/toolbar/editor-toolbar-widget.js.map +0 -1
- package/esm2022/lib/toolbar/editor-toolbar.defs.js +0 -60
- package/esm2022/lib/toolbar/editor-toolbar.defs.js.map +0 -1
- package/esm2022/lib/toolbar/editor-toolbar.js +0 -826
- package/esm2022/lib/toolbar/editor-toolbar.js.map +0 -1
- package/esm2022/lib/toolbar/editor-undo-redo.js +0 -72
- package/esm2022/lib/toolbar/editor-undo-redo.js.map +0 -1
- package/esm2022/lib/toolbar/editor-zoom.js +0 -330
- package/esm2022/lib/toolbar/editor-zoom.js.map +0 -1
- package/esm2022/lib/upload/editor-image-upload-coordinator.js +0 -480
- package/esm2022/lib/upload/editor-image-upload-coordinator.js.map +0 -1
- package/esm2022/malva-ui-editor.js +0 -5
- package/esm2022/malva-ui-editor.js.map +0 -1
- package/index.d.ts +0 -35
- package/lib/ai/editor-ai-actions.d.ts +0 -27
- package/lib/ai/editor-ai-context.d.ts +0 -307
- package/lib/ai/editor-ai-menu.d.ts +0 -142
- package/lib/ai/editor-ai-review-bar.d.ts +0 -116
- package/lib/ai/editor-ai-stream.d.ts +0 -207
- package/lib/ai/editor-ai-suggestions.d.ts +0 -219
- package/lib/ai/editor-ai.tokens.d.ts +0 -10
- package/lib/ai/editor-ai.types.d.ts +0 -176
- package/lib/editor/editor.d.ts +0 -243
- package/lib/editor-extension-preflight.d.ts +0 -23
- package/lib/editor-serialization.d.ts +0 -74
- package/lib/editor-toolbar-context.d.ts +0 -116
- package/lib/editor.tokens.d.ts +0 -6
- package/lib/editor.types.d.ts +0 -194
- package/lib/extensions/editor-block-handle.d.ts +0 -59
- package/lib/extensions/editor-extensions.d.ts +0 -165
- package/lib/extensions/editor-markdown-compatibility.d.ts +0 -11
- package/lib/extensions/editor-upload-placeholder.d.ts +0 -75
- package/lib/status/editor-status.d.ts +0 -24
- package/lib/toolbar/editor-alignment.d.ts +0 -61
- package/lib/toolbar/editor-block-insert.d.ts +0 -26
- package/lib/toolbar/editor-color-control.d.ts +0 -32
- package/lib/toolbar/editor-command-button.d.ts +0 -29
- package/lib/toolbar/editor-heading.d.ts +0 -68
- package/lib/toolbar/editor-highlight.d.ts +0 -21
- package/lib/toolbar/editor-image-upload-dialog.d.ts +0 -96
- package/lib/toolbar/editor-image-upload.d.ts +0 -71
- package/lib/toolbar/editor-inline-marks.d.ts +0 -30
- package/lib/toolbar/editor-link.d.ts +0 -78
- package/lib/toolbar/editor-list.d.ts +0 -67
- package/lib/toolbar/editor-table.d.ts +0 -133
- package/lib/toolbar/editor-text-color.d.ts +0 -21
- package/lib/toolbar/editor-toolbar-widget.d.ts +0 -19
- package/lib/toolbar/editor-toolbar.d.ts +0 -157
- package/lib/toolbar/editor-toolbar.defs.d.ts +0 -35
- package/lib/toolbar/editor-undo-redo.d.ts +0 -26
- package/lib/toolbar/editor-zoom.d.ts +0 -108
- package/lib/upload/editor-image-upload-coordinator.d.ts +0 -55
- package/malva-ui-editor.d.ts +0 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Malva UI
|
|
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,80 @@
|
|
|
1
|
+
# @malva-ui/editor
|
|
2
|
+
|
|
3
|
+
Rich-text editor for [Malva UI](https://www.npmjs.com/package/@malva-ui/core) — an SSR-safe Angular shell around a single browser-only [Tiptap](https://tiptap.dev) instance.
|
|
4
|
+
|
|
5
|
+
Ships as its own package so applications that never render an editor never pull in Tiptap: every `@tiptap/*` peer lives here, not in `@malva-ui/core`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @malva-ui/editor
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Tiptap is a peer dependency set, so install it alongside:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/extensions @tiptap/markdown @tiptap/extension-file-handler @tiptap/extension-highlight @tiptap/extension-image @tiptap/extension-list @tiptap/extension-table @tiptap/extension-text-align @tiptap/extension-text-style
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { MlvEditor } from '@malva-ui/editor';
|
|
23
|
+
|
|
24
|
+
@Component({ imports: [MlvEditor] })
|
|
25
|
+
export class ReleaseNotes {
|
|
26
|
+
readonly value = signal<string | null>('<p>Hello</p>');
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<mlv-editor [(value)]="value" label="Release notes" ariaLabel="Release notes editor" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Value formats
|
|
35
|
+
|
|
36
|
+
`format` selects what the two-way `value` model holds:
|
|
37
|
+
|
|
38
|
+
| `format` | `value` shape |
|
|
39
|
+
| ------------ | ------------------------------- |
|
|
40
|
+
| `'html'` | HTML string (default) |
|
|
41
|
+
| `'markdown'` | Markdown string |
|
|
42
|
+
| `'json'` | Serialised Tiptap JSON document |
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<mlv-editor [(value)]="markdown" format="markdown" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`value` is nullable — setting it to `null` clears the document.
|
|
49
|
+
|
|
50
|
+
## Features
|
|
51
|
+
|
|
52
|
+
- Composable extension presets, or pass your own via `extensions`
|
|
53
|
+
- Replaceable command toolbar
|
|
54
|
+
- Image uploads with an upload-placeholder extension
|
|
55
|
+
- Block drag reordering via a block handle
|
|
56
|
+
- Server-side rendering safe: Tiptap is only constructed in the browser
|
|
57
|
+
|
|
58
|
+
## AI toolkit
|
|
59
|
+
|
|
60
|
+
`@malva-ui/editor/ai` adds an optional AI surface — an action menu, a streaming transform contract, and an inline suggestion/review bar with word-level diffs:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import { MlvEditorAiMenu, MLV_EDITOR_AI_CONTEXT } from '@malva-ui/editor/ai';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
You supply the model call; the package owns the editing UX around it.
|
|
67
|
+
|
|
68
|
+
## Peer dependencies
|
|
69
|
+
|
|
70
|
+
`@angular/cdk`, `@angular/common`, `@angular/core`, `@angular/forms`, `@lucide/angular`, `rxjs`, `@malva-ui/core`, `@malva-ui/cdk`, `@malva-ui/i18n`, and the twelve `@tiptap/*` packages listed above.
|
|
71
|
+
|
|
72
|
+
## Related packages
|
|
73
|
+
|
|
74
|
+
- [`@malva-ui/core`](https://www.npmjs.com/package/@malva-ui/core) — the component library
|
|
75
|
+
- [`@malva-ui/cdk`](https://www.npmjs.com/package/@malva-ui/cdk) — headless primitives
|
|
76
|
+
- [`@malva-ui/i18n`](https://www.npmjs.com/package/@malva-ui/i18n) — localisation
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { MLV_EDITOR_AI_CARET_CLASS, MLV_EDITOR_AI_CONTEXT, MLV_EDITOR_AI_PROVIDER, MLV_EDITOR_AI_STREAMING_CHUNK_CLASS, MLV_EDITOR_AI_STREAMING_CLASS, MLV_EDITOR_AI_SUGGESTION_CURRENT_CLASS, MLV_EDITOR_AI_SUGGESTION_DELETE_CLASS, MLV_EDITOR_AI_SUGGESTION_INSERT_CLASS, MlvEditorAiContext, MlvEditorAiMenu, MlvEditorAiReviewBar, applyMlvEditorAiSuggestions, mlvEditorAiDefaultActions, runMlvEditorAiStream } from '@malva-ui/editor';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public surface of `@malva-ui/editor/ai`.
|
|
5
|
+
*
|
|
6
|
+
* The implementation lives in the primary entry point: `mlv-editor` provides
|
|
7
|
+
* the per-editor AI context, and the primary entry importing this secondary
|
|
8
|
+
* one (which already depends on the primary) would be a package cycle. This
|
|
9
|
+
* barrel re-exports the toolkit under its documented import path, so
|
|
10
|
+
* consumers keep importing `@malva-ui/editor/ai` and symbol identity is a
|
|
11
|
+
* single module in every build.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Generated bundle index. Do not edit.
|
|
16
|
+
*/
|
|
17
|
+
//# sourceMappingURL=malva-ui-editor-ai.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"malva-ui-editor-ai.mjs","sources":["../../../../libs/editor/ai/src/index.ts","../../../../libs/editor/ai/src/malva-ui-editor-ai.ts"],"sourcesContent":["/**\n * Public surface of `@malva-ui/editor/ai`.\n *\n * The implementation lives in the primary entry point: `mlv-editor` provides\n * the per-editor AI context, and the primary entry importing this secondary\n * one (which already depends on the primary) would be a package cycle. This\n * barrel re-exports the toolkit under its documented import path, so\n * consumers keep importing `@malva-ui/editor/ai` and symbol identity is a\n * single module in every build.\n */\nexport {\n applyMlvEditorAiSuggestions,\n MLV_EDITOR_AI_CARET_CLASS,\n MLV_EDITOR_AI_CONTEXT,\n MLV_EDITOR_AI_PROVIDER,\n MLV_EDITOR_AI_STREAMING_CHUNK_CLASS,\n MLV_EDITOR_AI_STREAMING_CLASS,\n MLV_EDITOR_AI_SUGGESTION_CURRENT_CLASS,\n MLV_EDITOR_AI_SUGGESTION_DELETE_CLASS,\n MLV_EDITOR_AI_SUGGESTION_INSERT_CLASS,\n MlvEditorAiContext,\n mlvEditorAiDefaultActions,\n MlvEditorAiMenu,\n MlvEditorAiReviewBar,\n runMlvEditorAiStream,\n} from '@malva-ui/editor';\nexport type {\n MlvEditorAiAction,\n MlvEditorAiBuiltInTransformKind,\n MlvEditorAiFrameScheduler,\n MlvEditorAiOutputMode,\n MlvEditorAiProvider,\n MlvEditorAiRequest,\n MlvEditorAiReviewSuggestion,\n MlvEditorAiStatus,\n MlvEditorAiStreamErrorCode,\n MlvEditorAiStreamHandle,\n MlvEditorAiStreamOptions,\n MlvEditorAiStreamOutputMode,\n MlvEditorAiStreamResult,\n MlvEditorAiStreamStatus,\n MlvEditorAiSuggestion,\n MlvEditorAiSuggestionKind,\n MlvEditorAiSuggestionRange,\n MlvEditorAiSuggestionsOptions,\n MlvEditorAiSuggestionsSession,\n MlvEditorAiTransformKind,\n MlvEditorAiTransformOptions,\n} from '@malva-ui/editor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;AASG;;ACTH;;AAEG"}
|