@kodaeditor/core 1.0.1 → 1.0.3

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 (50) hide show
  1. package/THIRD-PARTY-LICENSES.txt +83 -83
  2. package/dist/docx-import.d.ts +11 -11
  3. package/dist/editor.d.ts +109 -159
  4. package/dist/fallback.d.ts +7 -8
  5. package/dist/i18n.d.ts +15 -26
  6. package/dist/import-formats.d.ts +19 -17
  7. package/dist/index.d.ts +4 -4
  8. package/dist/kodaeditor-core.umd.cjs +1 -1
  9. package/dist/kodaeditor.js +1 -1
  10. package/dist/kodaeditor.umd.cjs +1 -1
  11. package/dist/license.d.ts +46 -50
  12. package/dist/schema.d.ts +7 -7
  13. package/dist/serialize.d.ts +11 -11
  14. package/dist/web-component.d.ts +71 -213
  15. package/package.json +2 -5
  16. package/dist/commands.d.ts +0 -15
  17. package/dist/docx-alignment.d.ts +0 -14
  18. package/dist/docx-breaks.d.ts +0 -31
  19. package/dist/docx-forms.d.ts +0 -28
  20. package/dist/docx-headers.d.ts +0 -22
  21. package/dist/docx-images.d.ts +0 -41
  22. package/dist/docx-math.d.ts +0 -18
  23. package/dist/docx-styles.d.ts +0 -53
  24. package/dist/docx-symbols.d.ts +0 -19
  25. package/dist/docx-text-styles.d.ts +0 -27
  26. package/dist/floatingToolbar.d.ts +0 -7
  27. package/dist/group-icons.d.ts +0 -17
  28. package/dist/icons.d.ts +0 -1
  29. package/dist/image-view.d.ts +0 -27
  30. package/dist/markdown.d.ts +0 -4
  31. package/dist/menubar.d.ts +0 -60
  32. package/dist/offline-license.d.ts +0 -36
  33. package/dist/pagination.d.ts +0 -11
  34. package/dist/paste.d.ts +0 -54
  35. package/dist/pdf-import-cdn.d.ts +0 -2
  36. package/dist/pdf-import.d.ts +0 -8
  37. package/dist/print.d.ts +0 -18
  38. package/dist/rtf-images.d.ts +0 -24
  39. package/dist/search.d.ts +0 -17
  40. package/dist/slashMenu.d.ts +0 -8
  41. package/dist/styles.d.ts +0 -8
  42. package/dist/table-split.d.ts +0 -26
  43. package/dist/table-view.d.ts +0 -34
  44. package/dist/tableColumnTrade.d.ts +0 -15
  45. package/dist/tableToolbar.d.ts +0 -14
  46. package/dist/toc-view.d.ts +0 -23
  47. package/dist/toolbar-editor.d.ts +0 -89
  48. package/dist/validate-signature.d.ts +0 -64
  49. package/dist/xlsx-import-cdn.d.ts +0 -1
  50. package/dist/xlsx-import.d.ts +0 -2
package/dist/license.d.ts CHANGED
@@ -1,90 +1,86 @@
1
1
  /**
2
- * Состояния лицензии.
2
+ * License states.
3
3
  *
4
- * 'invalid' и 'unreachable' РАЗНЫЕ, и различие не косметическое: первое
5
- * означает «сервер сказал нет», второе - «мы не смогли спросить». Наказывать
6
- * покупателя за нашу недоступность нельзя, поэтому пометка в выгрузках
7
- * ставится только при 'invalid' и 'unconfigured' (см. web-component).
4
+ * 'invalid' and 'unreachable' are deliberately different: the first means the
5
+ * validation service said no, the second that it could not be asked. You are
6
+ * never marked because our service is down, so the evaluation marks appear
7
+ * only for 'invalid' and 'unconfigured'.
8
8
  */
9
9
  export type LicenseStatus = 'valid' | 'grace' | 'invalid' | 'unreachable' | 'unconfigured';
10
10
  export interface LicenseResult {
11
11
  status: LicenseStatus;
12
12
  /**
13
- * Список из ответа сервера. НИЧЕГО НЕ ОГРАНИЧИВАЕТ: ключ открывает все
14
- * возможности редактора, деления на тарифы нет, и ни одна функция не
15
- * сверяется с этим списком - проверено по всему ядру 12.09.2026.
13
+ * A list returned by the validation service. It RESTRICTS NOTHING: a
14
+ * license unlocks the whole editor, there are no tiers, and no feature
15
+ * checks itself against this list.
16
16
  *
17
- * Поле осталось от замысла продавать возможности по отдельности и сейчас
18
- * служит только одному: оно входит в подписываемую строку ответа, поэтому
19
- * убрать его нельзя, не меняя протокол подписи на обеих сторонах.
20
- *
21
- * Комментарий здесь раньше обещал feature-gating. Это было неправдой и
22
- * вводило в заблуждение любого, кто читал ответ /validate и видел там два
23
- * названия вместо всех возможностей, за которые заплатил.
17
+ * The field is kept only because it is part of the signed response, so
18
+ * removing it would change the signature protocol on both sides. If you see
19
+ * two names here rather than every feature you paid for, nothing is being
20
+ * withheld.
24
21
  */
25
22
  plugins: string[];
26
- /** Показывать ли водяной знак. */
23
+ /** Whether to show the watermark. */
27
24
  watermark: boolean;
28
25
  message?: string;
29
26
  }
