@malva-ui/editor 0.1.12

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 (127) hide show
  1. package/ai/index.d.ts +12 -0
  2. package/ai/malva-ui-editor-ai.d.ts +5 -0
  3. package/esm2022/ai/index.js +12 -0
  4. package/esm2022/ai/index.js.map +1 -0
  5. package/esm2022/ai/malva-ui-editor-ai.js +5 -0
  6. package/esm2022/ai/malva-ui-editor-ai.js.map +1 -0
  7. package/esm2022/index.js +37 -0
  8. package/esm2022/index.js.map +1 -0
  9. package/esm2022/lib/ai/editor-ai-actions.js +69 -0
  10. package/esm2022/lib/ai/editor-ai-actions.js.map +1 -0
  11. package/esm2022/lib/ai/editor-ai-context.js +612 -0
  12. package/esm2022/lib/ai/editor-ai-context.js.map +1 -0
  13. package/esm2022/lib/ai/editor-ai-menu.js +288 -0
  14. package/esm2022/lib/ai/editor-ai-menu.js.map +1 -0
  15. package/esm2022/lib/ai/editor-ai-review-bar.js +223 -0
  16. package/esm2022/lib/ai/editor-ai-review-bar.js.map +1 -0
  17. package/esm2022/lib/ai/editor-ai-stream.js +677 -0
  18. package/esm2022/lib/ai/editor-ai-stream.js.map +1 -0
  19. package/esm2022/lib/ai/editor-ai-suggestions.js +751 -0
  20. package/esm2022/lib/ai/editor-ai-suggestions.js.map +1 -0
  21. package/esm2022/lib/ai/editor-ai.tokens.js +10 -0
  22. package/esm2022/lib/ai/editor-ai.tokens.js.map +1 -0
  23. package/esm2022/lib/ai/editor-ai.types.js +1 -0
  24. package/esm2022/lib/ai/editor-ai.types.js.map +1 -0
  25. package/esm2022/lib/editor/editor.js +985 -0
  26. package/esm2022/lib/editor/editor.js.map +1 -0
  27. package/esm2022/lib/editor-extension-preflight.js +83 -0
  28. package/esm2022/lib/editor-extension-preflight.js.map +1 -0
  29. package/esm2022/lib/editor-serialization.js +152 -0
  30. package/esm2022/lib/editor-serialization.js.map +1 -0
  31. package/esm2022/lib/editor-toolbar-context.js +259 -0
  32. package/esm2022/lib/editor-toolbar-context.js.map +1 -0
  33. package/esm2022/lib/editor.tokens.js +10 -0
  34. package/esm2022/lib/editor.tokens.js.map +1 -0
  35. package/esm2022/lib/editor.types.js +48 -0
  36. package/esm2022/lib/editor.types.js.map +1 -0
  37. package/esm2022/lib/extensions/editor-block-handle.js +760 -0
  38. package/esm2022/lib/extensions/editor-block-handle.js.map +1 -0
  39. package/esm2022/lib/extensions/editor-extensions.js +321 -0
  40. package/esm2022/lib/extensions/editor-extensions.js.map +1 -0
  41. package/esm2022/lib/extensions/editor-markdown-compatibility.js +162 -0
  42. package/esm2022/lib/extensions/editor-markdown-compatibility.js.map +1 -0
  43. package/esm2022/lib/extensions/editor-upload-placeholder.js +156 -0
  44. package/esm2022/lib/extensions/editor-upload-placeholder.js.map +1 -0
  45. package/esm2022/lib/status/editor-status.js +64 -0
  46. package/esm2022/lib/status/editor-status.js.map +1 -0
  47. package/esm2022/lib/toolbar/editor-alignment.js +203 -0
  48. package/esm2022/lib/toolbar/editor-alignment.js.map +1 -0
  49. package/esm2022/lib/toolbar/editor-block-insert.js +101 -0
  50. package/esm2022/lib/toolbar/editor-block-insert.js.map +1 -0
  51. package/esm2022/lib/toolbar/editor-color-control.js +71 -0
  52. package/esm2022/lib/toolbar/editor-color-control.js.map +1 -0
  53. package/esm2022/lib/toolbar/editor-command-button.js +115 -0
  54. package/esm2022/lib/toolbar/editor-command-button.js.map +1 -0
  55. package/esm2022/lib/toolbar/editor-heading.js +266 -0
  56. package/esm2022/lib/toolbar/editor-heading.js.map +1 -0
  57. package/esm2022/lib/toolbar/editor-highlight.js +84 -0
  58. package/esm2022/lib/toolbar/editor-highlight.js.map +1 -0
  59. package/esm2022/lib/toolbar/editor-image-upload-dialog.js +289 -0
  60. package/esm2022/lib/toolbar/editor-image-upload-dialog.js.map +1 -0
  61. package/esm2022/lib/toolbar/editor-image-upload.js +315 -0
  62. package/esm2022/lib/toolbar/editor-image-upload.js.map +1 -0
  63. package/esm2022/lib/toolbar/editor-inline-marks.js +124 -0
  64. package/esm2022/lib/toolbar/editor-inline-marks.js.map +1 -0
  65. package/esm2022/lib/toolbar/editor-link.js +265 -0
  66. package/esm2022/lib/toolbar/editor-link.js.map +1 -0
  67. package/esm2022/lib/toolbar/editor-list.js +249 -0
  68. package/esm2022/lib/toolbar/editor-list.js.map +1 -0
  69. package/esm2022/lib/toolbar/editor-table.js +292 -0
  70. package/esm2022/lib/toolbar/editor-table.js.map +1 -0
  71. package/esm2022/lib/toolbar/editor-text-color.js +82 -0
  72. package/esm2022/lib/toolbar/editor-text-color.js.map +1 -0
  73. package/esm2022/lib/toolbar/editor-toolbar-widget.js +41 -0
  74. package/esm2022/lib/toolbar/editor-toolbar-widget.js.map +1 -0
  75. package/esm2022/lib/toolbar/editor-toolbar.defs.js +60 -0
  76. package/esm2022/lib/toolbar/editor-toolbar.defs.js.map +1 -0
  77. package/esm2022/lib/toolbar/editor-toolbar.js +826 -0
  78. package/esm2022/lib/toolbar/editor-toolbar.js.map +1 -0
  79. package/esm2022/lib/toolbar/editor-undo-redo.js +72 -0
  80. package/esm2022/lib/toolbar/editor-undo-redo.js.map +1 -0
  81. package/esm2022/lib/toolbar/editor-zoom.js +330 -0
  82. package/esm2022/lib/toolbar/editor-zoom.js.map +1 -0
  83. package/esm2022/lib/upload/editor-image-upload-coordinator.js +480 -0
  84. package/esm2022/lib/upload/editor-image-upload-coordinator.js.map +1 -0
  85. package/esm2022/malva-ui-editor.js +5 -0
  86. package/esm2022/malva-ui-editor.js.map +1 -0
  87. package/index.d.ts +35 -0
  88. package/lib/ai/editor-ai-actions.d.ts +27 -0
  89. package/lib/ai/editor-ai-context.d.ts +307 -0
  90. package/lib/ai/editor-ai-menu.d.ts +142 -0
  91. package/lib/ai/editor-ai-review-bar.d.ts +116 -0
  92. package/lib/ai/editor-ai-stream.d.ts +207 -0
  93. package/lib/ai/editor-ai-suggestions.d.ts +219 -0
  94. package/lib/ai/editor-ai.tokens.d.ts +10 -0
  95. package/lib/ai/editor-ai.types.d.ts +176 -0
  96. package/lib/editor/editor.d.ts +243 -0
  97. package/lib/editor-extension-preflight.d.ts +23 -0
  98. package/lib/editor-serialization.d.ts +74 -0
  99. package/lib/editor-toolbar-context.d.ts +116 -0
  100. package/lib/editor.tokens.d.ts +6 -0
  101. package/lib/editor.types.d.ts +194 -0
  102. package/lib/extensions/editor-block-handle.d.ts +59 -0
  103. package/lib/extensions/editor-extensions.d.ts +165 -0
  104. package/lib/extensions/editor-markdown-compatibility.d.ts +11 -0
  105. package/lib/extensions/editor-upload-placeholder.d.ts +75 -0
  106. package/lib/status/editor-status.d.ts +24 -0
  107. package/lib/toolbar/editor-alignment.d.ts +61 -0
  108. package/lib/toolbar/editor-block-insert.d.ts +26 -0
  109. package/lib/toolbar/editor-color-control.d.ts +32 -0
  110. package/lib/toolbar/editor-command-button.d.ts +29 -0
  111. package/lib/toolbar/editor-heading.d.ts +68 -0
  112. package/lib/toolbar/editor-highlight.d.ts +21 -0
  113. package/lib/toolbar/editor-image-upload-dialog.d.ts +96 -0
  114. package/lib/toolbar/editor-image-upload.d.ts +71 -0
  115. package/lib/toolbar/editor-inline-marks.d.ts +30 -0
  116. package/lib/toolbar/editor-link.d.ts +78 -0
  117. package/lib/toolbar/editor-list.d.ts +67 -0
  118. package/lib/toolbar/editor-table.d.ts +133 -0
  119. package/lib/toolbar/editor-text-color.d.ts +21 -0
  120. package/lib/toolbar/editor-toolbar-widget.d.ts +19 -0
  121. package/lib/toolbar/editor-toolbar.d.ts +157 -0
  122. package/lib/toolbar/editor-toolbar.defs.d.ts +35 -0
  123. package/lib/toolbar/editor-undo-redo.d.ts +26 -0
  124. package/lib/toolbar/editor-zoom.d.ts +108 -0
  125. package/lib/upload/editor-image-upload-coordinator.d.ts +55 -0
  126. package/malva-ui-editor.d.ts +5 -0
  127. package/package.json +50 -0
