@kodaeditor/core 1.0.5 → 1.1.0

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/editor.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { EditorView } from 'prosemirror-view';
2
+ import { type TextCase } from './text-case';
2
3
  import { type ImportFormat } from './import-formats';
3
4
  import { type DocxImportResult } from './docx-import';
4
5
  import { type Strings } from './i18n';
6
+ import { type TextStats } from './word-count';
5
7
  export interface EditorOptions {
6
8
  /** Element the editor mounts into. */
7
9
  element: HTMLElement;
@@ -156,7 +158,10 @@ export declare class Editor {
156
158
  /** Exports the document's tables to CSV. Runs in the browser. */
157
159
  exportCsv(): Promise<void>;
158
160
  /** Exports to Word (.doc, Word-compatible HTML). Runs in the browser, no libraries. */
161
+ exportDocx(): Promise<void>;
162
+ exportXlsx(): Promise<void>;
159
163
  exportWord(): Promise<void>;
164
+ exportLegacyDoc(): Promise<void>;
160
165
  focus(): void;
161
166
  /** Current search state: total matches and the index of the active one, from 1. */
162
167
  searchInfo(): {
@@ -229,6 +234,7 @@ export declare class Editor {
229
234
  setHighlight(color: string): void;
230
235
  /** Clears all inline formatting in the selection, or the pending marks at the caret. */
231
236
  clearFormatting(): void;
237
+ changeCase(mode: TextCase, locale?: string): void;
232
238
  /** Sets or replaces a link on the selection; with no selection the URL is inserted as text. */
233
239
  setLink(href: string): void;
234
240
  /** Removes the link from the selection. */
@@ -239,6 +245,14 @@ export declare class Editor {
239
245
  currentBlock(): string;
240
246
  /** Alignment of the current paragraphs or headings. */
241
247
  setAlign(align: string): void;
248
+ changeIndent(delta: number): void;
249
+ setLineHeight(value: string): void;
250
+ currentLineHeight(): string;
251
+ toggleTextDirection(): void;
252
+ currentTextDirection(): string;
253
+ getStats(): TextStats;
254
+ toggleTaskList(): void;
255
+ isTaskListActive(): boolean;
242
256
  /** Whether that alignment is active, for highlighting toolbar buttons. */
243
257
  isAlignActive(align: string): boolean;
244
258
  /** Inserts an image by src: a URL, a path or a data URI. */
package/dist/i18n.d.ts CHANGED
@@ -52,6 +52,7 @@ export interface Strings {
52
52
  exportHtml: string;
53
53
  exportText: string;
54
54
  exportCsv: string;
55
+ exportXlsx: string;
55
56
  insertTable: string;
56
57
  tableRows: string;
57
58
  tableCols: string;
@@ -72,6 +73,9 @@ export interface Strings {
72
73
  textColor: string;
73
74
  highlight: string;
74
75
  clearFormat: string;
76
+ caseUpper: string;
77
+ caseLower: string;
78
+ caseTitle: string;
75
79
  superscript: string;
76
80
  subscript: string;
77
81
  horizontalRule: string;
@@ -193,6 +197,23 @@ export interface Strings {
193
197
  a11yTableNoHeader: string;
194
198
  spellcheck: string;
195
199
  pagination: string;
200
+ pdfHowTitle: string;
201
+ pdfAsText: string;
202
+ pdfEmbed: string;
203
+ crop: string;
204
+ importEmptyFile: string;
205
+ importExcelEmpty: string;
206
+ importDocOld: string;
207
+ alignJustify: string;
208
+ h5: string;
209
+ h6: string;
210
+ indentIncrease: string;
211
+ indentDecrease: string;
212
+ lineHeight: string;
213
+ textDirection: string;
214
+ statsWords: string;
215
+ statsChars: string;
216
+ taskList: string;
196
217
  }
197
218
  /**
198
219
  * Normalises an arbitrary locale string to a supported one.
@@ -203,4 +224,8 @@ export interface Strings {
203
224
  * rather than refusing to start.
204
225
  */
205
226
  export declare function resolveLocale(input?: string | null): Locale;
227
+ export declare function detectLocale(el: Element | null, opts?: {
228
+ navigatorLanguage?: string;
229
+ }): Locale;
230
+ export declare function isRtlLocale(locale: Locale): boolean;
206
231
  export declare function getStrings(locale: Locale): Strings;