markdown-text-editor 2.0.0-beta.0 → 2.0.0-beta.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 +78 -4
- package/dist/markdown-text-editor.es.js +23 -16
- package/dist/markdown-text-editor.es.js.map +1 -1
- package/dist/markdown-text-editor.min.js +6 -6
- package/dist/markdown-text-editor.min.js.map +1 -1
- package/dist/markdown-text-editor.umd.js +6 -6
- package/dist/markdown-text-editor.umd.js.map +1 -1
- package/locale/ar.js +55 -0
- package/locale/az.js +55 -0
- package/locale/bg.js +55 -0
- package/locale/bn.js +55 -0
- package/locale/bs.js +55 -0
- package/locale/ca.js +55 -0
- package/locale/cs.js +55 -0
- package/locale/da.js +55 -0
- package/locale/de.js +55 -0
- package/locale/el.js +55 -0
- package/locale/es.js +55 -0
- package/locale/et.js +55 -0
- package/locale/fa.js +55 -0
- package/locale/fi.js +55 -0
- package/locale/fil.js +55 -0
- package/locale/fr.js +55 -0
- package/locale/ga.js +55 -0
- package/locale/he.js +55 -0
- package/locale/hi.js +55 -0
- package/locale/hr.js +55 -0
- package/locale/hu.js +55 -0
- package/locale/hy.js +55 -0
- package/locale/id.js +55 -0
- package/locale/is.js +55 -0
- package/locale/it.js +55 -0
- package/locale/ja.js +55 -0
- package/locale/kn.js +55 -0
- package/locale/ko.js +55 -0
- package/locale/locale.d.ts +10 -0
- package/locale/lt.js +55 -0
- package/locale/lv.js +55 -0
- package/locale/mk.js +55 -0
- package/locale/mr.js +55 -0
- package/locale/ms.js +55 -0
- package/locale/mt.js +55 -0
- package/locale/nl.js +55 -0
- package/locale/no.js +55 -0
- package/locale/pl.js +55 -0
- package/locale/pt.js +55 -0
- package/locale/ro.js +55 -0
- package/locale/ru.js +55 -0
- package/locale/sk.js +55 -0
- package/locale/sl.js +55 -0
- package/locale/sq.js +55 -0
- package/locale/sr.js +55 -0
- package/locale/sv.js +55 -0
- package/locale/sw.js +55 -0
- package/locale/ta.js +55 -0
- package/locale/te.js +55 -0
- package/locale/template.js +62 -0
- package/locale/th.js +55 -0
- package/locale/tr.js +55 -0
- package/locale/uk.js +55 -0
- package/locale/ur.js +55 -0
- package/locale/uz.js +55 -0
- package/locale/vi.js +55 -0
- package/locale/zh-hk.js +55 -0
- package/locale/zh.js +55 -0
- package/package.json +13 -2
- package/types/index.d.ts +16 -5
package/types/index.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ export type CustomTool = new (editor: MarkdownEditor, config?: any) => {
|
|
|
114
114
|
*/
|
|
115
115
|
export interface DeclarativeTool {
|
|
116
116
|
custom: {
|
|
117
|
-
/** Tooltip, and the source of the button's CSS class. Translatable via `
|
|
117
|
+
/** Tooltip, and the source of the button's CSS class. Translatable via `locale`. */
|
|
118
118
|
title: string;
|
|
119
119
|
/** Inline SVG for the button face. */
|
|
120
120
|
icon?: string;
|
|
@@ -185,11 +185,22 @@ export interface MarkdownEditorOptions {
|
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Translations for the editor's own interface, keyed by the English text:
|
|
188
|
-
* tooltips, menu items, modal fields
|
|
189
|
-
* in English. CSS class names are unaffected.
|
|
188
|
+
* tooltips, menu items, modal fields, buttons and screen reader names.
|
|
189
|
+
* Anything not listed stays in English. CSS class names are unaffected.
|
|
190
190
|
*
|
|
191
|
-
*
|
|
191
|
+
* Takes the strings themselves, not a language code. Import the one you want
|
|
192
|
+
* so nobody pays for the languages they do not use.
|
|
193
|
+
* `locale/template.js` lists every key.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* import es from 'markdown-text-editor/locale/es.js';
|
|
197
|
+
* new MarkdownEditor('#editor', { locale: es });
|
|
198
|
+
*
|
|
199
|
+
* @example locale: { Bold: 'Negrita', '{n} words': '{n} palabras' }
|
|
192
200
|
*/
|
|
201
|
+
locale?: Record<string, string>;
|
|
202
|
+
|
|
203
|
+
/** @deprecated Renamed to `locale` in 2.0.0. Still works. */
|
|
193
204
|
labels?: Record<string, string>;
|
|
194
205
|
|
|
195
206
|
/**
|
|
@@ -258,7 +269,7 @@ export default class MarkdownEditor {
|
|
|
258
269
|
/**
|
|
259
270
|
* Builds a small toolbar bound to another textarea, for a custom tool that
|
|
260
271
|
* collects rich text in its own dialog. The tools are the real ones, and
|
|
261
|
-
* `
|
|
272
|
+
* `locale` is inherited. Returns the element; append it where you like.
|
|
262
273
|
*
|
|
263
274
|
* No preview button is added, whatever you pass.
|
|
264
275
|
*/
|