@ones-editor/editor 0.0.5-beta.3 → 0.0.6-beta.10

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.
@@ -68,10 +68,6 @@ import 'prismjs/components/prism-visual-basic';
68
68
  import 'prismjs/components/prism-wasm';
69
69
  import 'prismjs/components/prism-yaml';
70
70
  declare const SUPPORTED_LANGUAGES: {
71
- plain: {
72
- name: string;
73
- aliases: string[];
74
- };
75
71
  abap: {
76
72
  name: string;
77
73
  aliases: string[];
@@ -172,6 +168,10 @@ declare const SUPPORTED_LANGUAGES: {
172
168
  name: string;
173
169
  aliases: string[];
174
170
  };
171
+ markup: {
172
+ name: string;
173
+ aliases: string[];
174
+ };
175
175
  java: {
176
176
  name: string;
177
177
  aliases: string[];
@@ -220,10 +220,6 @@ declare const SUPPORTED_LANGUAGES: {
220
220
  name: string;
221
221
  aliases: string[];
222
222
  };
223
- markup: {
224
- name: string;
225
- aliases: string[];
226
- };
227
223
  matlab: {
228
224
  name: string;
229
225
  aliases: string[];
@@ -256,6 +252,10 @@ declare const SUPPORTED_LANGUAGES: {
256
252
  name: string;
257
253
  aliases: string[];
258
254
  };
255
+ plain: {
256
+ name: string;
257
+ aliases: string[];
258
+ };
259
259
  powershell: {
260
260
  name: string;
261
261
  aliases: string[];
@@ -1,3 +1,4 @@
1
+ import ResizeObserver from 'resize-observer-polyfill';
1
2
  import { OnesEditor, ContainerElement, BlockElement } from '../types';
2
3
  export declare class RootContainer {
3
4
  private editor;
@@ -1,3 +1,4 @@
1
+ export type LANGS = keyof typeof langs;
1
2
  declare const langs: {
2
3
  'en-US': {
3
4
  name: string;
@@ -57,8 +58,8 @@ declare const langs: {
57
58
  };
58
59
  };
59
60
  };
60
- export declare function setLang(lang?: string | null | undefined): void;
61
+ export declare function setLang(lang?: LANGS | null | undefined): void;
61
62
  export declare function mergeLang(l: any): void;
62
63
  export declare function t(key: string, args?: Record<string, string>): string;
63
- export type LANGS = keyof typeof langs;
64
+ export declare function getCurrentLang(): "en-US" | "zh-CN" | "ja-JP";
64
65
  export {};
@@ -12,5 +12,6 @@ export default class DropIndicator {
12
12
  show(block: BlockElement, insertPos: DropInsertPos): void;
13
13
  hide(): void;
14
14
  private getIndicatorRect;
15
+ getViewRect(block: BlockElement): DOMRect;
15
16
  }
16
17
  export {};
@@ -0,0 +1,2 @@
1
+ import GraphIcon from './graph-icon.svg?raw';
2
+ export { GraphIcon, };
@@ -3,6 +3,7 @@ export declare class HeadingBlockCollapseButton implements OnesEditorCustom {
3
3
  private editor;
4
4
  constructor(editor: OnesEditor);
5
5
  handleLoad: () => void;
6
+ handleReadonlyChanged: () => void;
6
7
  handleHoverBlock: (hoveringBlock: BlockElement | null, oldHoveringBlock: BlockElement | null) => void;
7
8
  handleClick: (editor: OnesEditor, event: MouseEvent) => void;
8
9
  showCollapseButtons(): void;
@@ -14,7 +14,7 @@ export interface ImageEmbedData extends DocEmbedData {
14
14
  }
15
15
  export interface ImageItemData {
16
16
  src: string;
17
- width: number;
17
+ width: number | 'auto';
18
18
  height: number | 'auto';
19
19
  flex: number;
20
20
  virtualSize: boolean;
@@ -4,6 +4,7 @@ import { EnforceWithDocumentTitleHandlerOptions } from './types';
4
4
  declare class EnforceWithDocumentTitleHandler implements OnesEditorInputHandler {
5
5
  private options;
6
6
  constructor(editor: OnesEditor, options?: EnforceWithDocumentTitleHandlerOptions);
7
+ private reload;
7
8
  destroy(editor: OnesEditor): void;
8
9
  handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
9
10
  handleChanged(editor: OnesEditor): void;
@@ -1,3 +1,19 @@
1
+ /// <reference types="lodash" />
2
+ import { AbstractCommandBar, Popup } from '../../../../@ones-editor/ui-base';
1
3
  import { OnesEditor } from '../../../../@ones-editor/core';
2
4
  export type OnEditChange = (tex: string, end: boolean) => void;
5
+ export default class MathjaxEditor {
6
+ editMathjaxPopup: Popup | null;
7
+ onChange: OnEditChange | null;
8
+ tex: string;
9
+ private observer;
10
+ editMathjax(elem: HTMLElement, tex: string, onChange: OnEditChange): void;
11
+ handleClose: (commandBar: AbstractCommandBar) => void;
12
+ handleKeyup: (event: KeyboardEvent) => void;
13
+ handleChange: import("lodash").DebouncedFunc<(text: string) => void>;
14
+ createPopupContent(tex: string): HTMLTextAreaElement;
15
+ textareaWatcher(textarea: HTMLTextAreaElement): void;
16
+ getTextarea(): HTMLTextAreaElement;
17
+ destroy(): void;
18
+ }
3
19
  export declare function editMathjax(editor: OnesEditor, elem: HTMLElement, tex: string, onChange: OnEditChange): void;
@@ -7,6 +7,7 @@ import './sharedb-ext';
7
7
  export declare class AuthConnection {
8
8
  url: string;
9
9
  private reauthFunc?;
10
+ enabled: boolean;
10
11
  connection?: Connection;
11
12
  ws?: ReconnectingWebSocket;
12
13
  retryCount: number;
@@ -5,4 +5,3 @@ export declare function updateBarsDangerStatus(editor: OnesEditor, tableBlock: B
5
5
  export declare function updateCellsDangerStatus(editor: OnesEditor, tableBlock: BlockElement, isDanger?: boolean, isCol?: boolean): void;
6
6
  export declare function updateCellBarsDangerStatus(editor: OnesEditor, tableBlock: BlockElement, isDanger?: boolean, isCol?: boolean): void;
7
7
  export declare function createEntireRowAndColumnRange(editor: OnesEditor, tableBlock: BlockElement, isCol: boolean): import("@ones-editor/core").EditorSimpleSelectionRange | import("@ones-editor/core").EditorComplexSelectionRange;
8
- export declare function getHandlerContainers(editor: OnesEditor, block: BlockElement): import("@ones-editor/core").ContainerElement[];
@@ -3,7 +3,7 @@ export interface DocTableBlockData extends DocBlock {
3
3
  rows: number;
4
4
  cols: number;
5
5
  children: string[];
6
- colsWidth: number[];
6
+ colsWidth?: number[];
7
7
  showChart?: boolean;
8
8
  noBorder?: boolean;
9
9
  hasRowTitle?: boolean;
@@ -14,3 +14,4 @@ export declare function reCalculateImageDims(dims: (ImageDimWithBuffer | undefin
14
14
  height: number;
15
15
  buffer: ArrayBuffer;
16
16
  }[];
17
+ export declare function calcImagesSize(dims: (ImageDimWithBuffer | undefined)[], maxWidth: number, data?: unknown): void;