autumnnote 1.14.0 → 1.15.0
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 -10
- package/dist/autumnnote.cjs +61 -0
- package/dist/autumnnote.css +2 -2579
- package/dist/autumnnote.es.js +4449 -9977
- package/dist/autumnnote.es.js.map +1 -1
- package/dist/autumnnote.umd.js +39 -17545
- package/dist/autumnnote.umd.js.map +1 -1
- package/package.json +23 -14
- package/src/js/core/sanitise.js +47 -11
- package/src/js/index.js +1 -1
- package/src/js/module/Clipboard.js +5 -1
- package/src/js/module/Editor.js +10 -4
- package/src/js/module/ImageCropOverlay.js +5 -0
- package/src/js/module/TableTooltip.js +2 -1
- package/src/js/module/VideoDialog.js +3 -13
- package/src/js/settings.js +3 -0
- package/types/core/dom.d.ts +32 -0
- package/types/core/env.d.ts +10 -0
- package/types/core/func.d.ts +11 -0
- package/types/core/key.d.ts +3 -0
- package/types/core/lists.d.ts +10 -0
- package/types/core/range.d.ts +22 -0
- package/types/core/sanitise.d.ts +9 -0
- package/types/index.d.ts +19 -8
- package/dist/_headers +0 -5
- package/dist/image/banner.png +0 -0
- package/dist/image/favicon.ico +0 -0
- package/dist/image/og-banner.png +0 -0
- package/dist/robots.txt +0 -4
- package/dist/sitemap.xml +0 -58
package/README.md
CHANGED
|
@@ -121,7 +121,7 @@ Right-click inside the editor opens a context menu with: **Undo**, **Redo**, **C
|
|
|
121
121
|
### Security
|
|
122
122
|
- All HTML (pasted content, `setHTML()`, or code-view output) passes through a DOM-based sanitiser that strips `<script>`, `<object>`, `<embed>`, and all `on*` event handler attributes
|
|
123
123
|
- `<iframe>` elements are permitted in `setHTML()` with src restricted to trusted CDN hosts; `srcdoc` is stripped
|
|
124
|
-
-
|
|
124
|
+
- Links use an HTTP(S)/`mailto:`/`tel:` allowlist; images additionally allow approved raster data URIs, while SVG data URIs are rejected
|
|
125
125
|
- Clipboard paste sanitises rich content to remove XSS vectors before inserting
|
|
126
126
|
- `pasteStripAttributes` option strips `class`, `style`, and `data-*` from pasted HTML
|
|
127
127
|
|
|
@@ -231,7 +231,7 @@ const editorRef = ref(null);
|
|
|
231
231
|
</template>
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
Access the editor instance via `editorRef.value.editor
|
|
234
|
+
Access the editor instance via `editorRef.value.editor`; Vue unwraps the component's internal shallow ref.
|
|
235
235
|
|
|
236
236
|
---
|
|
237
237
|
|
|
@@ -409,7 +409,7 @@ See the [full Plugin API docs →](https://autumn.konexforge.com/docs.html#plugi
|
|
|
409
409
|
| Method | Description |
|
|
410
410
|
|---|---|
|
|
411
411
|
| `editor.getHTML()` | Returns the current HTML. Zero-width spaces from the icon picker are stripped automatically. |
|
|
412
|
-
| `editor.setHTML(html)` | Sets HTML content (sanitised). `<iframe>`
|
|
412
|
+
| `editor.setHTML(html)` | Sets HTML content (sanitised). Only trusted HTTPS YouTube/Vimeo `<iframe>` sources are preserved. |
|
|
413
413
|
| `editor.getText()` | Returns plain text with no markup. |
|
|
414
414
|
| `editor.setText(text)` | Replaces the content with plain text (escaped, no markup). |
|
|
415
415
|
| `editor.getMarkdown()` | Returns the current content converted to Markdown. |
|
|
@@ -447,6 +447,7 @@ See the [full Plugin API docs →](https://autumn.konexforge.com/docs.html#plugi
|
|
|
447
447
|
| `imageUpload` | `files: FileList` | Fired when images are dropped or pasted (when `onImageUpload` is provided). |
|
|
448
448
|
| `imageError` | `{ file, message }` | Fired when an image is rejected (e.g. over `maxImageSize`). |
|
|
449
449
|
| `paste` | `{ text, html }` | Fired after every paste event. |
|
|
450
|
+
| `pasteError` | `{ message, size?, maxBytes? }` | Fired when paste/drop exceeds `maxPasteSize` or a dropped Markdown file cannot be read. |
|
|
450
451
|
| `selectionChange` | `context` | Fired when the cursor or selection changes. |
|
|
451
452
|
| `destroy` | `context` | Fired just before the editor is destroyed. |
|
|
452
453
|
| `charLimitReached` | `context` | Fired when `maxChars` is hit. |
|
|
@@ -513,6 +514,7 @@ See the [full Plugin API docs →](https://autumn.konexforge.com/docs.html#plugi
|
|
|
513
514
|
| `onImageUpload` | `Function` | `null` | `(files: FileList) => void` — custom upload handler. Overrides base64 embed. |
|
|
514
515
|
| `onImageError` | `Function` | `null` | `({ file, message }) => void` — called when an image is rejected. |
|
|
515
516
|
| `onPaste` | `Function` | `null` | `({ text, html }) => void` — called after every paste event. |
|
|
517
|
+
| `onPasteError` | `Function` | `null` | `({ message, size?, maxBytes? }) => void` — called when pasted or dropped content cannot be processed. |
|
|
516
518
|
| `onSelectionChange` | `Function` | `null` | `(context) => void` — called when cursor or selection changes. |
|
|
517
519
|
| `onDestroy` | `Function` | `null` | `(context) => void` — called just before the editor is destroyed. |
|
|
518
520
|
| `onCharLimitReached` | `Function` | `null` | `(context) => void` — called when `maxChars` is hit. |
|
|
@@ -746,16 +748,18 @@ autumn-note-ce/
|
|
|
746
748
|
|
|
747
749
|
### Development commands
|
|
748
750
|
|
|
751
|
+
Development and package usage require Node 20.19+ and pnpm 11.1.3.
|
|
752
|
+
|
|
749
753
|
```bash
|
|
750
754
|
pnpm install # install all workspace packages
|
|
751
|
-
|
|
752
|
-
|
|
755
|
+
pnpm dev # start Vite dev server with HMR
|
|
756
|
+
pnpm build # build core ES + UMD + CSS to dist/
|
|
753
757
|
pnpm --filter autumnnote-react build # build React wrapper
|
|
754
758
|
pnpm --filter autumnnote-vue build # build Vue wrapper
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
+
pnpm test # run Vitest test suite once
|
|
760
|
+
pnpm test:watch # run tests in watch mode
|
|
761
|
+
pnpm lint # ESLint
|
|
762
|
+
pnpm typecheck # TypeScript type check (tsconfig.json)
|
|
759
763
|
```
|
|
760
764
|
|
|
761
765
|
Build output in `dist/`:
|
|
@@ -763,7 +767,8 @@ Build output in `dist/`:
|
|
|
763
767
|
| File | Format | Use |
|
|
764
768
|
|---|---|---|
|
|
765
769
|
| `autumnnote.es.js` | ES Module | `import` in bundlers (tree-shakeable) |
|
|
766
|
-
| `autumnnote.umd.js` | UMD | `<script>` tag
|
|
770
|
+
| `autumnnote.umd.js` | UMD | Browser `<script>` tag |
|
|
771
|
+
| `autumnnote.cjs` | CommonJS | `require('autumnnote')` in Node.js |
|
|
767
772
|
| `autumnnote.css` | CSS | Styles for both builds |
|
|
768
773
|
|
|
769
774
|
---
|