@malva-ui/editor 0.1.13 → 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/README.md +5 -5
- 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 +35 -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/lib/editor.types.d.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import type { Signal } from '@angular/core';
|
|
2
|
-
import type { Editor } from '@tiptap/core';
|
|
3
|
-
import type { Transaction } from '@tiptap/pm/state';
|
|
4
|
-
/**
|
|
5
|
-
* Supported external serialization formats for editor content.
|
|
6
|
-
*
|
|
7
|
-
* `'html'` and `'markdown'` carry text markup. `'json'` carries the Tiptap
|
|
8
|
-
* document itself as `JSON.stringify(editor.getJSON())`, so custom block nodes
|
|
9
|
-
* round-trip their typed attributes instead of being flattened into HTML
|
|
10
|
-
* attributes. The model type stays `string | null` in every format; a JSON
|
|
11
|
-
* host parses that string at its own boundary.
|
|
12
|
-
*/
|
|
13
|
-
export type MlvEditorFormat = 'html' | 'markdown' | 'json';
|
|
14
|
-
/**
|
|
15
|
-
* Width of the centred editor content column.
|
|
16
|
-
*
|
|
17
|
-
* `'default'` is a comfortable reading measure, `'wide'` suits dense or tabular
|
|
18
|
-
* documents, and `'full'` lets the column fill its host. A horizontal gutter is
|
|
19
|
-
* reserved at every value, so block affordances never overlap text.
|
|
20
|
-
*/
|
|
21
|
-
export type MlvEditorContentWidth = 'default' | 'wide' | 'full';
|
|
22
|
-
/** Origin of an image file supplied to the editor. */
|
|
23
|
-
export type MlvEditorImageUploadSource = 'button' | 'paste' | 'drop';
|
|
24
|
-
/** Decides whether an uploaded image URL is safe to insert into the editor. */
|
|
25
|
-
export type MlvEditorImageUrlPolicy = (url: string) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Default image URL policy used by the editor upload coordinator.
|
|
28
|
-
*
|
|
29
|
-
* Only absolute HTTP(S) URLs with a hostname and without credentials are
|
|
30
|
-
* accepted. Leading and trailing whitespace is ignored, while whitespace or
|
|
31
|
-
* control characters inside the URL are rejected.
|
|
32
|
-
*
|
|
33
|
-
* @param url Candidate image URL returned by an uploader.
|
|
34
|
-
* @returns Whether the URL is safe to insert.
|
|
35
|
-
*/
|
|
36
|
-
export declare function mlvEditorDefaultImageUrlPolicy(url: string): boolean;
|
|
37
|
-
/** Details emitted when the Tiptap selection changes. */
|
|
38
|
-
export interface MlvEditorSelectionChange {
|
|
39
|
-
/** Editor that produced the selection transaction. */
|
|
40
|
-
readonly editor: Editor;
|
|
41
|
-
/** Tiptap transaction containing the updated selection. */
|
|
42
|
-
readonly transaction: Transaction;
|
|
43
|
-
}
|
|
44
|
-
/** Details emitted for every Tiptap transaction. */
|
|
45
|
-
export interface MlvEditorTransactionEvent {
|
|
46
|
-
/** Editor that produced the transaction. */
|
|
47
|
-
readonly editor: Editor;
|
|
48
|
-
/** Tiptap transaction emitted by the editor. */
|
|
49
|
-
readonly transaction: Transaction;
|
|
50
|
-
}
|
|
51
|
-
/** Details emitted when the editor receives or loses focus. */
|
|
52
|
-
export interface MlvEditorFocusEvent {
|
|
53
|
-
/** Editor associated with the native focus event. */
|
|
54
|
-
readonly editor: Editor;
|
|
55
|
-
/** Native browser focus event. */
|
|
56
|
-
readonly event: FocusEvent;
|
|
57
|
-
}
|
|
58
|
-
/** Context supplied to an image uploader for one upload operation. */
|
|
59
|
-
export interface MlvEditorImageUploadContext {
|
|
60
|
-
/** Origin of the image file. */
|
|
61
|
-
readonly source: MlvEditorImageUploadSource;
|
|
62
|
-
/** Signal that is aborted when the upload should stop. */
|
|
63
|
-
readonly signal: AbortSignal;
|
|
64
|
-
/** Reports upload progress as a percentage from 0 through 100. */
|
|
65
|
-
readonly reportProgress: (percentage: number) => void;
|
|
66
|
-
}
|
|
67
|
-
/** Image metadata returned by an image uploader after a successful upload. */
|
|
68
|
-
export interface MlvEditorImageUploadResult {
|
|
69
|
-
/** URL used in the inserted image node. */
|
|
70
|
-
readonly src: string;
|
|
71
|
-
/** Optional alternative text for the image. */
|
|
72
|
-
readonly alt?: string;
|
|
73
|
-
/** Optional image title. */
|
|
74
|
-
readonly title?: string;
|
|
75
|
-
/** Optional rendered image width. */
|
|
76
|
-
readonly width?: number;
|
|
77
|
-
/** Optional rendered image height. */
|
|
78
|
-
readonly height?: number;
|
|
79
|
-
}
|
|
80
|
-
/** Adapter used to transfer image files selected, pasted, or dropped in the editor. */
|
|
81
|
-
export interface MlvEditorImageUploader {
|
|
82
|
-
/**
|
|
83
|
-
* Uploads an image file and returns the metadata used to insert it.
|
|
84
|
-
*
|
|
85
|
-
* @param file Image file to upload.
|
|
86
|
-
* @param context Source, cancellation, and progress facilities for this upload.
|
|
87
|
-
* @returns Metadata for the successfully uploaded image.
|
|
88
|
-
*/
|
|
89
|
-
upload(file: File, context: MlvEditorImageUploadContext): Promise<MlvEditorImageUploadResult>;
|
|
90
|
-
}
|
|
91
|
-
/** Constraints applied before images are sent to an uploader. */
|
|
92
|
-
export interface MlvEditorImageUploadOptions {
|
|
93
|
-
/** MIME types or patterns accepted by the editor. */
|
|
94
|
-
readonly accept: readonly string[];
|
|
95
|
-
/** Largest allowed file size in bytes. */
|
|
96
|
-
readonly maxSize: number;
|
|
97
|
-
/** Maximum number of files accepted in one upload action. */
|
|
98
|
-
readonly maxFiles: number;
|
|
99
|
-
/** Optional host policy replacing the default uploaded-image URL decision. */
|
|
100
|
-
readonly urlPolicy?: MlvEditorImageUrlPolicy;
|
|
101
|
-
}
|
|
102
|
-
/** One upload retained by the editor while it is active or retryable. */
|
|
103
|
-
export interface MlvEditorPendingUpload {
|
|
104
|
-
/** Stable identifier shared with the non-serializable placeholder. */
|
|
105
|
-
readonly id: string;
|
|
106
|
-
/** Image file supplied by the host interaction. */
|
|
107
|
-
readonly file: File;
|
|
108
|
-
/** Interaction that supplied the file. */
|
|
109
|
-
readonly source: MlvEditorImageUploadSource;
|
|
110
|
-
/** Current finite upload progress from zero through one hundred. */
|
|
111
|
-
readonly progress: number;
|
|
112
|
-
/** Whether the upload is active or retained after a recoverable failure. */
|
|
113
|
-
readonly status: 'uploading' | 'failed';
|
|
114
|
-
/** Recoverable failure retained while the upload can be retried or removed. */
|
|
115
|
-
readonly error?: MlvEditorError;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Editor-owned image-upload capability forwarded to standalone toolbars.
|
|
119
|
-
*
|
|
120
|
-
* The capability is intentionally one shared reference so toolbar controls
|
|
121
|
-
* never create a second uploader, request registry, or placeholder owner. Its
|
|
122
|
-
* private brand makes this a library-owned capability rather than a structural
|
|
123
|
-
* protocol for consumers to implement.
|
|
124
|
-
*/
|
|
125
|
-
export declare abstract class MlvEditorImageUploadControl {
|
|
126
|
-
/** @private Nominal brand preventing structural implementations. */
|
|
127
|
-
private readonly _mlvEditorImageUploadControlBrand;
|
|
128
|
-
protected constructor();
|
|
129
|
-
/** Whether this editor can currently begin image uploads. */
|
|
130
|
-
abstract readonly available: Signal<boolean>;
|
|
131
|
-
/** Whether either the input or injected adapter resolves for this editor. */
|
|
132
|
-
abstract readonly adapterAvailable: Signal<boolean>;
|
|
133
|
-
/** Current editor-scoped validation options. */
|
|
134
|
-
abstract readonly options: Signal<MlvEditorImageUploadOptions>;
|
|
135
|
-
/** Active and retryable uploads owned by this editor. */
|
|
136
|
-
abstract readonly pending: Signal<readonly MlvEditorPendingUpload[]>;
|
|
137
|
-
/** Starts validated uploads in the owning editor. */
|
|
138
|
-
abstract start(files: readonly File[], source: MlvEditorImageUploadSource, metadata?: {
|
|
139
|
-
readonly position?: number;
|
|
140
|
-
readonly alt?: string;
|
|
141
|
-
readonly title?: string;
|
|
142
|
-
}): readonly string[];
|
|
143
|
-
/** Cancels one active request. */
|
|
144
|
-
abstract cancel(id: string): void;
|
|
145
|
-
/** Retries one recoverable request. */
|
|
146
|
-
abstract retry(id: string): void;
|
|
147
|
-
/** Removes one recoverable failure. */
|
|
148
|
-
abstract remove(id: string): void;
|
|
149
|
-
}
|
|
150
|
-
/** Details emitted after a successful image upload. */
|
|
151
|
-
export interface MlvEditorImageUploadSuccess {
|
|
152
|
-
/** Image file that was uploaded. */
|
|
153
|
-
readonly file: File;
|
|
154
|
-
/** Origin of the image file. */
|
|
155
|
-
readonly source: MlvEditorImageUploadSource;
|
|
156
|
-
/** Metadata returned by the image uploader. */
|
|
157
|
-
readonly result: MlvEditorImageUploadResult;
|
|
158
|
-
}
|
|
159
|
-
/** Details emitted when an image upload fails. */
|
|
160
|
-
export interface MlvEditorImageUploadFailure {
|
|
161
|
-
/** Image file whose upload failed. */
|
|
162
|
-
readonly file: File;
|
|
163
|
-
/** Origin of the image file. */
|
|
164
|
-
readonly source: MlvEditorImageUploadSource;
|
|
165
|
-
/** Recoverable error describing the failed upload. */
|
|
166
|
-
readonly error: MlvEditorError;
|
|
167
|
-
}
|
|
168
|
-
/** Details emitted when an image upload is cancelled. */
|
|
169
|
-
export interface MlvEditorImageUploadCancelled {
|
|
170
|
-
/** Image file whose upload was cancelled. */
|
|
171
|
-
readonly file: File;
|
|
172
|
-
/** Origin of the image file. */
|
|
173
|
-
readonly source: MlvEditorImageUploadSource;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Categories of recoverable errors emitted by the editor.
|
|
177
|
-
*
|
|
178
|
-
* `'ai-transport'` reports an AI provider that threw or whose stream failed;
|
|
179
|
-
* `'ai-result'` reports AI output that could not be used. Both restore the
|
|
180
|
-
* document to its pre-request checkpoint; cancellation is silent and never
|
|
181
|
-
* emits an error.
|
|
182
|
-
*/
|
|
183
|
-
export type MlvEditorErrorCode = 'configuration' | 'parse' | 'serialize' | 'unsupported-command' | 'upload-validation' | 'upload-transport' | 'upload-result' | 'ai-transport' | 'ai-result';
|
|
184
|
-
/** Structured error emitted instead of throwing through Angular change detection. */
|
|
185
|
-
export interface MlvEditorError {
|
|
186
|
-
/** Stable category that callers can use for error handling. */
|
|
187
|
-
readonly code: MlvEditorErrorCode;
|
|
188
|
-
/** Human-readable description of the failure. */
|
|
189
|
-
readonly message: string;
|
|
190
|
-
/** Whether the editor can continue operating after the failure. */
|
|
191
|
-
readonly recoverable: boolean;
|
|
192
|
-
/** Original failure when one is available. */
|
|
193
|
-
readonly cause?: unknown;
|
|
194
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
/** A completed block move, reported so the host can announce it. */
|
|
3
|
-
export interface MlvEditorBlockMove {
|
|
4
|
-
/** ProseMirror node type name of the moved block, untranslated. */
|
|
5
|
-
readonly type: string;
|
|
6
|
-
/** One-based position the block now occupies among the blocks counted by `total`. */
|
|
7
|
-
readonly position: number;
|
|
8
|
-
/**
|
|
9
|
-
* Top-level block count of the document the move was computed against, i.e.
|
|
10
|
-
* **before** the move — the same snapshot `position` is derived from. Reading
|
|
11
|
-
* it after the move instead would announce schema-maintained artifacts the
|
|
12
|
-
* user never authored: `trailingNode` appends an empty paragraph whenever the
|
|
13
|
-
* last block is not a textblock, so moving a horizontal rule to the end would
|
|
14
|
-
* otherwise report "3 of 4".
|
|
15
|
-
*/
|
|
16
|
-
readonly total: number;
|
|
17
|
-
}
|
|
18
|
-
/** Host-supplied capabilities for the block drag handle. */
|
|
19
|
-
export interface MlvEditorBlockHandleOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Container the floating handle is appended to. Must be the layer carrying the
|
|
22
|
-
* editor zoom transform so the handle shares its coordinate space.
|
|
23
|
-
*/
|
|
24
|
-
readonly mount: () => HTMLElement | null;
|
|
25
|
-
/** Accessible label for the handle, read live so locale changes apply. */
|
|
26
|
-
readonly label: () => string;
|
|
27
|
-
/** Receives every completed move; the host formats and announces it. */
|
|
28
|
-
readonly announceMove: (move: MlvEditorBlockMove) => void;
|
|
29
|
-
/** Whether block moving is currently permitted; false while readonly or disabled. */
|
|
30
|
-
readonly enabled: () => boolean;
|
|
31
|
-
}
|
|
32
|
-
declare module '@tiptap/core' {
|
|
33
|
-
interface Commands<ReturnType> {
|
|
34
|
-
mlvEditorBlockHandle: {
|
|
35
|
-
/**
|
|
36
|
-
* Moves one top-level block. Both indices address the document as it stands
|
|
37
|
-
* **before** the move, so moving index 0 to index 2 of three blocks yields
|
|
38
|
-
* the order `[1, 2, 0]`.
|
|
39
|
-
*/
|
|
40
|
-
moveBlock: (options: {
|
|
41
|
-
from: number;
|
|
42
|
-
to: number;
|
|
43
|
-
}) => ReturnType;
|
|
44
|
-
/** Moves the top-level block containing the selection one position earlier. */
|
|
45
|
-
moveBlockUp: () => ReturnType;
|
|
46
|
-
/** Moves the top-level block containing the selection one position later. */
|
|
47
|
-
moveBlockDown: () => ReturnType;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Tiptap extension supplying top-level block reordering.
|
|
53
|
-
*
|
|
54
|
-
* The pointer handle and the keyboard shortcuts both route through `moveBlock`,
|
|
55
|
-
* so the two paths cannot drift apart. The handle itself is rendered by this
|
|
56
|
-
* extension's ProseMirror plugin into the host-supplied mount container and is
|
|
57
|
-
* never part of the document, so no serialized representation can contain it.
|
|
58
|
-
*/
|
|
59
|
-
export declare const MlvEditorBlockHandle: Extension<MlvEditorBlockHandleOptions, any>;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { Extension, type Editor, type Extensions } from '@tiptap/core';
|
|
2
|
-
import type { MlvEditorFormat, MlvEditorImageUploadSource } from '../editor.types';
|
|
3
|
-
import { type MlvEditorBlockHandleOptions } from './editor-block-handle';
|
|
4
|
-
export { MlvEditorUploadPlaceholder, type MlvEditorInsertUploadPlaceholderOptions, type MlvEditorRemoveUploadPlaceholderOptions, type MlvEditorUpdateUploadPlaceholderOptions, type MlvEditorUploadPlaceholderItem, type MlvEditorUploadPlaceholderStorage, } from './editor-upload-placeholder';
|
|
5
|
-
/**
|
|
6
|
-
* Public Malva wrapper around Tiptap's official free file handling extension.
|
|
7
|
-
*
|
|
8
|
-
* The upstream plugin intentionally consumes accepted file-only paste/drop
|
|
9
|
-
* events. This companion plugin inserts a simultaneous `text/plain` payload
|
|
10
|
-
* first, then delegates the file interaction exactly once to the upstream
|
|
11
|
-
* `FileHandlePlugin`. It remains inert for either interaction when the
|
|
12
|
-
* corresponding callback is not configured, so custom presets can safely
|
|
13
|
-
* include it before they opt into file handling.
|
|
14
|
-
*/
|
|
15
|
-
export declare const MlvEditorFileHandler: Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "key" | "editor">, any>;
|
|
16
|
-
/** Options used to configure formatting extensions in a Malva editor preset. */
|
|
17
|
-
export interface MlvEditorFormattingExtensionOptions {
|
|
18
|
-
/** Node types that accept text alignment. Defaults to headings and paragraphs. */
|
|
19
|
-
readonly textAlignTypes?: readonly string[];
|
|
20
|
-
}
|
|
21
|
-
/** Options used to configure task-list support. */
|
|
22
|
-
export interface MlvEditorListExtensionOptions {
|
|
23
|
-
/** Whether task-list items may be nested. Defaults to false. */
|
|
24
|
-
readonly nestedTaskItems?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/** Options used to configure table support. */
|
|
27
|
-
export interface MlvEditorTableExtensionOptions {
|
|
28
|
-
/** Whether users can resize table columns. Defaults to true. */
|
|
29
|
-
readonly resizable?: boolean;
|
|
30
|
-
}
|
|
31
|
-
/** A pasted or dropped file event passed from Tiptap to the editor upload coordinator. */
|
|
32
|
-
export interface MlvEditorFileHandlerEvent {
|
|
33
|
-
/** Editor that received the file event. */
|
|
34
|
-
readonly editor: Editor;
|
|
35
|
-
/** Files selected by the browser paste or drop event. */
|
|
36
|
-
readonly files: readonly File[];
|
|
37
|
-
/** Origin of the image files. */
|
|
38
|
-
readonly source: Exclude<MlvEditorImageUploadSource, 'button'>;
|
|
39
|
-
/** Document position at which files were dropped, when applicable. */
|
|
40
|
-
readonly position?: number;
|
|
41
|
-
/** HTML clipboard content accompanying pasted files, when available. */
|
|
42
|
-
readonly pasteContent?: string;
|
|
43
|
-
}
|
|
44
|
-
/** Options used to configure the image and file-handler extensions. */
|
|
45
|
-
export interface MlvEditorImageExtensionOptions {
|
|
46
|
-
/** Whether image node resizing is enabled. Defaults to true. */
|
|
47
|
-
readonly resizable?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Smallest width, in CSS pixels, a resized image may be dragged to.
|
|
50
|
-
* Defaults to 8. Must be a finite number: an undefined minimum leaves
|
|
51
|
-
* Tiptap's resize arithmetic producing `NaN` and silently disables resizing.
|
|
52
|
-
*/
|
|
53
|
-
readonly minWidth?: number;
|
|
54
|
-
/** Smallest height, in CSS pixels, a resized image may be dragged to. Defaults to 8. */
|
|
55
|
-
readonly minHeight?: number;
|
|
56
|
-
/** MIME types forwarded to Tiptap's file handler. */
|
|
57
|
-
readonly allowedMimeTypes?: readonly string[];
|
|
58
|
-
/** Runtime guard applied before Tiptap consumes a matching file event. */
|
|
59
|
-
readonly fileHandlingEnabled?: () => boolean;
|
|
60
|
-
/** Optional runtime MIME decision used for editor-scoped upload options. */
|
|
61
|
-
readonly acceptsMimeType?: (mimeType: string) => boolean;
|
|
62
|
-
/** Callback invoked for pasted and dropped files. */
|
|
63
|
-
readonly onFiles?: (event: MlvEditorFileHandlerEvent) => void;
|
|
64
|
-
}
|
|
65
|
-
/** Options used to configure editor utility extensions. */
|
|
66
|
-
export interface MlvEditorUtilityExtensionOptions {
|
|
67
|
-
/** Placeholder text shown for an empty editor. */
|
|
68
|
-
readonly placeholder?: string;
|
|
69
|
-
/** Maximum character count, or null for no limit. */
|
|
70
|
-
readonly characterLimit?: number | null;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Counts words using every Unicode whitespace separator as a boundary.
|
|
74
|
-
*
|
|
75
|
-
* @param text Plain editor text.
|
|
76
|
-
* @returns The deterministic number of non-empty words.
|
|
77
|
-
*/
|
|
78
|
-
export declare function countMlvEditorWords(text: string): number;
|
|
79
|
-
/**
|
|
80
|
-
* Normalizes a character limit to a positive finite integer.
|
|
81
|
-
*
|
|
82
|
-
* @param limit Candidate limit.
|
|
83
|
-
* @returns The usable limit, or `null` for unlimited content.
|
|
84
|
-
*/
|
|
85
|
-
export declare function normalizeMlvEditorCharacterLimit(limit: number | null | undefined): number | null;
|
|
86
|
-
/** Options used to configure the beta Markdown extension. */
|
|
87
|
-
export interface MlvEditorMarkdownExtensionOptions {
|
|
88
|
-
/** Indentation used by Markdown lists and code blocks. */
|
|
89
|
-
readonly indentation?: {
|
|
90
|
-
/** Use spaces or tabs for indentation. */
|
|
91
|
-
readonly style?: 'space' | 'tab';
|
|
92
|
-
/** Number of indentation characters per nesting level. */
|
|
93
|
-
readonly size?: number;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/** Aggregate options accepted by the standard Malva editor extension preset. */
|
|
97
|
-
export interface MlvEditorDefaultExtensionOptions extends MlvEditorFormattingExtensionOptions, MlvEditorListExtensionOptions, MlvEditorTableExtensionOptions, MlvEditorImageExtensionOptions, MlvEditorUtilityExtensionOptions, MlvEditorMarkdownExtensionOptions {
|
|
98
|
-
/** Serialization format; Markdown support is added only for `markdown`. */
|
|
99
|
-
readonly format?: MlvEditorFormat;
|
|
100
|
-
/** Host capabilities for the block drag handle. */
|
|
101
|
-
readonly blockHandle?: Partial<MlvEditorBlockHandleOptions>;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Creates the core formatting extensions used by the default Malva preset.
|
|
105
|
-
*
|
|
106
|
-
* @param options Optional text-alignment configuration.
|
|
107
|
-
* @returns Fresh Tiptap extension instances safe to compose into one editor.
|
|
108
|
-
*/
|
|
109
|
-
export declare function mlvEditorFormattingExtensions(options?: MlvEditorFormattingExtensionOptions): Extensions;
|
|
110
|
-
/**
|
|
111
|
-
* Creates task-list extensions. Bullet and ordered lists remain supplied by StarterKit.
|
|
112
|
-
*
|
|
113
|
-
* @param options Optional task-item nesting configuration.
|
|
114
|
-
* @returns Fresh task-list extension instances.
|
|
115
|
-
*/
|
|
116
|
-
export declare function mlvEditorListExtensions(options?: MlvEditorListExtensionOptions): Extensions;
|
|
117
|
-
/**
|
|
118
|
-
* Creates the free Tiptap table kit.
|
|
119
|
-
*
|
|
120
|
-
* @param options Optional table resize configuration.
|
|
121
|
-
* @returns A fresh configured table-kit extension.
|
|
122
|
-
*/
|
|
123
|
-
export declare function mlvEditorTableExtensions(options?: MlvEditorTableExtensionOptions): Extensions;
|
|
124
|
-
/**
|
|
125
|
-
* Creates the image and paste/drop file-handler extensions.
|
|
126
|
-
*
|
|
127
|
-
* @param options Optional image resize, MIME-type, and file callback configuration.
|
|
128
|
-
* @returns Fresh image and file-handler extension instances.
|
|
129
|
-
*/
|
|
130
|
-
export declare function mlvEditorImageExtensions(options?: MlvEditorImageExtensionOptions): Extensions;
|
|
131
|
-
/**
|
|
132
|
-
* Creates placeholder and character-count utility extensions.
|
|
133
|
-
*
|
|
134
|
-
* @param options Optional placeholder text and character limit.
|
|
135
|
-
* @returns Fresh utility extension instances.
|
|
136
|
-
*/
|
|
137
|
-
export declare function mlvEditorUtilityExtensions(options?: MlvEditorUtilityExtensionOptions): Extensions;
|
|
138
|
-
/**
|
|
139
|
-
* Creates the block drag-handle extension.
|
|
140
|
-
*
|
|
141
|
-
* Every option is host-supplied. Omitting them yields an inert handle that never
|
|
142
|
-
* mounts, which is what a bare `mlvEditorDefaultExtensions()` call outside the
|
|
143
|
-
* `MlvEditor` shell should produce.
|
|
144
|
-
*
|
|
145
|
-
* @param options Optional host capabilities for mounting, labelling, and announcing.
|
|
146
|
-
* @returns A fresh configured block-handle extension.
|
|
147
|
-
*/
|
|
148
|
-
export declare function mlvEditorBlockHandleExtensions(options?: Partial<MlvEditorBlockHandleOptions>): Extensions;
|
|
149
|
-
/**
|
|
150
|
-
* Creates the official beta Tiptap Markdown extension.
|
|
151
|
-
*
|
|
152
|
-
* @param options Optional Markdown indentation configuration.
|
|
153
|
-
* @returns A fresh Markdown extension instance.
|
|
154
|
-
*/
|
|
155
|
-
export declare function mlvEditorMarkdownExtensions(options?: MlvEditorMarkdownExtensionOptions): Extensions;
|
|
156
|
-
/**
|
|
157
|
-
* Creates Malva's complete default extension preset.
|
|
158
|
-
*
|
|
159
|
-
* Every call creates new arrays and extension instances. Passing a custom extension
|
|
160
|
-
* list to the editor shell intentionally replaces this preset instead of extending it.
|
|
161
|
-
*
|
|
162
|
-
* @param options Optional preset configuration.
|
|
163
|
-
* @returns A duplicate-free extension set for one new Tiptap editor instance.
|
|
164
|
-
*/
|
|
165
|
-
export declare function mlvEditorDefaultExtensions(options?: MlvEditorDefaultExtensionOptions): Extensions;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type AnyExtension } from '@tiptap/core';
|
|
2
|
-
import { type TableKitOptions } from '@tiptap/extension-table';
|
|
3
|
-
import { type StarterKitOptions } from '@tiptap/starter-kit';
|
|
4
|
-
/** @internal Builds the color-aware same-name TextStyle mark used by Malva's default preset. */
|
|
5
|
-
export declare function createMarkdownCompatibleTextStyle(): AnyExtension;
|
|
6
|
-
/** @internal Builds the color-aware same-name Highlight mark used by Malva's default preset. */
|
|
7
|
-
export declare function createMarkdownCompatibleHighlight(): AnyExtension;
|
|
8
|
-
/** @internal Builds the same-name StarterKit whose block children preserve explicit alignment. */
|
|
9
|
-
export declare function createMarkdownCompatibleStarterKit(options: Partial<StarterKitOptions>): AnyExtension;
|
|
10
|
-
/** @internal Builds the same-name TableKit whose table child falls back to complete HTML. */
|
|
11
|
-
export declare function createMarkdownCompatibleTableKit(options: Partial<TableKitOptions>): AnyExtension;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
/** A rendered, temporary image-upload placeholder tracked by its stable identifier. */
|
|
3
|
-
export interface MlvEditorUploadPlaceholderItem {
|
|
4
|
-
/** Identifier that associates this placeholder with one upload operation. */
|
|
5
|
-
readonly id: string;
|
|
6
|
-
/** Current document position of the placeholder decoration. */
|
|
7
|
-
readonly position: number;
|
|
8
|
-
/** Upload progress percentage from 0 through 100. */
|
|
9
|
-
readonly progress: number;
|
|
10
|
-
}
|
|
11
|
-
/** Options accepted when a temporary upload placeholder is inserted. */
|
|
12
|
-
export interface MlvEditorInsertUploadPlaceholderOptions {
|
|
13
|
-
/** Unique caller-owned identifier for the upload operation. */
|
|
14
|
-
readonly id: string;
|
|
15
|
-
/** Optional document position; the current selection is used when omitted. */
|
|
16
|
-
readonly position?: number;
|
|
17
|
-
/** Initial upload progress percentage. Defaults to zero. */
|
|
18
|
-
readonly progress?: number;
|
|
19
|
-
}
|
|
20
|
-
/** Options accepted when an existing upload placeholder is updated. */
|
|
21
|
-
export interface MlvEditorUpdateUploadPlaceholderOptions {
|
|
22
|
-
/** Identifier of the placeholder to update. */
|
|
23
|
-
readonly id: string;
|
|
24
|
-
/** New upload progress percentage, clamped to the inclusive 0–100 range. */
|
|
25
|
-
readonly progress: number;
|
|
26
|
-
}
|
|
27
|
-
/** Options accepted when a temporary upload placeholder is removed. */
|
|
28
|
-
export interface MlvEditorRemoveUploadPlaceholderOptions {
|
|
29
|
-
/** Identifier of the placeholder to remove. */
|
|
30
|
-
readonly id: string;
|
|
31
|
-
}
|
|
32
|
-
/** Image attributes inserted while atomically removing an upload placeholder. */
|
|
33
|
-
export interface MlvEditorReplaceUploadPlaceholderOptions {
|
|
34
|
-
/** Identifier of the placeholder to replace. */
|
|
35
|
-
readonly id: string;
|
|
36
|
-
/** Validated image attributes used to create the final schema node. */
|
|
37
|
-
readonly attributes: {
|
|
38
|
-
/** Trimmed image URL. */
|
|
39
|
-
readonly src: string;
|
|
40
|
-
/** Optional alternative text. */
|
|
41
|
-
readonly alt?: string;
|
|
42
|
-
/** Optional image title. */
|
|
43
|
-
readonly title?: string;
|
|
44
|
-
/** Optional finite positive rendered width. */
|
|
45
|
-
readonly width?: number;
|
|
46
|
-
/** Optional finite positive rendered height. */
|
|
47
|
-
readonly height?: number;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/** Read-only upload-placeholder state exposed through Tiptap extension storage. */
|
|
51
|
-
export interface MlvEditorUploadPlaceholderStorage {
|
|
52
|
-
/** Current temporary placeholders; decorations, never serializable document nodes. */
|
|
53
|
-
readonly placeholders: readonly MlvEditorUploadPlaceholderItem[];
|
|
54
|
-
}
|
|
55
|
-
declare module '@tiptap/core' {
|
|
56
|
-
interface Commands<ReturnType> {
|
|
57
|
-
mlvEditorUploadPlaceholder: {
|
|
58
|
-
/** Inserts an upload decoration without changing persisted editor content. */
|
|
59
|
-
insertUploadPlaceholder: (options: MlvEditorInsertUploadPlaceholderOptions) => ReturnType;
|
|
60
|
-
/** Updates the progress decoration for one pending image upload. */
|
|
61
|
-
updateUploadPlaceholder: (options: MlvEditorUpdateUploadPlaceholderOptions) => ReturnType;
|
|
62
|
-
/** Removes the decoration for one completed, failed, or cancelled image upload. */
|
|
63
|
-
removeUploadPlaceholder: (options: MlvEditorRemoveUploadPlaceholderOptions) => ReturnType;
|
|
64
|
-
/** Atomically inserts an image at the mapped placeholder and removes it. */
|
|
65
|
-
replaceUploadPlaceholder: (options: MlvEditorReplaceUploadPlaceholderOptions) => ReturnType;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Tiptap extension that renders image-upload progress outside the document model.
|
|
71
|
-
*
|
|
72
|
-
* Its widget decorations are intentionally excluded from HTML and Markdown output,
|
|
73
|
-
* so a pending upload can never become persisted editor content.
|
|
74
|
-
*/
|
|
75
|
-
export declare const MlvEditorUploadPlaceholder: Extension<Record<string, never>, MlvEditorUploadPlaceholderStorage>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
/** Public character and word summary for the nearest editor context. */
|
|
3
|
-
export declare class MlvEditorStatus {
|
|
4
|
-
/** Optional maximum character count; invalid values mean unlimited. */
|
|
5
|
-
readonly characterLimit: import("@angular/core").InputSignal<number | null>;
|
|
6
|
-
/** Current character count, or zero when CharacterCount is unavailable. */
|
|
7
|
-
readonly characters: import("@angular/core").Signal<number>;
|
|
8
|
-
/** Current Unicode-whitespace-aware word count. */
|
|
9
|
-
readonly words: import("@angular/core").Signal<number>;
|
|
10
|
-
/** Whether the active extension set exposes CharacterCount storage. */
|
|
11
|
-
readonly available: import("@angular/core").Signal<boolean>;
|
|
12
|
-
/** @protected Normalized limit displayed by the summary. */
|
|
13
|
-
protected readonly _limit: import("@angular/core").Signal<number | null>;
|
|
14
|
-
/** @protected Accessible count and remaining-limit description. */
|
|
15
|
-
protected readonly _ariaLabel: import("@angular/core").Signal<string>;
|
|
16
|
-
/** @private Nearest public editor command context. */
|
|
17
|
-
private readonly _context;
|
|
18
|
-
/** @private Invalidates storage reads after transactions and selections. */
|
|
19
|
-
private readonly _revision;
|
|
20
|
-
/** @private Safely resolves optional Tiptap CharacterCount storage. */
|
|
21
|
-
private readonly _storage;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MlvEditorStatus, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MlvEditorStatus, "mlv-editor-status", never, { "characterLimit": { "alias": "characterLimit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import { MlvMenu, MlvMenuTrigger } from '@malva-ui/core/menu';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/** Left, center, right, and justified paragraph alignment commands in a menu. */
|
|
5
|
-
export declare class MlvEditorAlignment {
|
|
6
|
-
/** @protected Editor command state. */
|
|
7
|
-
protected readonly _context: import("@malva-ui/editor").MlvEditorToolbarContext;
|
|
8
|
-
/** @private Per-editor state invalidation signal. */
|
|
9
|
-
private readonly _revision;
|
|
10
|
-
/** @private The editor-owned overlay registry. */
|
|
11
|
-
private readonly _overlays;
|
|
12
|
-
/** @private Document used to resolve the public menu panel id. */
|
|
13
|
-
private readonly _document;
|
|
14
|
-
/** @private Removes a pending or active overlay registration. */
|
|
15
|
-
private readonly _destroyRef;
|
|
16
|
-
/** @private Optional localized editor copy. */
|
|
17
|
-
private readonly _i18n;
|
|
18
|
-
/** @protected Rendered Malva menu. */
|
|
19
|
-
protected readonly _menu: import("@angular/core").Signal<MlvMenu>;
|
|
20
|
-
/** @protected Trigger owning the menu overlay. */
|
|
21
|
-
protected readonly _trigger: import("@angular/core").Signal<MlvMenuTrigger>;
|
|
22
|
-
/** @private Tears down the active panel registration. */
|
|
23
|
-
private _unregister;
|
|
24
|
-
/** @private Guards queued registration after a quick close or destroy. */
|
|
25
|
-
private _menuOpen;
|
|
26
|
-
/** @protected Supported alignments in visual order. */
|
|
27
|
-
protected readonly _alignments: readonly ["left", "center", "right", "justify"];
|
|
28
|
-
/** @protected Resolved localized copy. */
|
|
29
|
-
protected _copy(): {
|
|
30
|
-
alignment: string;
|
|
31
|
-
left: string;
|
|
32
|
-
center: string;
|
|
33
|
-
right: string;
|
|
34
|
-
justify: string;
|
|
35
|
-
};
|
|
36
|
-
constructor();
|
|
37
|
-
/** @protected Resolves a translated alignment label. */
|
|
38
|
-
protected _label(alignment: (typeof this._alignments)[number]): string;
|
|
39
|
-
/** @protected Current alignment, with left as the semantic default. */
|
|
40
|
-
protected _activeAlignment(): (typeof this._alignments)[number];
|
|
41
|
-
/** @protected Whether the current selection has this alignment. */
|
|
42
|
-
protected _isActive(alignment: (typeof this._alignments)[number]): boolean;
|
|
43
|
-
/** @protected Whether alignment is registered by the active extension set. */
|
|
44
|
-
protected _supported(): boolean;
|
|
45
|
-
/** @protected Whether the menu trigger cannot be opened. */
|
|
46
|
-
protected _triggerDisabled(): boolean;
|
|
47
|
-
/** @protected Whether an alignment cannot be applied at the current selection. */
|
|
48
|
-
protected _disabled(alignment: (typeof this._alignments)[number]): boolean;
|
|
49
|
-
/** @private Checks whether alignment can be applied without changing focus or selection. */
|
|
50
|
-
private _canAlign;
|
|
51
|
-
/** @protected Alignment command factory. */
|
|
52
|
-
protected _align(alignment: (typeof this._alignments)[number]): (editor: Editor) => boolean;
|
|
53
|
-
/** @protected Runs a selection-restoring alignment command. */
|
|
54
|
-
protected _run(alignment: (typeof this._alignments)[number]): void;
|
|
55
|
-
/** @protected Registers the portaled panel as editor-owned focus. */
|
|
56
|
-
protected _registerOverlay(): void;
|
|
57
|
-
/** @protected Removes menu-panel focus ownership after close. */
|
|
58
|
-
protected _unregisterOverlay(): void;
|
|
59
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MlvEditorAlignment, never>;
|
|
60
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MlvEditorAlignment, "mlv-editor-alignment", never, {}, {}, never, never, true, never>;
|
|
61
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/** Blockquote and code-block toggles plus horizontal-rule insertion. */
|
|
4
|
-
export declare class MlvEditorBlockInsert {
|
|
5
|
-
/** @protected Editor command state. */ protected readonly _context: import("@malva-ui/editor").MlvEditorToolbarContext;
|
|
6
|
-
/** @private Triggers active-state refreshes after editor events. */ private readonly _revision;
|
|
7
|
-
/** @private Optional localized copy. */ private readonly _i18n;
|
|
8
|
-
/** @protected Resolved labels. */ protected readonly _copy: import("@angular/core").Signal<{
|
|
9
|
-
blockquote: string;
|
|
10
|
-
codeBlock: string;
|
|
11
|
-
horizontalRule: string;
|
|
12
|
-
}>;
|
|
13
|
-
/** @protected Registered blockquote command. */ protected readonly _canBlockquote: (editor: Editor) => boolean;
|
|
14
|
-
/** @protected Current blockquote command availability. */ protected readonly _canBlockquoteNow: (editor: Editor) => boolean;
|
|
15
|
-
/** @protected Registered code-block command. */ protected readonly _canCodeBlock: (editor: Editor) => boolean;
|
|
16
|
-
/** @protected Current code-block command availability. */ protected readonly _canCodeBlockNow: (editor: Editor) => boolean;
|
|
17
|
-
/** @protected Registered horizontal-rule command. */ protected readonly _canHorizontalRule: (editor: Editor) => boolean;
|
|
18
|
-
/** @protected Current horizontal-rule command availability. */ protected readonly _canHorizontalRuleNow: (editor: Editor) => boolean;
|
|
19
|
-
/** @protected Blockquote command. */ protected readonly _blockquote: (editor: Editor) => boolean;
|
|
20
|
-
/** @protected Code-block command. */ protected readonly _codeBlock: (editor: Editor) => boolean;
|
|
21
|
-
/** @protected Horizontal-rule command. */ protected readonly _horizontalRule: (editor: Editor) => boolean;
|
|
22
|
-
/** @protected Reads command state after the toolbar receives an editor update. */
|
|
23
|
-
protected readonly _isActive: (name: "blockquote" | "codeBlock") => boolean;
|
|
24
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MlvEditorBlockInsert, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MlvEditorBlockInsert, "mlv-editor-block-insert", never, {}, {}, never, never, true, never>;
|
|
26
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { MlvColorPickerPopup } from '@malva-ui/core/color-picker';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
interface EditorSelectionRange {
|
|
5
|
-
readonly from: number;
|
|
6
|
-
readonly to: number;
|
|
7
|
-
}
|
|
8
|
-
/** @internal Shared selection, roving, and overlay lifecycle for colour controls. */
|
|
9
|
-
export declare abstract class MlvEditorColorControl {
|
|
10
|
-
/** @protected Editor-scoped command and state boundary. */
|
|
11
|
-
protected readonly _context: import("@malva-ui/editor").MlvEditorToolbarContext;
|
|
12
|
-
/** @protected Reactive toolbar invalidation state. */
|
|
13
|
-
protected readonly _revision: import("@angular/core").Signal<number> | null;
|
|
14
|
-
/** @protected Public color-picker composition surface. */
|
|
15
|
-
protected readonly _picker: import("@angular/core").Signal<MlvColorPickerPopup>;
|
|
16
|
-
/** @private Editor toolbar roving-focus owner. */
|
|
17
|
-
private readonly _roving;
|
|
18
|
-
/** @private Editor composite detached-overlay owner. */
|
|
19
|
-
private readonly _overlays;
|
|
20
|
-
/** @private ProseMirror selection retained while focus is inside the picker. */
|
|
21
|
-
private _selection;
|
|
22
|
-
constructor();
|
|
23
|
-
/** @protected Snapshots the document selection at open intent. */
|
|
24
|
-
protected _onOpenedChange(opened: boolean): void;
|
|
25
|
-
/** @protected Restores the snapshot and delegates the distinct colour command. */
|
|
26
|
-
protected _apply(color: string): void;
|
|
27
|
-
/** @protected Distinct foreground/highlight command policy. */
|
|
28
|
-
protected abstract _run(editor: Editor, selection: EditorSelectionRange, color: string): boolean;
|
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MlvEditorColorControl, never>;
|
|
30
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MlvEditorColorControl, never, never, {}, {}, never, never, true, never>;
|
|
31
|
-
}
|
|
32
|
-
export {};
|