autumnnote 1.8.0 → 1.8.2

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
@@ -16,9 +16,9 @@ A **zero-dependency WYSIWYG rich-text editor** built with vanilla JavaScript (ES
16
16
 
17
17
  > **Fast. Lightweight. Reliable. Efficient.**
18
18
 
19
- [Live Demo](https://cmm-cmm.github.io/Autumn-Note/) · [Docs](https://cmm-cmm.github.io/Autumn-Note/docs.html) · [Playground](https://cmm-cmm.github.io/Autumn-Note/playground.html)
19
+ [Live Demo](https://autumn.konexforge.com/) · [Docs](https://autumn.konexforge.com/docs.html) · [Playground](https://autumn.konexforge.com/playground.html)
20
20
 
21
- <p align="center"><img src="demo/Screenshot.png" alt="AutumnNote Screenshot"/></p>
21
+ <p align="center"><img src="examples/Screenshot.png" alt="AutumnNote Screenshot"/></p>
22
22
 
23
23
  ---
24
24
 
@@ -384,7 +384,7 @@ editor.invoke('toolbar.rebuild'); // re-render toolbar with new buttons
384
384
  | `context.use(plugin, opts?)` | Install on this instance only. |
385
385
  | `context.getPlugin<T>(name)` | Returns the public API from `plugin.install()`. |
386
386
 
387
- See the [full Plugin API docs →](https://cmm-cmm.github.io/Autumn-Note/docs.html#plugin-api)
387
+ See the [full Plugin API docs →](https://autumn.konexforge.com/docs.html#plugin-api)
388
388
 
389
389
  ---
390
390
 
@@ -406,6 +406,15 @@ See the [full Plugin API docs →](https://cmm-cmm.github.io/Autumn-Note/docs.ht
406
406
  | `editor.getHTML()` | Returns the current HTML. Zero-width spaces from the icon picker are stripped automatically. |
407
407
  | `editor.setHTML(html)` | Sets HTML content (sanitised). `<iframe>` elements are preserved. |
408
408
  | `editor.getText()` | Returns plain text with no markup. |
409
+ | `editor.setText(text)` | Replaces the content with plain text (escaped, no markup). |
410
+ | `editor.getMarkdown()` | Returns the current content converted to Markdown. |
411
+ | `editor.setMarkdown(md)` | Replaces the content, converting the given Markdown to HTML. |
412
+ | `editor.insertHTML(html)` | Inserts sanitised HTML at the current cursor position. |
413
+ | `editor.insertText(text)` | Inserts plain text at the current cursor position. |
414
+ | `editor.downloadHTML(filename?)` | Downloads the current content as an `.html` file (default `document.html`). |
415
+ | `editor.downloadText(filename?)` | Downloads the current content as a `.txt` file (default `document.txt`). |
416
+ | `editor.downloadMarkdown(filename?)` | Downloads the current content as a `.md` file (default `document.md`). |
417
+ | `editor.print(title?)` | Opens the browser print dialog with the current content in a clean printable layout. |
409
418
  | `editor.clear()` | Clears all content, resets to an empty `<p>`. |
410
419
  | `editor.clearHistory()` | Resets the undo/redo stack. |
411
420
  | `editor.getUndoCount()` | Returns the number of available undo steps. |
@@ -414,6 +423,9 @@ See the [full Plugin API docs →](https://cmm-cmm.github.io/Autumn-Note/docs.ht
414
423
  | `editor.getCharCount()` | Returns the current character count. |
415
424
  | `editor.getTableOfContents()` | Returns an array of `{ level, text, element }` heading objects. |
416
425
  | `editor.setDisabled(bool)` | Disables (`true`) or re-enables (`false`) the editor and toolbar. |
426
+ | `editor.focus()` | Moves keyboard focus to the editable area. |
427
+ | `editor.blur()` | Removes keyboard focus from the editable area. |
428
+ | `editor.isFullscreen()` | Returns `true` if the editor is currently in fullscreen mode. |
417
429
  | `editor.destroy()` | Removes the editor, disposes all modules, and restores the original element. |
418
430
  | `editor.on(event, fn)` | Subscribes to an editor event. Returns an unsubscribe function. |
419
431
  | `editor.off(event, fn)` | Removes a previously registered listener. |
@@ -665,11 +677,11 @@ src/
665
677
  │ │ ├── key.js Keyboard key constants
666
678
  │ │ ├── lists.js Array helpers
667
679
  │ │ ├── env.js Browser/platform detection
668
- │ │ ├── markdown.js Lightweight Markdown to HTML converter
680
+ │ │ ├── markdown.js Bidirectional HTML ↔ Markdown conversion (with GFM checklists)
669
681
  │ │ └── sanitise.js DOM-based HTML and URL sanitiser
670
682
  │ ├── editing/
671
683
  │ │ ├── History.js Undo/redo stack (configurable depth)
672
- │ │ ├── Style.js execCommand style wrappers
684
+ │ │ ├── Style.js Formatting commands (execCommand + DOM list/checklist transitions)
673
685
  │ │ ├── Table.js Table creation and cell manipulation
674
686
  │ │ └── Typing.js Tab/Enter/ArrowKey behaviour and FA icon caret handling
675
687
  │ ├── module/
@@ -22,7 +22,12 @@
22
22
  }
23
23
  .an-container.an-focused {
24
24
  border-color: var(--an-focus-color, #3b82f6);
25
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--an-focus-color, #3b82f6) 18%, transparent);
25
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
26
+ }
27
+ @supports (color: color-mix(in srgb, red, blue)) {
28
+ .an-container.an-focused {
29
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--an-focus-color, #3b82f6) 18%, transparent);
30
+ }
26
31
  }
27
32
  .an-container.an-disabled .an-toolbar {
28
33
  display: none;
@@ -482,6 +487,18 @@
482
487
  background: #f9fafb;
483
488
  font-weight: 600;
484
489
  }
490
+ .an-editable table th.an-sort-asc::after, .an-editable table th.an-sort-desc::after, .an-editable .an-table th.an-sort-asc::after, .an-editable .an-table th.an-sort-desc::after {
491
+ display: inline-block;
492
+ margin-left: 6px;
493
+ font-size: 0.7em;
494
+ opacity: 0.6;
495
+ }
496
+ .an-editable table th.an-sort-asc::after, .an-editable .an-table th.an-sort-asc::after {
497
+ content: "▲";
498
+ }
499
+ .an-editable table th.an-sort-desc::after, .an-editable .an-table th.an-sort-desc::after {
500
+ content: "▼";
501
+ }
485
502
 
486
503
  .an-link-tooltip {
487
504
  position: fixed;