@kodaeditor/core 1.0.1 → 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 +71 -213
- package/package.json +2 -5
- 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/license.d.ts
CHANGED
|
@@ -1,90 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* License states.
|
|
3
3
|
*
|
|
4
|
-
* 'invalid'
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
69
|
-
*
|
|
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
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
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
|
-
*
|
|
84
|
-
* Crypto API
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
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
|
-
*
|
|
2
|
+
* The KodaEditor document schema.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
-
*
|
|
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>>;
|
package/dist/serialize.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Serialising and parsing the document.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
-
/**
|
|
9
|
+
/** Turns a ProseMirror document into a clean HTML string. */
|
|
11
10
|
export declare function docToHTML(doc: PMNode): string;
|
|
12
11
|
/**
|
|
13
|
-
* HTML
|
|
12
|
+
* Turns an HTML string into a ProseMirror document, following the editor
|
|
13
|
+
* schema.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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;
|