@ones-editor/editor 2.0.8-beta.1 → 10.0.8-beta.1

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.
@@ -244,7 +244,7 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
244
244
  recognizeLink?: (link: string) => Promise<RecognizeLinkResult>;
245
245
  beginBatchUpdate: () => number;
246
246
  endBatchUpdate: () => number;
247
- triggerReAuth?: () => void;
247
+ triggerReAuth?: (auto?: boolean) => void;
248
248
  }
249
249
  export interface OnesEditorDocHistoryData {
250
250
  user: {
@@ -42,7 +42,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
42
42
  broadcastMessage(data: unknown): void;
43
43
  getUser(): import("../doc").OnesEditorUser;
44
44
  getRemoteUsers(): import("../doc").OnesEditorRemoteUsers;
45
- triggerReAuth(): void | undefined;
45
+ triggerReAuth(auto?: boolean): void;
46
46
  destroy(): void;
47
47
  getServerMeta(): OnesEditorDocServerMeta;
48
48
  reset(doc: OnesEditorDoc): void;
@@ -16,6 +16,8 @@ declare class UndoManager implements OnesEditorUndoManager, EditorDocLocalAction
16
16
  private endGroup;
17
17
  hasGroup(): boolean;
18
18
  runInGroup<T>(action: () => T): T;
19
+ private verifyPos;
20
+ private checkRange;
19
21
  undo(): boolean;
20
22
  redo(): boolean;
21
23
  canUndo(): boolean;
@@ -1,8 +1,10 @@
1
+ type ClipboardItemData = {
2
+ type: string;
3
+ data: string | Blob;
4
+ };
1
5
  export declare function setClipboardDataByEvent(items: {
2
6
  type: string;
3
7
  data: string;
4
8
  }[], event: ClipboardEvent): Promise<boolean>;
5
- export declare function setClipboardData(items: {
6
- type: string;
7
- data: string | Blob;
8
- }[]): Promise<boolean>;
9
+ export declare function setClipboardData(items: ClipboardItemData[]): Promise<boolean>;
10
+ export {};
@@ -1,14 +1,19 @@
1
1
  import { TypedEmitter } from 'tiny-typed-emitter';
2
- import type { OnesEditor, OnesEditorCustom, OnesEditorDocCallbacks } from '../../../../@ones-editor/core';
2
+ import { OnesEditor, OnesEditorCustom, OnesEditorDocCallbacks } from '../../../../@ones-editor/core';
3
3
  import ReAuthToolbar from './ui/toolbar';
4
4
  import './locale';
5
5
  type EventCallback = (() => void) | undefined;
6
6
  declare const DOC_RE_AUTH_KEYS = "doc-re-auth-event";
7
- declare class DocReAuthCallbacks extends TypedEmitter implements OnesEditorCustom, OnesEditorDocCallbacks {
7
+ type ReAuthEvent = {
8
+ tokenExpired: () => void;
9
+ };
10
+ declare class DocReAuthCallbacks extends TypedEmitter<ReAuthEvent> implements OnesEditorCustom, OnesEditorDocCallbacks {
8
11
  private editor;
9
12
  private authErrorCallback;
10
13
  private authRecoverCallback;
14
+ reAuthToolbar: ReAuthToolbar;
11
15
  constructor(editor: OnesEditor);
16
+ handleReAuth: () => void;
12
17
  addAuthListen(event: 'authError' | 'authRecover', callback: EventCallback): void;
13
18
  removeListeners(): void;
14
19
  destroy: () => void;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  authError: {
3
3
  tips: string;
4
+ successTips: string;
4
5
  };
5
6
  };
6
7
  export default _default;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  authError: {
3
3
  tips: string;
4
+ successTips: string;
4
5
  };
5
6
  };
6
7
  export default _default;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  authError: {
3
3
  tips: string;
4
+ successTips: string;
4
5
  };
5
6
  };
6
7
  export default _default;
@@ -4,7 +4,9 @@ export default class ReAuthToolbar {
4
4
  private editor;
5
5
  private isShown;
6
6
  private currentBlock;
7
+ private fixedToolbar;
7
8
  constructor(editor: OnesEditor);
8
9
  render(block: BlockElement, onExit?: () => void): void;
10
+ succeedRender: () => void;
9
11
  destroy(): void;
10
12
  }
@@ -28,6 +28,8 @@ export declare class AuthConnection {
28
28
  logout(): Promise<void>;
29
29
  init(auth: AuthMessage): Promise<void>;
30
30
  reConnect(token: string): Promise<void>;
31
+ _autoReAuth(): Promise<void>;
32
+ autoReAuth(): Promise<void>;
31
33
  handleAuthError(): Promise<void>;
32
34
  reAuth: () => Promise<void>;
33
35
  private emitPermissionError;
@@ -54,5 +54,5 @@ export default class ShareDBClient {
54
54
  recognizeLink(url: string): Promise<LinkDetails>;
55
55
  private getResourceId;
56
56
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
57
- reAuth(): void;
57
+ reAuth(auto?: boolean): void;
58
58
  }
@@ -107,5 +107,5 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
107
107
  recognizeLink(url: string): Promise<import("../types").LinkDetails>;
108
108
  parseHistoryData(historyData: OnesEditorDocHistoryData, handler: OnesEditorHistoryDataParseHandler): void;
109
109
  getServerMeta(): OnesEditorDocServerMeta;
110
- triggerReAuth(): void;
110
+ triggerReAuth(auto?: boolean): void;
111
111
  }