package/ai/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Public surface of `@malva-ui/editor/ai`.
3
+ *
4
+ * The implementation lives in the primary entry point: `mlv-editor` provides
5
+ * the per-editor AI context, and the primary entry importing this secondary
6
+ * one (which already depends on the primary) would be a package cycle. This
7
+ * barrel re-exports the toolkit under its documented import path, so
8
+ * consumers keep importing `@malva-ui/editor/ai` and symbol identity is a
9
+ * single module in every build.
10
+ */
11
+ export { applyMlvEditorAiSuggestions, 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, mlvEditorAiDefaultActions, MlvEditorAiMenu, MlvEditorAiReviewBar, runMlvEditorAiStream, } from '@malva-ui/editor';
12
+ export type { MlvEditorAiAction, MlvEditorAiBuiltInTransformKind, MlvEditorAiFrameScheduler, MlvEditorAiOutputMode, MlvEditorAiProvider, MlvEditorAiRequest, MlvEditorAiReviewSuggestion, MlvEditorAiStatus, MlvEditorAiStreamErrorCode, MlvEditorAiStreamHandle, MlvEditorAiStreamOptions, MlvEditorAiStreamOutputMode, MlvEditorAiStreamResult, MlvEditorAiStreamStatus, MlvEditorAiSuggestion, MlvEditorAiSuggestionKind, MlvEditorAiSuggestionRange, MlvEditorAiSuggestionsOptions, MlvEditorAiSuggestionsSession, MlvEditorAiTransformKind, MlvEditorAiTransformOptions, } from '@malva-ui/editor';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@malva-ui/editor/ai" />
5
+ export * from './index';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Public surface of `@malva-ui/editor/ai`.
3
+ *
4
+ * The implementation lives in the primary entry point: `mlv-editor` provides
5
+ * the per-editor AI context, and the primary entry importing this secondary
6
+ * one (which already depends on the primary) would be a package cycle. This
7
+ * barrel re-exports the toolkit under its documented import path, so
8
+ * consumers keep importing `@malva-ui/editor/ai` and symbol identity is a
9
+ * single module in every build.
10
+ */
11
+ export { applyMlvEditorAiSuggestions, 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, mlvEditorAiDefaultActions, MlvEditorAiMenu, MlvEditorAiReviewBar, runMlvEditorAiStream, } from '@malva-ui/editor';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/editor/ai/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,sCAAsC,EACtC,qCAAqC,EACrC,qCAAqC,EACrC,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC","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"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=malva-ui-editor-ai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"malva-ui-editor-ai.js","sourceRoot":"","sources":["../../../../../libs/editor/ai/src/malva-ui-editor-ai.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
@@ -0,0 +1,37 @@
1
+ export * from './lib/editor.tokens';
2
+ export * from './lib/editor.types';
3
+ // The AI toolkit implementation lives in this entry point so `mlv-editor`
4
+ // can provide the per-editor context without a package cycle; the
5
+ // `@malva-ui/editor/ai` barrel re-exports it as the documented surface.
6
+ export * from './lib/ai/editor-ai-actions';
7
+ export { MLV_EDITOR_AI_CONTEXT, MlvEditorAiContext, } from './lib/ai/editor-ai-context';
8
+ export * from './lib/ai/editor-ai-menu';
9
+ export * from './lib/ai/editor-ai-review-bar';
10
+ export * from './lib/ai/editor-ai-stream';
11
+ // The word-diff helper and its run type stay out of the public barrels on
12
+ // purpose: they are implementation detail of the suggestion engine.
13
+ export { applyMlvEditorAiSuggestions, MLV_EDITOR_AI_SUGGESTION_CURRENT_CLASS, MLV_EDITOR_AI_SUGGESTION_DELETE_CLASS, MLV_EDITOR_AI_SUGGESTION_INSERT_CLASS, } from './lib/ai/editor-ai-suggestions';
14
+ export * from './lib/ai/editor-ai.tokens';
15
+ export * from './lib/ai/editor-ai.types';
16
+ export { MLV_EDITOR_TOOLBAR_CONTEXT } from './lib/editor-toolbar-context';
17
+ export * from './lib/editor/editor';
18
+ export * from './lib/extensions/editor-block-handle';
19
+ export * from './lib/extensions/editor-extensions';
20
+ export * from './lib/extensions/editor-upload-placeholder';
21
+ export * from './lib/status/editor-status';
22
+ export * from './lib/toolbar/editor-alignment';
23
+ export * from './lib/toolbar/editor-block-insert';
24
+ export * from './lib/toolbar/editor-heading';
25
+ export * from './lib/toolbar/editor-highlight';
26
+ export * from './lib/toolbar/editor-inline-marks';
27
+ export * from './lib/toolbar/editor-list';
28
+ export * from './lib/toolbar/editor-link';
29
+ export { MlvEditorImageUpload } from './lib/toolbar/editor-image-upload';
30
+ export * from './lib/toolbar/editor-table';
31
+ export * from './lib/toolbar/editor-toolbar.defs';
32
+ export { MlvEditorToolbar } from './lib/toolbar/editor-toolbar';
33
+ export * from './lib/toolbar/editor-toolbar-widget';
34
+ export * from './lib/toolbar/editor-undo-redo';
35
+ export * from './lib/toolbar/editor-zoom';
36
+ export * from './lib/toolbar/editor-text-color';
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/editor/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,0EAA0E;AAC1E,kEAAkE;AAClE,wEAAwE;AACxE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAKpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,0EAA0E;AAC1E,oEAAoE;AACpE,OAAO,EACL,2BAA2B,EAC3B,sCAAsC,EACtC,qCAAqC,EACrC,qCAAqC,GACtC,MAAM,gCAAgC,CAAC;AAQxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,cAAc,qBAAqB,CAAC;AACpC,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './lib/editor.tokens';\nexport * from './lib/editor.types';\n// The AI toolkit implementation lives in this entry point so `mlv-editor`\n// can provide the per-editor context without a package cycle; the\n// `@malva-ui/editor/ai` barrel re-exports it as the documented surface.\nexport * from './lib/ai/editor-ai-actions';\nexport {\n MLV_EDITOR_AI_CONTEXT,\n MlvEditorAiContext,\n} from './lib/ai/editor-ai-context';\nexport type {\n MlvEditorAiStatus,\n MlvEditorAiTransformOptions,\n} from './lib/ai/editor-ai-context';\nexport * from './lib/ai/editor-ai-menu';\nexport * from './lib/ai/editor-ai-review-bar';\nexport * from './lib/ai/editor-ai-stream';\n// The word-diff helper and its run type stay out of the public barrels on\n// purpose: they are implementation detail of the suggestion engine.\nexport {\n applyMlvEditorAiSuggestions,\n MLV_EDITOR_AI_SUGGESTION_CURRENT_CLASS,\n MLV_EDITOR_AI_SUGGESTION_DELETE_CLASS,\n MLV_EDITOR_AI_SUGGESTION_INSERT_CLASS,\n} from './lib/ai/editor-ai-suggestions';\nexport type {\n MlvEditorAiSuggestion,\n MlvEditorAiSuggestionKind,\n MlvEditorAiSuggestionRange,\n MlvEditorAiSuggestionsOptions,\n MlvEditorAiSuggestionsSession,\n} from './lib/ai/editor-ai-suggestions';\nexport * from './lib/ai/editor-ai.tokens';\nexport * from './lib/ai/editor-ai.types';\nexport { MLV_EDITOR_TOOLBAR_CONTEXT } from './lib/editor-toolbar-context';\nexport type { MlvEditorToolbarContext } from './lib/editor-toolbar-context';\nexport * from './lib/editor/editor';\nexport * from './lib/extensions/editor-block-handle';\nexport * from './lib/extensions/editor-extensions';\nexport * from './lib/extensions/editor-upload-placeholder';\nexport * from './lib/status/editor-status';\nexport * from './lib/toolbar/editor-alignment';\nexport * from './lib/toolbar/editor-block-insert';\nexport * from './lib/toolbar/editor-heading';\nexport * from './lib/toolbar/editor-highlight';\nexport * from './lib/toolbar/editor-inline-marks';\nexport * from './lib/toolbar/editor-list';\nexport * from './lib/toolbar/editor-link';\nexport { MlvEditorImageUpload } from './lib/toolbar/editor-image-upload';\nexport * from './lib/toolbar/editor-table';\nexport * from './lib/toolbar/editor-toolbar.defs';\nexport { MlvEditorToolbar } from './lib/toolbar/editor-toolbar';\nexport * from './lib/toolbar/editor-toolbar-widget';\nexport * from './lib/toolbar/editor-undo-redo';\nexport * from './lib/toolbar/editor-zoom';\nexport * from './lib/toolbar/editor-text-color';\nexport type {\n Editor,\n EditorOptions,\n Extension,\n Extensions,\n} from '@tiptap/core';\n"]}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @internal English fallbacks for the built-in action labels, used when no
3
+ * `MLV_EDITOR_I18N` copy is supplied — the same strings the English pack
4
+ * ships. Kept beside the factory so the label table exists exactly once: the
5
+ * menu builds its own default list through {@link mlvEditorAiDefaultActions}.
6
+ */
7
+ const BUILT_IN_LABEL_FALLBACKS = {
8
+ aiImprove: 'Improve writing',
9
+ aiFixGrammar: 'Fix grammar',
10
+ aiShorten: 'Shorten',
11
+ aiExtend: 'Extend',
12
+ aiSummarize: 'Summarize',
13
+ aiTone: 'Change tone',
14
+ aiTranslate: 'Translate',
15
+ };
16
+ /**
17
+ * Builds the seven built-in AI menu actions, labelled from the supplied
18
+ * editor copy.
19
+ *
20
+ * This is the exact list `MlvEditorAiMenu` renders when its `actions` input is
21
+ * omitted, so a host that wants to *extend* rather than replace the built-ins
22
+ * spreads the result instead of retyping it:
23
+ *
24
+ * ```ts
25
+ * private readonly _copy = inject(MLV_EDITOR_I18N, { optional: true });
26
+ *
27
+ * readonly actions = computed<readonly MlvEditorAiAction[]>(() => [
28
+ * ...mlvEditorAiDefaultActions(this._copy?.()),
29
+ * { kind: 'legal-review', label: 'Legal review', output: 'review' },
30
+ * ]);
31
+ * ```
32
+ *
33
+ * The custom-prompt entry is not part of this list: the menu renders it
34
+ * separately and it is dropped with `showCustomPrompt="false"`.
35
+ *
36
+ * @param copy Resolved editor copy, typically `inject(MLV_EDITOR_I18N)()`.
37
+ * `null`/`undefined`, or any missing key, falls back to the English label.
38
+ * @returns A fresh array of the seven built-in actions, in menu order.
39
+ */
40
+ export function mlvEditorAiDefaultActions(copy) {
41
+ return [
42
+ {
43
+ kind: 'improve',
44
+ label: copy?.aiImprove ?? BUILT_IN_LABEL_FALLBACKS.aiImprove,
45
+ },
46
+ {
47
+ kind: 'fix-grammar',
48
+ label: copy?.aiFixGrammar ?? BUILT_IN_LABEL_FALLBACKS.aiFixGrammar,
49
+ },
50
+ {
51
+ kind: 'shorten',
52
+ label: copy?.aiShorten ?? BUILT_IN_LABEL_FALLBACKS.aiShorten,
53
+ },
54
+ {
55
+ kind: 'extend',
56
+ label: copy?.aiExtend ?? BUILT_IN_LABEL_FALLBACKS.aiExtend,
57
+ },
58
+ {
59
+ kind: 'summarize',
60
+ label: copy?.aiSummarize ?? BUILT_IN_LABEL_FALLBACKS.aiSummarize,
61
+ },
62
+ { kind: 'tone', label: copy?.aiTone ?? BUILT_IN_LABEL_FALLBACKS.aiTone },
63
+ {
64
+ kind: 'translate',
65
+ label: copy?.aiTranslate ?? BUILT_IN_LABEL_FALLBACKS.aiTranslate,
66
+ },
67
+ ];
68
+ }
69
+ //# sourceMappingURL=editor-ai-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-ai-actions.js","sourceRoot":"","sources":["../../../../../../libs/editor/src/lib/ai/editor-ai-actions.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,iBAAiB;IAC5B,YAAY,EAAE,aAAa;IAC3B,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,WAAW;IACxB,MAAM,EAAE,aAAa;IACrB,WAAW,EAAE,WAAW;CAChB,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAsC;IAEtC,OAAO;QACL;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,IAAI,EAAE,SAAS,IAAI,wBAAwB,CAAC,SAAS;SAC7D;QACD;YACE,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,IAAI,EAAE,YAAY,IAAI,wBAAwB,CAAC,YAAY;SACnE;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,IAAI,EAAE,SAAS,IAAI,wBAAwB,CAAC,SAAS;SAC7D;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,IAAI,EAAE,QAAQ,IAAI,wBAAwB,CAAC,QAAQ;SAC3D;QACD;YACE,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,IAAI,EAAE,WAAW,IAAI,wBAAwB,CAAC,WAAW;SACjE;QACD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,wBAAwB,CAAC,MAAM,EAAE;QACxE;YACE,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,IAAI,EAAE,WAAW,IAAI,wBAAwB,CAAC,WAAW;SACjE;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { MlvEditorI18n } from '@malva-ui/i18n';\nimport type { MlvEditorAiAction } from './editor-ai.types';\n\n/**\n * @internal English fallbacks for the built-in action labels, used when no\n * `MLV_EDITOR_I18N` copy is supplied — the same strings the English pack\n * ships. Kept beside the factory so the label table exists exactly once: the\n * menu builds its own default list through {@link mlvEditorAiDefaultActions}.\n */\nconst BUILT_IN_LABEL_FALLBACKS = {\n aiImprove: 'Improve writing',\n aiFixGrammar: 'Fix grammar',\n aiShorten: 'Shorten',\n aiExtend: 'Extend',\n aiSummarize: 'Summarize',\n aiTone: 'Change tone',\n aiTranslate: 'Translate',\n} as const;\n\n/**\n * Builds the seven built-in AI menu actions, labelled from the supplied\n * editor copy.\n *\n * This is the exact list `MlvEditorAiMenu` renders when its `actions` input is\n * omitted, so a host that wants to *extend* rather than replace the built-ins\n * spreads the result instead of retyping it:\n *\n * ```ts\n * private readonly _copy = inject(MLV_EDITOR_I18N, { optional: true });\n *\n * readonly actions = computed<readonly MlvEditorAiAction[]>(() => [\n * ...mlvEditorAiDefaultActions(this._copy?.()),\n * { kind: 'legal-review', label: 'Legal review', output: 'review' },\n * ]);\n * ```\n *\n * The custom-prompt entry is not part of this list: the menu renders it\n * separately and it is dropped with `showCustomPrompt=\"false\"`.\n *\n * @param copy Resolved editor copy, typically `inject(MLV_EDITOR_I18N)()`.\n * `null`/`undefined`, or any missing key, falls back to the English label.\n * @returns A fresh array of the seven built-in actions, in menu order.\n */\nexport function mlvEditorAiDefaultActions(\n copy: MlvEditorI18n | null | undefined,\n): readonly MlvEditorAiAction[] {\n return [\n {\n kind: 'improve',\n label: copy?.aiImprove ?? BUILT_IN_LABEL_FALLBACKS.aiImprove,\n },\n {\n kind: 'fix-grammar',\n label: copy?.aiFixGrammar ?? BUILT_IN_LABEL_FALLBACKS.aiFixGrammar,\n },\n {\n kind: 'shorten',\n label: copy?.aiShorten ?? BUILT_IN_LABEL_FALLBACKS.aiShorten,\n },\n {\n kind: 'extend',\n label: copy?.aiExtend ?? BUILT_IN_LABEL_FALLBACKS.aiExtend,\n },\n {\n kind: 'summarize',\n label: copy?.aiSummarize ?? BUILT_IN_LABEL_FALLBACKS.aiSummarize,\n },\n { kind: 'tone', label: copy?.aiTone ?? BUILT_IN_LABEL_FALLBACKS.aiTone },\n {\n kind: 'translate',\n label: copy?.aiTranslate ?? BUILT_IN_LABEL_FALLBACKS.aiTranslate,\n },\n ];\n}\n"]}