@mdaemon/html-editor 1.0.7 → 1.0.8

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 CHANGED
@@ -252,8 +252,8 @@ All built-in toolbar button names that can be used in the `toolbar` config strin
252
252
  | `image` | Insert image dialog (upload file or enter URL) |
253
253
  | `charmap` | Special character picker (currency, math, arrows, symbols, Greek, punctuation) |
254
254
  | `emoticons` | Emoji picker with search (smileys, gestures, hearts, objects, symbols, arrows) |
255
- | `code` | Toggle code block |
256
- | `link` | Insert/edit hyperlink dialog |
255
+ | `code` | Open HTML source code editor dialog |
256
+ | `link` | Open Insert/Edit Link dialog |
257
257
  | `codesample` | Toggle code sample block |
258
258
  | `fullscreen` | Toggle fullscreen editing mode |
259
259
  | `preview` | Open content preview in a new window |
@@ -298,6 +298,23 @@ const editor = new HTMLEditor(container, {
298
298
  });
299
299
  ```
300
300
 
301
+ ## Source Code Editor
302
+
303
+ The `code` toolbar button opens a modal dialog for viewing and editing the raw HTML source of the editor content. The dialog features a full-size monospace textarea with the current HTML, **Cancel** and **Save** buttons, and supports Escape to close and Tab to indent.
304
+
305
+ The dialog inherits the active skin theme — oxide, oxide-dark, confab, and confab-dark are all supported automatically.
306
+
307
+ ## Insert/Edit Link
308
+
309
+ The `link` toolbar button opens a modal dialog for inserting or editing hyperlinks with the following fields:
310
+
311
+ - **URL** — the link destination
312
+ - **Text to display** — the visible link text (pre-populated from selection)
313
+ - **Title** — the HTML `title` attribute (shown as a tooltip on hover)
314
+ - **Open link in…** — dropdown to choose between _Current window_ or _New window_ (`target="_blank"`)
315
+
316
+ When editing an existing link, all fields are pre-populated from the current link attributes. Clearing the URL and saving removes the link. The dialog inherits the active skin theme.
317
+
301
318
  ## Search & Replace
302
319
 
303
320
  The `searchreplace` toolbar button (or **Ctrl/Cmd+F**) opens a Find & Replace dialog with:
package/dist/index.d.ts CHANGED
@@ -322,6 +322,29 @@ declare interface LineHeightOptions {
322
322
  defaultLineHeight: string;
323
323
  }
324
324
 
325
+ export declare class LinkEditor {
326
+ private options;
327
+ private overlay;
328
+ private dialog;
329
+ private urlInput;
330
+ private textInput;
331
+ private titleInput;
332
+ private targetSelect;
333
+ constructor(options: LinkEditorOptions);
334
+ private get tiptap();
335
+ open(): void;
336
+ close(): void;
337
+ private populateFromSelection;
338
+ private save;
339
+ private createDialog;
340
+ destroy(): void;
341
+ }
342
+
343
+ export declare interface LinkEditorOptions {
344
+ editor: HTMLEditor;
345
+ trans: (key: string) => string;
346
+ }
347
+
325
348
  /**
326
349
  * Main HTMLEditor class interface
327
350
  */
@@ -404,6 +427,25 @@ export declare function setTranslate(fn: TranslateFunction): void;
404
427
 
405
428
  export declare const SignatureBlock: Node_2<any, any>;
406
429
 
430
+ export declare class SourceEditor {
431
+ private options;
432
+ private overlay;
433
+ private dialog;
434
+ private textarea;
435
+ constructor(options: SourceEditorOptions);
436
+ private get tiptap();
437
+ open(): void;
438
+ close(): void;
439
+ private save;
440
+ private createDialog;
441
+ destroy(): void;
442
+ }
443
+
444
+ export declare interface SourceEditorOptions {
445
+ editor: HTMLEditor;
446
+ trans: (key: string) => string;
447
+ }
448
+
407
449
  /**
408
450
  * Template object for email templates
409
451
  */
@@ -433,6 +475,8 @@ export declare class Toolbar {
433
475
  private emojiPicker;
434
476
  private imageUpload;
435
477
  private searchReplace;
478
+ private sourceEditor;
479
+ private linkEditor;
436
480
  private updateInterval;
437
481
  private boundClickHandler;
438
482
  private boundKeydownHandler;