@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.
Files changed (49) hide show
  1. package/dist/docx-import.d.ts +11 -11
  2. package/dist/editor.d.ts +109 -159
  3. package/dist/fallback.d.ts +7 -8
  4. package/dist/i18n.d.ts +15 -26
  5. package/dist/import-formats.d.ts +19 -17
  6. package/dist/index.d.ts +4 -4
  7. package/dist/kodaeditor-core.umd.cjs +1 -1
  8. package/dist/kodaeditor.js +1 -1
  9. package/dist/kodaeditor.umd.cjs +1 -1
  10. package/dist/license.d.ts +46 -50
  11. package/dist/schema.d.ts +7 -7
  12. package/dist/serialize.d.ts +11 -11
  13. package/dist/web-component.d.ts +80 -189
  14. package/package.json +4 -6
  15. package/dist/commands.d.ts +0 -15
  16. package/dist/docx-alignment.d.ts +0 -14
  17. package/dist/docx-breaks.d.ts +0 -31
  18. package/dist/docx-forms.d.ts +0 -28
  19. package/dist/docx-headers.d.ts +0 -22
  20. package/dist/docx-images.d.ts +0 -41
  21. package/dist/docx-math.d.ts +0 -18
  22. package/dist/docx-styles.d.ts +0 -53
  23. package/dist/docx-symbols.d.ts +0 -19
  24. package/dist/docx-text-styles.d.ts +0 -27
  25. package/dist/floatingToolbar.d.ts +0 -7
  26. package/dist/group-icons.d.ts +0 -17
  27. package/dist/icons.d.ts +0 -1
  28. package/dist/image-view.d.ts +0 -27
  29. package/dist/markdown.d.ts +0 -4
  30. package/dist/menubar.d.ts +0 -60
  31. package/dist/offline-license.d.ts +0 -36
  32. package/dist/pagination.d.ts +0 -11
  33. package/dist/paste.d.ts +0 -54
  34. package/dist/pdf-import-cdn.d.ts +0 -2
  35. package/dist/pdf-import.d.ts +0 -8
  36. package/dist/print.d.ts +0 -18
  37. package/dist/rtf-images.d.ts +0 -24
  38. package/dist/search.d.ts +0 -17
  39. package/dist/slashMenu.d.ts +0 -8
  40. package/dist/styles.d.ts +0 -8
  41. package/dist/table-split.d.ts +0 -26
  42. package/dist/table-view.d.ts +0 -34
  43. package/dist/tableColumnTrade.d.ts +0 -15
  44. package/dist/tableToolbar.d.ts +0 -14
  45. package/dist/toc-view.d.ts +0 -23
  46. package/dist/toolbar-editor.d.ts +0 -89
  47. package/dist/validate-signature.d.ts +0 -64
  48. package/dist/xlsx-import-cdn.d.ts +0 -1
  49. package/dist/xlsx-import.d.ts +0 -2
package/dist/i18n.d.ts CHANGED
@@ -1,21 +1,15 @@
1
1
  /**
2
- * Локализация интерфейса KodaEditor.
2
+ * Interface localisation for KodaEditor.
3
3
  *
4
- * Поддержка: английский (по умолчанию - глобальный рынок) и русский.
5
- * Локаль задаётся атрибутом locale на <koda-editor> ("en" | "ru") или
6
- * наследуется из lang. Переводятся только строки UI (подсказки кнопок,
7
- * ARIA-метки, водяной знак) - содержимое документа не трогается.
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
- * До 01.09.2026 английской локали не было вообще, а resolveLocale() без
10
- * явного locale-атрибута откатывалась на 'ru' - для нового глобального
11
- * бренда это было реальной проблемой (не косметика: любой англоязычный
12
- * покупатель без явного locale получал русский тулбар). Добавлен 'en',
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
- * Узбекский (uz-latn/uz-cyrl) убран из публичного пакета 01.09.2026 -
207
- * был сделан под конкретного локального заказчика (meplab), тот больше
208
- * не действует; полная версия с узбекским сохранена в git-ветке
209
- * archive/meplab-uzbek-locale, не удалена безвозвратно. Старое значение
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;
@@ -1,23 +1,25 @@
1
1
  /**
2
- * Импорт «лёгких» форматов БЕЗ зависимостей и БЕЗ сервера (client-side):
3
- * - CSV/TSV -> HTML-таблица (первая строка = шапка)
4
- * - txt -> абзацы
5
- * Тяжёлые форматы (pdf, xlsx) и markdown подключаются отдельными модулями.
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
- * Единая точка детекта формата по имени/MIME — detectImportFormat(). Сами
8
- * функции принимают строку и возвращают HTML; вставку делает Editor.importFile.
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
- /** Определяет формат файла по имени и MIME-типу. */
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
- * Разбирает CSV (RFC-4180-подобно): кавычки экранируют разделитель и перевод
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
- /** Матрица значений -> HTML-таблица (первая строка = заголовок th). */
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
- /** Диапазон слияния ячеек (0-based, инклюзивно), формат SheetJS `!merges`. */
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
- * Матрица значений + список слияний -> HTML-таблица с colspan/rowspan.
33
- * Схема (prosemirror-tables) уже умеет парсить colspan/rowspan из HTML —
34
- * тот же путь, которым уже работают слитые ячейки docx-таблиц, — не хватало
35
- * только генерации этих атрибутов на стороне xlsx-импорта (см. xlsx-import.ts).
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/TSV -> HTML-таблица (первая строка = заголовок). */
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
- /** Простой текст -> абзацы (пустая строка разделяет абзацы, перенос -> <br>). */
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
- * Точка входа @kodaeditor/core.
2
+ * Entry point of @kodaeditor/core.
3
3
  *
4
- * Экспортирует фреймворк-независимое ядро + регистрацию Web Component.
5
- * При импорте сразу определяет <koda-editor>, чтобы работало «из коробки»
6
- * в любом фреймворке и vanilla.
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';