@ones-editor/editor 1.1.8 → 1.1.9-beta.3
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/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu/standard-block-actions/hook.d.ts +2 -0
- package/@ones-editor/code-block/src/code-block/header/index.d.ts +1 -0
- package/@ones-editor/code-block/src/code-block/languages.d.ts +1 -1
- package/@ones-editor/code-block/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/code-block/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/code-block/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/comments/src/comment-quick-reply/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +3 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-render/index.d.ts +1 -0
- package/@ones-editor/context-menu/src/menu/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
- package/@ones-editor/core/src/core/blocks/common/heading-block-dom.d.ts +7 -0
- package/@ones-editor/core/src/core/blocks/common/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/complex-blocks/child-blocks.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +3 -2
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +1 -1
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +2 -0
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/container.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/actions/update-block-text.d.ts +3 -3
- package/@ones-editor/core/src/core/editor/actions/update-box-data.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +5 -3
- package/@ones-editor/core/src/core/editor/index.d.ts +1 -0
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -1
- package/@ones-editor/core/src/core/selection/ensure-block-visible.d.ts +2 -0
- package/@ones-editor/core/src/core/types.d.ts +15 -5
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +2 -2
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +4 -0
- package/@ones-editor/core/src/utils/dom.d.ts +4 -0
- package/@ones-editor/core/src/utils/file.d.ts +2 -1
- package/@ones-editor/excalidraw/src/types.d.ts +2 -1
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/doc-event/collapse-handler.d.ts +4 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/collapse-heading-block.d.ts +2 -2
- package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-utils.d.ts +0 -4
- package/@ones-editor/heading-collapse/src/heading-collapse-button/index.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/paste-handler.d.ts +8 -0
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +2 -0
- package/@ones-editor/list-block/src/index.d.ts +2 -1
- package/@ones-editor/list-block/src/local-events/paste-handler.d.ts +6 -0
- package/@ones-editor/list-block/src/mindmap/to-mindmap/to-mindmap.d.ts +2 -2
- package/@ones-editor/list-block/src/mindmap/to-mindmap/types.d.ts +2 -2
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +2 -1
- package/@ones-editor/sharedb-doc/src/types.d.ts +1 -0
- package/@ones-editor/status/package.json +7 -0
- package/@ones-editor/status/src/dom/input.d.ts +1 -0
- package/@ones-editor/status/src/dom/overflow-tooltip-tag.d.ts +10 -0
- package/@ones-editor/status/src/dom/status-palette.d.ts +6 -0
- package/@ones-editor/status/src/index.d.ts +4 -0
- package/@ones-editor/status/src/locale/en-us.d.ts +25 -0
- package/@ones-editor/status/src/locale/index.d.ts +1 -0
- package/@ones-editor/status/src/locale/ja-jp.d.ts +25 -0
- package/@ones-editor/status/src/locale/zh-cn.d.ts +25 -0
- package/@ones-editor/status/src/status-box-command.d.ts +7 -0
- package/@ones-editor/status/src/status-box-data.d.ts +5 -0
- package/@ones-editor/status/src/status-box-editor.d.ts +21 -0
- package/@ones-editor/status/src/status-box.d.ts +4 -0
- package/@ones-editor/status/src/types.d.ts +8 -0
- package/@ones-editor/table-block/package.json +1 -0
- package/@ones-editor/table-block/src/index.d.ts +2 -2
- package/@ones-editor/table-block/src/table-block/index.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/table-dom.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/table-grid.d.ts +3 -0
- package/@ones-editor/table-block/src/types.d.ts +1 -0
- package/@ones-editor/templates/src/index.d.ts +2 -2
- package/@ones-editor/templates/src/templates/select-template.d.ts +4 -0
- package/@ones-editor/templates/src/templates/types.d.ts +1 -0
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -0
- package/@ones-editor/to-docx/src/doc2other/image.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/types.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -2
- package/@ones-editor/ui/src/link-popup/index.d.ts +4 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +2 -2
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +2 -2
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/types.d.ts +8 -3
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
- package/@ones-editor/ui-base/src/command-bar/manual-menu.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -2
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -0
- package/@ones-editor/versions/src/types.d.ts +4 -1
- package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -1
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +210 -199
- package/dist/types.d.ts +8 -0
- package/package.json +5 -3
- package/@ones-editor/to-docx/src/doc2other/html-css.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
2
3
|
import { Connection, Doc } from 'sharedb/lib/client';
|
|
3
4
|
import ReconnectingWebSocket, { Event } from 'reconnecting-websocket';
|
|
4
|
-
import { EventEmitter } from 'events';
|
|
5
5
|
import { AuthMessage, ReauthFunc } from '../types';
|
|
6
6
|
import './sharedb-ext';
|
|
7
7
|
export declare class AuthConnection {
|
|
@@ -27,6 +27,7 @@ export declare class AuthConnection {
|
|
|
27
27
|
}>;
|
|
28
28
|
logout(): Promise<void>;
|
|
29
29
|
init(auth: AuthMessage): Promise<void>;
|
|
30
|
+
reConnect(token: string): Promise<void>;
|
|
30
31
|
handleAuthError(): Promise<void>;
|
|
31
32
|
reAuth: () => Promise<void>;
|
|
32
33
|
private emitPermissionError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createStatusInput(parent: HTMLElement, defaultValue: string, onChange: ((e: Event) => void), onKeyDown: (e: KeyboardEvent, composing: boolean) => void): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class OverflowTooltipTag {
|
|
3
|
+
private editor;
|
|
4
|
+
constructor(editor: OnesEditor);
|
|
5
|
+
private check;
|
|
6
|
+
private onMouseOver;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
static create(classes: string[], title: string): HTMLAnchorElement;
|
|
9
|
+
static replaceTitleSpace(title: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class StatusBoxCommand {
|
|
3
|
+
static id: string;
|
|
4
|
+
static get commands(): CommandItem[];
|
|
5
|
+
static insertStatus(editor: OnesEditor, containerId: string, blockIndex: number): void;
|
|
6
|
+
static insertEmptyBlockStatus(editor: OnesEditor, containerId: string, blockIndex: number): import("@ones-editor/core").BlockElement;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DocBlockTextOp } from '../../../@ones-editor/core';
|
|
2
|
+
import { StatusBoxData, StatusColor } from './types';
|
|
3
|
+
export declare function recordLastStatusBoxData(box: StatusBoxData): void;
|
|
4
|
+
export declare function getLastStatusBoxTitle(color: StatusColor): string;
|
|
5
|
+
export declare function createEmptyStatusBox(): DocBlockTextOp;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BoxElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
import { Popup } from '../../../@ones-editor/ui-base';
|
|
3
|
+
import { StatusColor } from './types';
|
|
4
|
+
import { StatusPalette } from './dom/status-palette';
|
|
5
|
+
export declare class StatusBoxEditor {
|
|
6
|
+
private editor;
|
|
7
|
+
linkPopup: Popup | null;
|
|
8
|
+
boxElement?: BoxElement;
|
|
9
|
+
statusPalette: StatusPalette;
|
|
10
|
+
isEditing: boolean;
|
|
11
|
+
constructor(editor: OnesEditor);
|
|
12
|
+
editorStatus: (boxElement: BoxElement) => void;
|
|
13
|
+
focus(): void;
|
|
14
|
+
handleShow: () => void;
|
|
15
|
+
handClose: () => void;
|
|
16
|
+
handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
|
|
17
|
+
createPopupContent(title: string, color: StatusColor, subtle: boolean): HTMLDivElement;
|
|
18
|
+
onColorChange: (e: Event) => void;
|
|
19
|
+
onTitleChange: (e: Event) => void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocBox } from '../../../@ones-editor/core';
|
|
2
|
+
export declare const STATUS_COLORS: readonly ["Blue", "Grey", "Yellow", "Red", "Green", "Purple"];
|
|
3
|
+
export type StatusColor = typeof STATUS_COLORS[number];
|
|
4
|
+
export interface StatusBoxData extends DocBox {
|
|
5
|
+
title: string;
|
|
6
|
+
subtle: boolean;
|
|
7
|
+
color: StatusColor;
|
|
8
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import TableBlock from './table-block';
|
|
1
|
+
import TableBlock, { includeBigTable } from './table-block';
|
|
2
2
|
import { TableBlockCommandProvider } from './commands';
|
|
3
3
|
import './locale';
|
|
4
4
|
import './table-style.scss';
|
|
5
5
|
import TableShortcuts from './table-block/table-shortcuts';
|
|
6
6
|
export * from './types';
|
|
7
|
-
export { TableBlock, TableBlockCommandProvider, TableShortcuts };
|
|
7
|
+
export { TableBlock, TableBlockCommandProvider, TableShortcuts, includeBigTable };
|
|
@@ -15,3 +15,4 @@ export declare function getParentTableBlock(block: BlockElement): BlockElement |
|
|
|
15
15
|
export declare function getTableCol(table: HTMLTableElement, colIndex: number): HTMLTableColElement;
|
|
16
16
|
export declare function isValid(tableBlock: BlockElement): boolean;
|
|
17
17
|
export declare function resetBlockHelperPos(scrollContainer: ScrollContainer): void;
|
|
18
|
+
export declare function includeBigTable(editor: OnesEditor): boolean;
|
|
@@ -48,6 +48,9 @@ export declare class TableGrid {
|
|
|
48
48
|
map<T>(fn: (cell: TableCell) => T): T[][];
|
|
49
49
|
getBottomCell(cellData: TableCell): TableCell | null;
|
|
50
50
|
getTopCell(cellData: TableCell): TableCell | null;
|
|
51
|
+
getLeftCell(cellData: TableCell): TableCell | null;
|
|
52
|
+
getRightCell(cellData: TableCell): TableCell | null;
|
|
53
|
+
get uniqueCells(): TableCell[];
|
|
51
54
|
get cells(): TableCell[];
|
|
52
55
|
getVirtualCellContainersGrid(): string[][];
|
|
53
56
|
static virtualCellContainersGridToChildren(virtualCellContainersGrid: string[][]): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './locale';
|
|
2
|
-
import { autoShowHideTemplates } from './templates/select-template';
|
|
2
|
+
import { autoShowHideTemplates, hideTemplates, showTemplates } from './templates/select-template';
|
|
3
3
|
export * from './templates/types';
|
|
4
|
-
export { autoShowHideTemplates };
|
|
4
|
+
export { autoShowHideTemplates, hideTemplates, showTemplates };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
3
|
import './select-templates.scss';
|
|
3
4
|
interface ShowTemplatesOptions {
|
|
4
5
|
reset?: boolean;
|
|
5
6
|
}
|
|
7
|
+
declare function showTemplatesCore(editor: OnesEditor, options?: ShowTemplatesOptions): void;
|
|
8
|
+
export declare const showTemplates: import("lodash").DebouncedFunc<typeof showTemplatesCore>;
|
|
9
|
+
export declare function hideTemplates(editor: OnesEditor): void;
|
|
6
10
|
export declare function autoShowHideTemplates(editor: OnesEditor, options?: ShowTemplatesOptions): void;
|
|
7
11
|
export {};
|
|
@@ -11,4 +11,5 @@ export interface TemplateOptions {
|
|
|
11
11
|
onChooseTemplate?: (editor: OnesEditor) => void;
|
|
12
12
|
onApplyTemplate?: (editor: OnesEditor, template: DocTemplate) => Promise<void>;
|
|
13
13
|
onTemplateChooserStatusChanged?: (editor: OnesEditor, cardContainer: HTMLElement | null, status: 'visible' | 'hide') => void;
|
|
14
|
+
onBeforeTemplateShow?: (editor: OnesEditor) => boolean;
|
|
14
15
|
}
|
|
@@ -18,6 +18,7 @@ export interface BlocksGenerator {
|
|
|
18
18
|
addHyperlinkParagraph(link: string | undefined, title?: string): void;
|
|
19
19
|
addOtherEmbedBlock(embedType: string, embedData: any): Promise<void>;
|
|
20
20
|
addTableMatrix(colsWidth: number[], matrix: CalcCell[][], data: DocObject): Promise<void>;
|
|
21
|
+
addVirtualBlock(blockId: string, data: DocObject, maxWidth: number): Promise<void>;
|
|
21
22
|
addEmptyParagraph(): void;
|
|
22
23
|
}
|
|
23
24
|
export declare function convertBlocksOfDoc(parent: string, // 父节点,暂时只有list block需要这个
|
|
@@ -8,7 +8,7 @@ export declare function getImageDim(obj: ImageObject, buffer: ArrayBuffer): Prom
|
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
10
|
buffer: ArrayBuffer;
|
|
11
|
-
}>;
|
|
11
|
+
} | undefined>;
|
|
12
12
|
export declare function reCalculateImageDims(dims: (ImageDimWithBuffer | undefined)[], maxWidth: number): {
|
|
13
13
|
width: number;
|
|
14
14
|
height: number;
|
|
@@ -64,7 +64,7 @@ export type BlockObject = {
|
|
|
64
64
|
border: boolean;
|
|
65
65
|
};
|
|
66
66
|
export type CodeObject = BlockObject[][];
|
|
67
|
-
export type ReadImageFunc = (appId: string, docId: string, image: string) => Promise<ArrayBuffer | undefined>;
|
|
67
|
+
export type ReadImageFunc = (appId: string, docId: string, image: string) => Promise<[ArrayBuffer | undefined, string]>;
|
|
68
68
|
export type GetDocByBlockFunc = (appId: string, docId: string, block: DocBlock) => Promise<DocObject | undefined>;
|
|
69
69
|
export type GetTextsByBoxFunc = (box: DocBlockTextOp) => Promise<DocBlockText | undefined>;
|
|
70
70
|
export type MD5Func = (s: string) => string;
|