@ones-editor/editor 2.1.8 → 2.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.8",
3
+ "version": "2.1.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,16 +0,0 @@
1
- import { DocObject, OnesEditor, OnesEditorComment, OnesEditorDocRange, SelectionRange } from '../../../../@ones-editor/core';
2
- export interface AddCommentToOldVersionBody {
3
- avatarUrl: string;
4
- containerId: string;
5
- rangeType: 'simple' | 'complex';
6
- range: OnesEditorDocRange;
7
- selectedContainers: string[];
8
- commentId?: string;
9
- commentGroupId?: string;
10
- comment: DocObject;
11
- abstract?: string;
12
- }
13
- export declare function addCommentToOldVersion(editor: OnesEditor, version: number, range: SelectionRange, comment: OnesEditorComment, commentDoc: DocObject): Promise<void>;
14
- export declare function replyCommentToOldVersion(editor: OnesEditor, version: number, comment: OnesEditorComment, commentDoc: DocObject): Promise<unknown>;
15
- export declare function updateCommentToOldDoc(editor: OnesEditor, version: number, commentId: string, commentDoc: DocObject): Promise<unknown>;
16
- export declare function deleteCommentFromOldDoc(editor: OnesEditor, version: number, commentId: string): Promise<unknown>;
@@ -1,24 +0,0 @@
1
- import { AxiosResponse } from 'axios';
2
- import { BuildResourceUrlOptions } from '../../../../@ones-editor/core';
3
- import { OnProgress } from '../types';
4
- export default abstract class ShareDBClientBase {
5
- abstract apiServer(): string;
6
- abstract request<T = unknown>(url: string, opt?: any): Promise<AxiosResponse<any, T>>;
7
- abstract token(): string;
8
- abstract resourceToken(): string;
9
- abstract docId(): string;
10
- getFileUrlByHash(uploadFileUrl: string, hash: string, name: string, size: number, headers: {
11
- [index: string]: string;
12
- }): Promise<any>;
13
- getFileUrlsByHashes(resourceHashes: string[]): Promise<any[]>;
14
- uploadFile(url: string, file: File, headers: {
15
- [index: string]: string;
16
- }, onProgress: OnProgress, options?: {
17
- thumbnail?: boolean;
18
- }): Promise<string>;
19
- uploadResource(file: File, onProgress?: OnProgress, options?: {
20
- thumbnail?: boolean;
21
- }): Promise<string>;
22
- getResourceId(url: string): string;
23
- buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
24
- }
@@ -1,17 +0,0 @@
1
- import { DocObject, LocalDoc, OnesEditorUser, UploadResourceOptions, UploadResourceResult } from '../../../../@ones-editor/core';
2
- export interface ShareDBLocalDocOptions {
3
- serverUrl: string;
4
- token: string;
5
- resourceToken?: string;
6
- user: OnesEditorUser;
7
- docId: string;
8
- }
9
- export default class ShareDBLocalDoc extends LocalDoc {
10
- private _options;
11
- private _client;
12
- constructor(docObject: DocObject, _options: ShareDBLocalDocOptions);
13
- buildResourceUrl(src: string): string;
14
- getUser(): OnesEditorUser;
15
- request<T>(url: string, opt?: any): Promise<T>;
16
- uploadResource(file: File, options?: UploadResourceOptions | undefined): Promise<UploadResourceResult>;
17
- }
@@ -1,23 +0,0 @@
1
- import { BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
2
- import { ReadonlyCommandOptions, ReadonlyToolbarCommandProvider } from './types';
3
- export declare class AddCommentToOldDocCommandProvider implements ReadonlyToolbarCommandProvider, OnesEditorBlockHook {
4
- private editor;
5
- private version;
6
- private localCreatedComments;
7
- constructor(editor: OnesEditor, version: number);
8
- onCreateComment(commentId: string, local: boolean): Promise<void>;
9
- onDeleteComment(commentId: string, local: boolean): Promise<void>;
10
- onUpdateComment(commentId: string, local: boolean): Promise<void>;
11
- hideToolbar(editor: OnesEditor): void;
12
- commands(editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null): {
13
- group: string;
14
- commands: {
15
- id: string;
16
- name: string;
17
- icon: string;
18
- }[];
19
- executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
20
- } | undefined;
21
- getTextCommands(editor: OnesEditor, range: SelectionRange): CommandItem[];
22
- executeCommand(editor: OnesEditor, command: CommandItem, options: ReadonlyCommandOptions): void;
23
- }
@@ -1,30 +0,0 @@
1
- /// <reference types="lodash" />
2
- import { BlockElement, CommandItem, OnesEditor, OnesEditorCustom, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
3
- import { AbstractCommandBar, ManualToolbar } from '../../../../@ones-editor/ui-base';
4
- import type { ReadonlyToolbarCommandProvider } from './types';
5
- export declare class ReadonlyToolbar implements OnesEditorCustom {
6
- private editor;
7
- toolbar: ManualToolbar;
8
- toolbarType: 'text' | 'object';
9
- mouseDown: boolean;
10
- hoveringBlock: BlockElement | null;
11
- hoveringTextChild: TextBlockContentChild | null;
12
- oldRange: SelectionRange | null;
13
- providers: ReadonlyToolbarCommandProvider[];
14
- constructor(editor: OnesEditor);
15
- destroy(): void;
16
- addProvider(provider: ReadonlyToolbarCommandProvider): void;
17
- isInBlock(block: BlockElement, event: MouseEvent): boolean;
18
- handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
19
- handleClose: () => void;
20
- handleClosing: (bar: unknown, event: MouseEvent) => boolean;
21
- bindEvents(): void;
22
- unbindEvents(): void;
23
- handleDocumentMouseDown: (event: MouseEvent) => void;
24
- handleDocumentMouseUp: () => void;
25
- handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
26
- private handleHoveringBlockChildChange;
27
- groupCommands: (allCommands: CommandItem[]) => CommandItem[];
28
- showTextToolbar(reason: string): void;
29
- showObjectToolbar(event: MouseEvent | null): void;
30
- }
@@ -1,12 +0,0 @@
1
- import { BlockElement, CommandItem, OnesEditor, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
2
- import { CommandBar } from '../../../../@ones-editor/ui-base';
3
- export interface ReadonlyCommandOptions {
4
- hoveringBlock: BlockElement | null;
5
- hoveringTextChild: TextBlockContentChild | null;
6
- bar: CommandBar;
7
- }
8
- export interface ReadonlyToolbarCommandProvider {
9
- getTextCommands?: (editor: OnesEditor, range: SelectionRange) => CommandItem[];
10
- destroy?: () => void;
11
- executeCommand: (editor: OnesEditor, command: CommandItem, options: ReadonlyCommandOptions) => void;
12
- }
@@ -1,7 +0,0 @@
1
- import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, TextBlockContentChild } from '../../../../@ones-editor/core';
2
- export declare class LinkCommands implements OnesEditorBlockHook {
3
- private editor;
4
- constructor(editor: OnesEditor);
5
- commands(editor: OnesEditor, block: BlockElement, child: TextBlockContentChild | null): BlockCommands | undefined;
6
- executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
7
- }