autumnnote 1.16.0 → 2.0.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 +31 -2
- package/dist/autumnnote.cjs +21 -21
- package/dist/autumnnote.es.js +1173 -6068
- package/dist/autumnnote.es.js.map +1 -1
- package/dist/autumnnote.min.js +21 -21
- package/dist/autumnnote.umd.js +21 -21
- package/dist/autumnnote.umd.js.map +1 -1
- package/dist/emoji-data-BDQX5kh-.js +2331 -0
- package/dist/emoji-data-BDQX5kh-.js.map +1 -0
- package/package.json +5 -1
- package/src/js/Context.js +68 -8
- package/src/js/i18n/all.js +27 -0
- package/src/js/i18n/index.js +45 -19
- package/src/js/index.js +12 -2
- package/src/js/index.umd.js +5 -0
- package/src/js/module/BaseMediaTooltip.js +142 -0
- package/src/js/module/BaseResizer.js +312 -0
- package/src/js/module/EmojiDialog.js +41 -494
- package/src/js/module/ImageResizer.js +23 -241
- package/src/js/module/ImageTooltip.js +16 -111
- package/src/js/module/VideoResizer.js +38 -239
- package/src/js/module/VideoTooltip.js +27 -114
- package/src/js/module/emoji-data.js +496 -0
- package/types/i18n/all.d.ts +14 -0
- package/types/i18n/de.d.ts +4 -0
- package/types/i18n/en.d.ts +4 -0
- package/types/i18n/es.d.ts +4 -0
- package/types/i18n/fr.d.ts +4 -0
- package/types/i18n/ja.d.ts +4 -0
- package/types/i18n/ko.d.ts +4 -0
- package/types/i18n/vi.d.ts +4 -0
- package/types/i18n/zh.d.ts +4 -0
- package/types/index.d.ts +30 -4
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/autumnnote)
|
|
7
7
|
[](https://bundlephobia.com/package/autumnnote)
|
|
8
8
|
[](https://github.com/cmm-cmm/Autumn-Note)
|
|
9
|
-
[](https://github.com/cmm-cmm/Autumn-Note/actions/workflows/ci.yml)
|
|
10
10
|
[](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
|
|
11
11
|
[](https://opensource.org/licenses/MIT)
|
|
12
12
|
[](#)
|
|
@@ -497,7 +497,7 @@ See the [full Plugin API docs →](https://autumn.konexforge.com/docs.html#plugi
|
|
|
497
497
|
| `codeHighlightCDN` | `string` | cdnjs Prism 1.29.0 | Base CDN URL for Prism assets. |
|
|
498
498
|
| `colorSwatches` | `string[]` | `[]` | Custom brand colour swatches prepended to the colour picker palette. |
|
|
499
499
|
| `focusColor` | `string` | `null` | Custom focus ring colour (any valid CSS colour). Overrides the default blue. |
|
|
500
|
-
| `lang` | `string \| object` | `'en'` | UI display language.
|
|
500
|
+
| `lang` | `string \| object` | `'en'` | UI display language. `'en'` is built in; other codes must be registered first — see [Languages](#languages). Pass a partial locale object for custom overrides. |
|
|
501
501
|
| `markdownShortcuts` | `boolean` | `true` | Convert Markdown-style syntax typed in the editor to HTML in real time (block and inline rules). |
|
|
502
502
|
| `bubbleToolbar` | `boolean` | `false` | Show a mini floating toolbar above the text selection for quick formatting. |
|
|
503
503
|
| `bubbleToolbarItems` | `string[]` | `['bold','italic','underline','link','foreColor','hiliteColor','removeFormat']` | Buttons shown in the bubble toolbar. Available names: `'bold'`, `'italic'`, `'underline'`, `'strikethrough'`, `'link'`, `'foreColor'`, `'hiliteColor'`, `'removeFormat'`, `'inlineCode'`. |
|
|
@@ -793,6 +793,35 @@ const editor = AutumnNote.create('#editor', {
|
|
|
793
793
|
|
|
794
794
|
The React wrapper supports `value`, `defaultValue`, and `onChange`; the Vue wrapper supports `v-model`. Use `importDocument()` / `exportDocument()` to register application-specific formats without adding runtime dependencies to the core package.
|
|
795
795
|
|
|
796
|
+
### Languages
|
|
797
|
+
|
|
798
|
+
Eight locales ship with the package: `en`, `vi`, `ja`, `zh`, `fr`, `de`, `es`, `ko`.
|
|
799
|
+
|
|
800
|
+
**ESM / bundler** — English is built in; register any other locale you need. Bundling all eight cost every consumer ~17 KB gzip even when only English was ever rendered, so they are opt-in:
|
|
801
|
+
|
|
802
|
+
```js
|
|
803
|
+
import AutumnNote from 'autumnnote';
|
|
804
|
+
import { vi } from 'autumnnote/i18n/vi';
|
|
805
|
+
|
|
806
|
+
AutumnNote.registerLocale('vi', vi);
|
|
807
|
+
AutumnNote.create('#editor', { lang: 'vi' });
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
**UMD / CDN (`<script>` tag)** — all eight locales are pre-registered, so `lang` works with no extra setup:
|
|
811
|
+
|
|
812
|
+
```html
|
|
813
|
+
<script src="dist/autumnnote.umd.js"></script>
|
|
814
|
+
<script>
|
|
815
|
+
AutumnNote.create('#editor', { lang: 'vi' });
|
|
816
|
+
</script>
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
Requesting an unregistered code falls back to English and logs a warning telling you which import is missing. A partial locale object still works inline without registering anything:
|
|
820
|
+
|
|
821
|
+
```js
|
|
822
|
+
AutumnNote.create('#editor', { lang: { toolbar: { bold: 'Vet' } } });
|
|
823
|
+
```
|
|
824
|
+
|
|
796
825
|
---
|
|
797
826
|
|
|
798
827
|
## Comparison
|