@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.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/fesm2022/malva-ui-editor-ai.mjs +17 -0
  4. package/fesm2022/malva-ui-editor-ai.mjs.map +1 -0
  5. package/fesm2022/malva-ui-editor.mjs +10227 -0
  6. package/fesm2022/malva-ui-editor.mjs.map +1 -0
  7. package/package.json +47 -26
  8. package/types/malva-ui-editor-ai.d.ts +1 -0
  9. package/types/malva-ui-editor.d.ts +2995 -0
  10. package/ai/index.d.ts +0 -12
  11. package/ai/malva-ui-editor-ai.d.ts +0 -5
  12. package/esm2022/ai/index.js +0 -12
  13. package/esm2022/ai/index.js.map +0 -1
  14. package/esm2022/ai/malva-ui-editor-ai.js +0 -5
  15. package/esm2022/ai/malva-ui-editor-ai.js.map +0 -1
  16. package/esm2022/index.js +0 -37
  17. package/esm2022/index.js.map +0 -1
  18. package/esm2022/lib/ai/editor-ai-actions.js +0 -69
  19. package/esm2022/lib/ai/editor-ai-actions.js.map +0 -1
  20. package/esm2022/lib/ai/editor-ai-context.js +0 -612
  21. package/esm2022/lib/ai/editor-ai-context.js.map +0 -1
  22. package/esm2022/lib/ai/editor-ai-menu.js +0 -288
  23. package/esm2022/lib/ai/editor-ai-menu.js.map +0 -1
  24. package/esm2022/lib/ai/editor-ai-review-bar.js +0 -223
  25. package/esm2022/lib/ai/editor-ai-review-bar.js.map +0 -1
  26. package/esm2022/lib/ai/editor-ai-stream.js +0 -677
  27. package/esm2022/lib/ai/editor-ai-stream.js.map +0 -1
  28. package/esm2022/lib/ai/editor-ai-suggestions.js +0 -751
  29. package/esm2022/lib/ai/editor-ai-suggestions.js.map +0 -1
  30. package/esm2022/lib/ai/editor-ai.tokens.js +0 -10
  31. package/esm2022/lib/ai/editor-ai.tokens.js.map +0 -1
  32. package/esm2022/lib/ai/editor-ai.types.js +0 -1
  33. package/esm2022/lib/ai/editor-ai.types.js.map +0 -1
  34. package/esm2022/lib/editor/editor.js +0 -985
  35. package/esm2022/lib/editor/editor.js.map +0 -1
  36. package/esm2022/lib/editor-extension-preflight.js +0 -83
  37. package/esm2022/lib/editor-extension-preflight.js.map +0 -1
  38. package/esm2022/lib/editor-serialization.js +0 -152
  39. package/esm2022/lib/editor-serialization.js.map +0 -1
  40. package/esm2022/lib/editor-toolbar-context.js +0 -259
  41. package/esm2022/lib/editor-toolbar-context.js.map +0 -1
  42. package/esm2022/lib/editor.tokens.js +0 -10
  43. package/esm2022/lib/editor.tokens.js.map +0 -1
  44. package/esm2022/lib/editor.types.js +0 -48
  45. package/esm2022/lib/editor.types.js.map +0 -1
  46. package/esm2022/lib/extensions/editor-block-handle.js +0 -760
  47. package/esm2022/lib/extensions/editor-block-handle.js.map +0 -1
  48. package/esm2022/lib/extensions/editor-extensions.js +0 -321
  49. package/esm2022/lib/extensions/editor-extensions.js.map +0 -1
  50. package/esm2022/lib/extensions/editor-markdown-compatibility.js +0 -162
  51. package/esm2022/lib/extensions/editor-markdown-compatibility.js.map +0 -1
  52. package/esm2022/lib/extensions/editor-upload-placeholder.js +0 -156
  53. package/esm2022/lib/extensions/editor-upload-placeholder.js.map +0 -1
  54. package/esm2022/lib/status/editor-status.js +0 -64
  55. package/esm2022/lib/status/editor-status.js.map +0 -1
  56. package/esm2022/lib/toolbar/editor-alignment.js +0 -203
  57. package/esm2022/lib/toolbar/editor-alignment.js.map +0 -1
  58. package/esm2022/lib/toolbar/editor-block-insert.js +0 -101
  59. package/esm2022/lib/toolbar/editor-block-insert.js.map +0 -1
  60. package/esm2022/lib/toolbar/editor-color-control.js +0 -71
  61. package/esm2022/lib/toolbar/editor-color-control.js.map +0 -1
  62. package/esm2022/lib/toolbar/editor-command-button.js +0 -115
  63. package/esm2022/lib/toolbar/editor-command-button.js.map +0 -1
  64. package/esm2022/lib/toolbar/editor-heading.js +0 -266
  65. package/esm2022/lib/toolbar/editor-heading.js.map +0 -1
  66. package/esm2022/lib/toolbar/editor-highlight.js +0 -84
  67. package/esm2022/lib/toolbar/editor-highlight.js.map +0 -1
  68. package/esm2022/lib/toolbar/editor-image-upload-dialog.js +0 -289
  69. package/esm2022/lib/toolbar/editor-image-upload-dialog.js.map +0 -1
  70. package/esm2022/lib/toolbar/editor-image-upload.js +0 -315
  71. package/esm2022/lib/toolbar/editor-image-upload.js.map +0 -1
  72. package/esm2022/lib/toolbar/editor-inline-marks.js +0 -124
  73. package/esm2022/lib/toolbar/editor-inline-marks.js.map +0 -1
  74. package/esm2022/lib/toolbar/editor-link.js +0 -265
  75. package/esm2022/lib/toolbar/editor-link.js.map +0 -1
  76. package/esm2022/lib/toolbar/editor-list.js +0 -249
  77. package/esm2022/lib/toolbar/editor-list.js.map +0 -1
  78. package/esm2022/lib/toolbar/editor-table.js +0 -292
  79. package/esm2022/lib/toolbar/editor-table.js.map +0 -1
  80. package/esm2022/lib/toolbar/editor-text-color.js +0 -82
  81. package/esm2022/lib/toolbar/editor-text-color.js.map +0 -1
  82. package/esm2022/lib/toolbar/editor-toolbar-widget.js +0 -41
  83. package/esm2022/lib/toolbar/editor-toolbar-widget.js.map +0 -1
  84. package/esm2022/lib/toolbar/editor-toolbar.defs.js +0 -60
  85. package/esm2022/lib/toolbar/editor-toolbar.defs.js.map +0 -1
  86. package/esm2022/lib/toolbar/editor-toolbar.js +0 -826
  87. package/esm2022/lib/toolbar/editor-toolbar.js.map +0 -1
  88. package/esm2022/lib/toolbar/editor-undo-redo.js +0 -72
  89. package/esm2022/lib/toolbar/editor-undo-redo.js.map +0 -1
  90. package/esm2022/lib/toolbar/editor-zoom.js +0 -330
  91. package/esm2022/lib/toolbar/editor-zoom.js.map +0 -1
  92. package/esm2022/lib/upload/editor-image-upload-coordinator.js +0 -480
  93. package/esm2022/lib/upload/editor-image-upload-coordinator.js.map +0 -1
  94. package/esm2022/malva-ui-editor.js +0 -5
  95. package/esm2022/malva-ui-editor.js.map +0 -1
  96. package/index.d.ts +0 -35
  97. package/lib/ai/editor-ai-actions.d.ts +0 -27
  98. package/lib/ai/editor-ai-context.d.ts +0 -307
  99. package/lib/ai/editor-ai-menu.d.ts +0 -142
  100. package/lib/ai/editor-ai-review-bar.d.ts +0 -116
  101. package/lib/ai/editor-ai-stream.d.ts +0 -207
  102. package/lib/ai/editor-ai-suggestions.d.ts +0 -219
  103. package/lib/ai/editor-ai.tokens.d.ts +0 -10
  104. package/lib/ai/editor-ai.types.d.ts +0 -176
  105. package/lib/editor/editor.d.ts +0 -243
  106. package/lib/editor-extension-preflight.d.ts +0 -23
  107. package/lib/editor-serialization.d.ts +0 -74
  108. package/lib/editor-toolbar-context.d.ts +0 -116
  109. package/lib/editor.tokens.d.ts +0 -6
  110. package/lib/editor.types.d.ts +0 -194
  111. package/lib/extensions/editor-block-handle.d.ts +0 -59
  112. package/lib/extensions/editor-extensions.d.ts +0 -165
  113. package/lib/extensions/editor-markdown-compatibility.d.ts +0 -11
  114. package/lib/extensions/editor-upload-placeholder.d.ts +0 -75
  115. package/lib/status/editor-status.d.ts +0 -24
  116. package/lib/toolbar/editor-alignment.d.ts +0 -61
  117. package/lib/toolbar/editor-block-insert.d.ts +0 -26
  118. package/lib/toolbar/editor-color-control.d.ts +0 -32
  119. package/lib/toolbar/editor-command-button.d.ts +0 -29
  120. package/lib/toolbar/editor-heading.d.ts +0 -68
  121. package/lib/toolbar/editor-highlight.d.ts +0 -21
  122. package/lib/toolbar/editor-image-upload-dialog.d.ts +0 -96
  123. package/lib/toolbar/editor-image-upload.d.ts +0 -71
  124. package/lib/toolbar/editor-inline-marks.d.ts +0 -30
  125. package/lib/toolbar/editor-link.d.ts +0 -78
  126. package/lib/toolbar/editor-list.d.ts +0 -67
  127. package/lib/toolbar/editor-table.d.ts +0 -133
  128. package/lib/toolbar/editor-text-color.d.ts +0 -21
  129. package/lib/toolbar/editor-toolbar-widget.d.ts +0 -19
  130. package/lib/toolbar/editor-toolbar.d.ts +0 -157
  131. package/lib/toolbar/editor-toolbar.defs.d.ts +0 -35
  132. package/lib/toolbar/editor-undo-redo.d.ts +0 -26
  133. package/lib/toolbar/editor-zoom.d.ts +0 -108
  134. package/lib/upload/editor-image-upload-coordinator.d.ts +0 -55
  135. 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"}