30
27
  export interface LicenseOptions {
31
- /** Лицензионный ключ клиента. */
28
+ /** Your license key. */
32
29
  key?: string;
33
30
  /**
34
- * URL license-сервера. По умолчанию - наш боевой адрес (DEFAULT_ENDPOINT),
35
- * задавать его клиенту НЕ нужно. Переопределяют только те, кто проксирует
36
- * проверку через собственный домен.
31
+ * URL of the validation service. Defaults to ours (DEFAULT_ENDPOINT), so
32
+ * you do not need to set it. Override it only if you proxy validation
33
+ * through your own domain.
37
34
  */
38
35
  endpoint?: string;
39
- /** Сколько дней жить по кэшу при недоступной сети. */
36
+ /** How many days to keep working from cache while the network is unreachable. */
40
37
  graceDays?: number;
41
38
  }
42
39
  /**
43
- * Адрес проверки лицензий по умолчанию.
40
+ * Default address of the validation service.
44
41
  *
45
- * Зашит намеренно: раньше адрес был обязательным атрибутом, и во всех наших
46
- * же сниппетах стоял плейсхолдер вида https://your-domain.com/validate, то
47
- * есть домен ПОКУПАТЕЛЯ, где такого эндпоинта нет. Клиент подключал по
48
- * документации и получал водяной знак на проде. Адрес наш и меняться не
49
- * должен: он остаётся в коде у всех выданных лицензий бессрочно.
42
+ * Built in on purpose, so that a working installation needs no endpoint
43
+ * configuration at all. The address is ours and does not change: it stays in
44
+ * the code of every license issued.
50
45
  */
51
46
  export declare const DEFAULT_ENDPOINT = "https://api.kodaeditor.com/validate";
52
47
  /**
53
- * Проверяет лицензию.
48
+ * Validates a license key.
54
49
  *
55
- * Порядок: свежий кэш (моложе суток) отвечает сразу и обновляется в фоне;
56
- * иначе идём на сервер; если сервер недоступен - живём по кэшу в пределах
57
- * grace-периода; иначе деградация (водяной знак, редактор продолжает работать).
50
+ * Order of play: a fresh cache (less than a day old) answers at once and is
51
+ * refreshed in the background; otherwise the service is asked; if it cannot
52
+ * be reached, the cache keeps the installation clean for the grace period;
53
+ * only after that does the editor fall back to trial mode. It keeps working
54
+ * either way - nothing is switched off.
58
55
  *
59
- * Сознательно НЕ делаем поблажку «первая установка при недоступном сервере»:
60
- * ключ на этом этапе ещё ни разу не подтверждён, и любое такое окно означало
61
- * бы, что произвольная строка в атрибуте license плюс закрытый доступ к нашему
62
- * домену дают чистый редактор. Доступность сервера - наша задача, а не повод
63
- * ослабить проверку.
56
+ * There is deliberately no exception for a first install while the service is
57
+ * unreachable: at that point the key has never been confirmed, and such a
58
+ * window would mean any string in the license attribute plus a blocked domain
59
+ * yields an unmarked editor.
64
60
  */
65
61
  export declare function validateLicense(opts: LicenseOptions): Promise<LicenseResult>;
66
62
  export interface OfflineLicenseOptions {
67
63
  /**
68
- * URL подписанного файла лицензии (обычно свой же домен: /license.json).
69
- * Взаимоисключимо с fileContent - если задан fileContent, fileUrl
70
- * игнорируется.
64
+ * URL of the signed license file, usually on your own domain
65
+ * (/license.json). Mutually exclusive with fileContent: if fileContent is
66
+ * given, fileUrl is ignored.
71
67
  */
72
68
  fileUrl?: string;
73
69
  /**
74
- * Содержимое файла лицензии ИНЛАЙНОМ, без fetch. Обязательно для
75
- * страниц, открытых напрямую file:// (там fetch() к соседнему файлу не
76
- * работает вовсе - браузерное ограничение, не наше) - сценарий агента
77
- * в поле без интернета и без локального веб-сервера: HTML/JS/подпись
78
- * поставляются одним пакетом, ничего не грузится по сети.
70
+ * The license file INLINE, with no fetch. Required for pages opened
71
+ * directly from disk over file://, where the browser refuses to fetch a
72
+ * neighbouring file at all. This is the case of a machine in the field with
73
+ * no internet and no local web server: HTML, JavaScript and the signed
74
+ * license ship together and nothing is loaded over the network.
79
75
  */
80
76
  fileContent?: string;
81
77
  }
