@kodaeditor/core 1.0.0 → 1.0.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/dist/docx-import.d.ts +11 -11
- package/dist/editor.d.ts +109 -159
- package/dist/fallback.d.ts +7 -8
- package/dist/i18n.d.ts +15 -26
- package/dist/import-formats.d.ts +19 -17
- package/dist/index.d.ts +4 -4
- package/dist/kodaeditor-core.umd.cjs +1 -1
- package/dist/kodaeditor.js +1 -1
- package/dist/kodaeditor.umd.cjs +1 -1
- package/dist/license.d.ts +46 -50
- package/dist/schema.d.ts +7 -7
- package/dist/serialize.d.ts +11 -11
- package/dist/web-component.d.ts +80 -189
- package/package.json +4 -6
- package/dist/commands.d.ts +0 -15
- package/dist/docx-alignment.d.ts +0 -14
- package/dist/docx-breaks.d.ts +0 -31
- package/dist/docx-forms.d.ts +0 -28
- package/dist/docx-headers.d.ts +0 -22
- package/dist/docx-images.d.ts +0 -41
- package/dist/docx-math.d.ts +0 -18
- package/dist/docx-styles.d.ts +0 -53
- package/dist/docx-symbols.d.ts +0 -19
- package/dist/docx-text-styles.d.ts +0 -27
- package/dist/floatingToolbar.d.ts +0 -7
- package/dist/group-icons.d.ts +0 -17
- package/dist/icons.d.ts +0 -1
- package/dist/image-view.d.ts +0 -27
- package/dist/markdown.d.ts +0 -4
- package/dist/menubar.d.ts +0 -60
- package/dist/offline-license.d.ts +0 -36
- package/dist/pagination.d.ts +0 -11
- package/dist/paste.d.ts +0 -54
- package/dist/pdf-import-cdn.d.ts +0 -2
- package/dist/pdf-import.d.ts +0 -8
- package/dist/print.d.ts +0 -18
- package/dist/rtf-images.d.ts +0 -24
- package/dist/search.d.ts +0 -17
- package/dist/slashMenu.d.ts +0 -8
- package/dist/styles.d.ts +0 -8
- package/dist/table-split.d.ts +0 -26
- package/dist/table-view.d.ts +0 -34
- package/dist/tableColumnTrade.d.ts +0 -15
- package/dist/tableToolbar.d.ts +0 -14
- package/dist/toc-view.d.ts +0 -23
- package/dist/toolbar-editor.d.ts +0 -89
- package/dist/validate-signature.d.ts +0 -64
- package/dist/xlsx-import-cdn.d.ts +0 -1
- package/dist/xlsx-import.d.ts +0 -2
package/dist/i18n.d.ts
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Interface localisation for KodaEditor.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Seven locales ship with the editor. Set one with the locale attribute on
|
|
5
|
+
* <koda-editor>, or let it be inherited from lang. Only interface strings are
|
|
6
|
+
* translated - button tooltips, ARIA labels, the watermark. The content of
|
|
7
|
+
* the document is never touched.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* дефолт сменён.
|
|
14
|
-
*
|
|
15
|
-
* Узбекский (uz-latn/uz-cyrl) убран в тот же день - был сделан под
|
|
16
|
-
* конкретного локального заказчика (meplab), тот больше не действует.
|
|
17
|
-
* Полная версия с узбекским сохранена в git-ветке
|
|
18
|
-
* archive/meplab-uzbek-locale, не удалена безвозвратно.
|
|
9
|
+
* English is the default when nothing is specified. If your users need a
|
|
10
|
+
* language that is not here, supply your own dictionary through the strings
|
|
11
|
+
* property or the strings-ref attribute: overrides are applied on top of the
|
|
12
|
+
* chosen locale, so a partial translation is fine.
|
|
19
13
|
*/
|
|
20
14
|
export type Locale = 'en' | 'ru' | 'es' | 'de' | 'ja' | 'fr' | 'ko';
|
|
21
15
|
export interface Strings {
|
|
@@ -120,7 +114,7 @@ export interface Strings {
|
|
|
120
114
|
imageWrongType: string;
|
|
121
115
|
imageUploadFailed: string;
|
|
122
116
|
watermark: string;
|
|
123
|
-
/**
|
|
117
|
+
/** Short text tiled across the canvas as the diagonal watermark. */
|
|
124
118
|
watermarkShort: string;
|
|
125
119
|
menubarLabel: string;
|
|
126
120
|
menuFile: string;
|
|
@@ -198,17 +192,12 @@ export interface Strings {
|
|
|
198
192
|
pagination: string;
|
|
199
193
|
}
|
|
200
194
|
/**
|
|
201
|
-
*
|
|
202
|
-
* По умолчанию (locale-атрибут не задан или не распознан) - 'en': продукт
|
|
203
|
-
* продаётся глобально под брендом KodaEditor, английский - базовый язык
|
|
204
|
-
* рынка. Явный 'ru' по-прежнему распознаётся и работает как раньше.
|
|
195
|
+
* Normalises an arbitrary locale string to a supported one.
|
|
205
196
|
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* locale="uz-latn"/"uz-cyrl" теперь просто тихо откатывается на 'en' -
|
|
211
|
-
* не ошибка, деградация в духе остального проекта (не блокировка).
|
|
197
|
+
* Anything unrecognised, or nothing at all, resolves to 'en'. A regional tag
|
|
198
|
+
* is matched by its language part, so "de-AT" and "fr-CA" work as expected.
|
|
199
|
+
* An unsupported language is never an error: the editor falls back to English
|
|
200
|
+
* rather than refusing to start.
|
|
212
201
|
*/
|
|
213
202
|
export declare function resolveLocale(input?: string | null): Locale;
|
|
214
203
|
export declare function getStrings(locale: Locale): Strings;
|
package/dist/import-formats.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* - CSV
|
|
4
|
-
* -
|
|
5
|
-
*
|
|
2
|
+
* Import of the lightweight formats, with no dependencies and no server:
|
|
3
|
+
* - CSV and TSV become an HTML table, the first row its header
|
|
4
|
+
* - plain text becomes paragraphs
|
|
5
|
+
* The heavier formats (PDF, xlsx) and Markdown live in their own modules.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* detectImportFormat() is the single place where the format is decided from
|
|
8
|
+
* the file name and MIME type. The functions here take a string and return
|
|
9
|
+
* HTML; inserting it is Editor.importFile's job.
|
|
9
10
|
*/
|
|
10
11
|
export type ImportFormat = 'docx' | 'pdf' | 'xlsx' | 'csv' | 'txt' | 'md' | 'html' | 'doc' | 'image' | 'unknown';
|
|
11
|
-
/**
|
|
12
|
+
/** Determines the file format from its name and MIME type. */
|
|
12
13
|
export declare function detectImportFormat(name: string, mime?: string): ImportFormat;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Parses CSV along the lines of RFC 4180: quotes escape the separator and
|
|
16
|
+
* line breaks, and "" inside quotes is a literal quote. Returns a matrix of
|
|
17
|
+
* strings.
|
|
16
18
|
*/
|
|
17
19
|
export declare function parseCsv(text: string, delimiter?: string): string[][];
|
|
18
|
-
/**
|
|
20
|
+
/** Turns a matrix of values into an HTML table, the first row its header. */
|
|
19
21
|
export declare function rowsToTableHtml(rows: unknown[][]): string;
|
|
20
|
-
/**
|
|
22
|
+
/** A merged cell range, zero-based and inclusive, in the SheetJS `!merges` shape. */
|
|
21
23
|
export interface CellMergeRange {
|
|
22
24
|
s: {
|
|
23
25
|
r: number;
|
|
@@ -29,13 +31,13 @@ export interface CellMergeRange {
|
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* Turns a matrix of values plus a list of merges into an HTML table with
|
|
35
|
+
* colspan and rowspan. The schema already parses those attributes, which is
|
|
36
|
+
* how merged cells from Word tables survive; this generates them for
|
|
37
|
+
* spreadsheet import.
|
|
36
38
|
*/
|
|
37
39
|
export declare function rowsToTableHtmlWithMerges(rows: unknown[][], merges: CellMergeRange[]): string;
|
|
38
|
-
/** CSV
|
|
40
|
+
/** Turns CSV or TSV into an HTML table, the first row its header. */
|
|
39
41
|
export declare function csvToTableHtml(text: string, delimiter?: string): string;
|
|
40
|
-
/**
|
|
42
|
+
/** Turns plain text into paragraphs: a blank line separates them, a single break becomes <br>. */
|
|
41
43
|
export declare function plainTextToHtml(text: string): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Entry point of @kodaeditor/core.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Exports the framework-independent core plus the web component registration.
|
|
5
|
+
* Importing this module defines <koda-editor> straight away, so the editor
|
|
6
|
+
* works out of the box in any framework and in plain HTML.
|
|
7
7
|
*/
|
|
8
8
|
export { Editor, type EditorOptions } from './editor';
|
|
9
9
|
export { importDocxToHtml, type DocxImportResult, DocxImportError, classifyDocxError, rawTextToHtml, type DocxImportErrorCode, } from './docx-import';
|