autumnnote 1.8.0 → 1.8.1
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 +15 -3
- package/dist/autumnnote.css +24 -1
- package/dist/autumnnote.es.js +348 -119
- package/dist/autumnnote.es.js.map +1 -1
- package/dist/autumnnote.umd.js +348 -119
- package/dist/autumnnote.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/js/core/markdown.js +32 -6
- package/src/js/editing/Style.js +288 -159
- package/src/js/editing/Table.js +10 -2
- package/src/js/editing/Typing.js +21 -4
- package/src/js/i18n/de.js +10 -0
- package/src/js/i18n/es.js +10 -0
- package/src/js/i18n/fr.js +10 -0
- package/src/js/i18n/ja.js +10 -0
- package/src/js/i18n/ko.js +10 -0
- package/src/js/i18n/vi.js +8 -0
- package/src/js/i18n/zh.js +10 -0
- package/src/js/module/Clipboard.js +1 -1
- package/src/js/module/ImageDialog.js +1 -0
- package/src/js/module/Mention.js +9 -1
- package/src/js/module/TableTooltip.js +21 -0
- package/src/styles/autumnnote.scss +23 -3
- package/types/index.d.ts +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ A **zero-dependency WYSIWYG rich-text editor** built with vanilla JavaScript (ES
|
|
|
18
18
|
|
|
19
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)
|
|
20
20
|
|
|
21
|
-
<p align="center"><img src="
|
|
21
|
+
<p align="center"><img src="examples/Screenshot.png" alt="AutumnNote Screenshot"/></p>
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -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
|
|
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
|
|
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/
|
package/dist/autumnnote.css
CHANGED
|
@@ -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
|
|
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;
|
|
@@ -351,6 +356,12 @@
|
|
|
351
356
|
padding: 12px 14px;
|
|
352
357
|
min-height: 0;
|
|
353
358
|
outline: none;
|
|
359
|
+
}
|
|
360
|
+
.an-editable:focus-visible {
|
|
361
|
+
outline: 2px solid var(--an-focus-color, #3b82f6);
|
|
362
|
+
outline-offset: -2px;
|
|
363
|
+
}
|
|
364
|
+
.an-editable {
|
|
354
365
|
line-height: 1.6;
|
|
355
366
|
color: #111827;
|
|
356
367
|
overflow-y: auto;
|
|
@@ -482,6 +493,18 @@
|
|
|
482
493
|
background: #f9fafb;
|
|
483
494
|
font-weight: 600;
|
|
484
495
|
}
|
|
496
|
+
.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 {
|
|
497
|
+
display: inline-block;
|
|
498
|
+
margin-left: 6px;
|
|
499
|
+
font-size: 0.7em;
|
|
500
|
+
opacity: 0.6;
|
|
501
|
+
}
|
|
502
|
+
.an-editable table th.an-sort-asc::after, .an-editable .an-table th.an-sort-asc::after {
|
|
503
|
+
content: "▲";
|
|
504
|
+
}
|
|
505
|
+
.an-editable table th.an-sort-desc::after, .an-editable .an-table th.an-sort-desc::after {
|
|
506
|
+
content: "▼";
|
|
507
|
+
}
|
|
485
508
|
|
|
486
509
|
.an-link-tooltip {
|
|
487
510
|
position: fixed;
|