82
78
  /**
83
- * Полностью офлайн-проверка: подпись файла проверяется локально (Web
84
- * Crypto API), без обращения к license-серверу. Содержимое либо
85
- * загружается (fileUrl - для same-origin/localhost развёртываний), либо
86
- * передаётся сразу (fileContent - для true-offline file:// страниц, где
87
- * fetch физически недоступен). Никогда не бросает - при любой проблеме
88
- * возвращает деградацию (водяной знак), как и онлайн-путь validateLicense().
79
+ * Fully offline validation: the file's signature is checked locally through
80
+ * the Web Crypto API, with no request to the validation service ever. The
81
+ * contents are either fetched (fileUrl, for same-origin deployments) or
82
+ * passed in directly (fileContent, for file:// pages where fetch is not
83
+ * available). Never throws: any problem falls back to trial mode, exactly as
84
+ * the online path does.
89
85
  */
90
86
  export declare function validateLicenseOffline(opts: OfflineLicenseOptions): Promise<LicenseResult>;
package/dist/schema.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Схема документа KodaEditor.
2
+ * The KodaEditor document schema.
3
3
  *
4
- * Документ хранится как структурированная модель ProseMirror, а не как
5
- * «сырой» HTML из contenteditable. Благодаря этому вывод всегда чистый —
6
- * никаких `<span style>` и пустых тегов, которыми грешит TinyMCE.
4
+ * The document is held as a structured ProseMirror model rather than as raw
5
+ * contenteditable HTML, which is why the output stays clean: no stray
6
+ * `<span style>` and no empty tags.
7
7
  *
8
- * За основу взята проверенная prosemirror-schema-basic, расширенная
9
- * списками и дополнительными марками (подчёркивание, зачёркивание),
10
- * которые корпоративные редакторы ожидают по умолчанию.
8
+ * It builds on prosemirror-schema-basic, extended with lists and the extra
9
+ * marks a business document is expected to have, such as underline and
10
+ * strikethrough.
11
11
  */
12
12
  import { Schema, type MarkSpec, type NodeSpec } from 'prosemirror-model';
13
13
  export declare const editorSchema: Schema<keyof import("orderedmap").default<NodeSpec>, keyof import("orderedmap").default<MarkSpec>>;
@@ -1,20 +1,20 @@
1
1
  /**
2
- * Сериализация и парсинг документа.
2
+ * Serialising and parsing the document.
3
3
  *
4
- * Выход — чистый HTML, построенный из модели документа через
5
- * официальный DOMSerializer ProseMirror. Вход — строгий парсинг входного
6
- * HTML обратно в модель, что попутно отбрасывает небезопасный/мусорный
7
- * разметочный шум (база для будущего paste-санитайзера).
4
+ * Output is clean HTML, built from the document model through ProseMirror's
5
+ * own DOMSerializer. Input is parsed strictly back into the model, which
6
+ * discards unsafe and junk markup along the way.
8
7
  */
9
8
  import { type Node as PMNode } from 'prosemirror-model';
10
- /** Документ ProseMirror -> чистая HTML-строка. */
9
+ /** Turns a ProseMirror document into a clean HTML string. */
11
10
  export declare function docToHTML(doc: PMNode): string;
12
11
  /**
13
- * HTML-строка -> документ ProseMirror (по схеме редактора).
12
+ * Turns an HTML string into a ProseMirror document, following the editor
13
+ * schema.
14
14
  *
15
- * Перед парсингом HTML прогоняется через DOMPurify: это отсекает
16
- * исполняемые векторы (`<script>`, `onerror=`, `<svg onload>` и т.п.),
17
- * которые иначе срабатывают при присваивании в innerHTML — даже несмотря
18
- * на то, что ProseMirror потом отбросит сами узлы. Защита от XSS на входе.
15
+ * The HTML is sanitised first: executable vectors such as `<script>`,
16
+ * `onerror=` and `<svg onload>` would otherwise fire the moment the markup is
17
+ * assigned to innerHTML, even though ProseMirror discards those nodes
18
+ * afterwards. This is the XSS barrier on input.
19
19
  */
20
20
  export declare function htmlToDoc(html: string): PMNode;