@ones-editor/editor 0.0.3-beta.44 → 0.0.3-beta.45
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-button/drag-drop/find-preview-element.d.ts +1 -1
- package/@ones-editor/code-block/src/code-block/code-caret.d.ts +7 -0
- package/@ones-editor/code-block/src/code-block/code-copy.d.ts +4 -0
- package/@ones-editor/code-block/src/code-block/index.d.ts +3 -1
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +0 -1
- package/@ones-editor/comments/src/comments-list/arrange-items.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/block-anchor/create-block-anchor.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-markdown.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-text.d.ts +3 -0
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -0
- package/@ones-editor/core/src/core/converter/block-to-html.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-markdown.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/focus-to-end.d.ts +0 -1
- package/@ones-editor/core/src/core/index.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +3 -1
- package/@ones-editor/core/src/core/types.d.ts +5 -2
- package/@ones-editor/core/src/utils/dom-scroll.d.ts +3 -1
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +1 -0
- package/@ones-editor/list-block/src/converter/convert-list-to.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-to-list.d.ts +14 -0
- package/@ones-editor/list-block/src/converter/index.d.ts +2 -14
- package/@ones-editor/list-block/src/level/change-multi-levels.d.ts +2 -0
- package/@ones-editor/list-block/src/level/decrease-level.d.ts +1 -0
- package/@ones-editor/list-block/src/types.d.ts +2 -1
- package/@ones-editor/media-embed/src/core/media-embed.d.ts +3 -1
- package/@ones-editor/mention/src/mention.d.ts +1 -0
- package/@ones-editor/scroll-container/src/dom-utils.d.ts +9 -0
- package/@ones-editor/scroll-container/src/index.d.ts +2 -0
- package/@ones-editor/scroll-container/src/observer/container-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +2 -0
- package/@ones-editor/scroll-container/src/types.d.ts +1 -0
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +1 -0
- package/@ones-editor/table-block/src/types.d.ts +2 -0
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/locale/en-us.d.ts +2 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -0
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +1 -0
- package/@ones-editor/ui/src/toolbar/box-only.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/@ones-editor/ui-base/src/item-shortcuts/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +2 -2
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/webpage-embed/src/ui/dialog.d.ts +2 -2
- package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -0
- package/dist/index.js +154 -134
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BlockElement } from '../../../../../@ones-editor/core';
|
|
2
2
|
export declare function findPreviewElement(block: BlockElement): HTMLElement;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DocObject, OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
export default class CopyCodeInputHandler implements OnesEditorInputHandler {
|
|
3
|
+
handleBeforeCopy(editor: OnesEditor, event: ClipboardEvent, doc: DocObject): boolean | DocObject | undefined;
|
|
4
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import CodeBlock, { CodeLineBlock } from './code-block';
|
|
2
|
+
import OnesEditorCodeCaret from './code-caret';
|
|
3
|
+
import CopyCodeInputHandler from './code-copy';
|
|
2
4
|
import CodeShortcuts from './code-shortcuts';
|
|
3
5
|
import CodeTextDecorator from './code-text-decorate';
|
|
4
|
-
export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts };
|
|
6
|
+
export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts, CopyCodeInputHandler, OnesEditorCodeCaret };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OnesEditorComment, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isChildComment(comment: OnesEditorComment): boolean;
|
|
3
|
-
export declare function getCommentsRoot(): HTMLDivElement;
|
|
4
3
|
export declare function getCommentItemCountInGroupItem(groupItemRoot: HTMLElement, commentItemCls?: string): number;
|
|
5
4
|
export declare function getClosestCommentItemId(element: HTMLElement): string | null;
|
|
6
5
|
export declare function addGroupActionToElement(element: HTMLElement, action: string): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { CommentGroupItem } from './group-item';
|
|
3
|
-
export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null): void;
|
|
3
|
+
export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null, fixTop?: number): void;
|
|
@@ -31,6 +31,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
31
31
|
handleEditorResize: () => void;
|
|
32
32
|
handleDocChanged: () => void;
|
|
33
33
|
handleItemResize: () => void;
|
|
34
|
+
handleScroll: (event: WheelEvent) => void;
|
|
34
35
|
updateGroupItemSwitch: () => void;
|
|
35
36
|
private updateComments;
|
|
36
37
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../types';
|
|
2
2
|
import './anchor.scss';
|
|
3
3
|
export declare function createBlockAnchor(editor: OnesEditor, block: BlockElement, id: string, refClientRect?: DOMRect): HTMLElement;
|
|
4
|
+
export declare function createBlockCaretAnchor(editor: OnesEditor, block: BlockElement, offset: number, id: string): HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocObject } from '../../doc';
|
|
2
2
|
import { BlockElement, OnesEditor } from '../../types';
|
|
3
|
-
export declare function docToPlainText(editor: OnesEditor, doc: DocObject): string;
|
|
4
3
|
export declare function addMetaToDoc(editor: OnesEditor, doc: DocObject): void;
|
|
5
|
-
export
|
|
4
|
+
export type BeforeCopyCallback = (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
5
|
+
export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent, beforeCopy?: BeforeCopyCallback): void;
|
|
6
6
|
export declare function editorCopyWithoutEvent(editor: OnesEditor): void;
|
|
7
7
|
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<boolean>;
|
|
@@ -10,6 +10,7 @@ export interface EditorInputCallbacks {
|
|
|
10
10
|
onFocus: () => void;
|
|
11
11
|
onBlur: () => void;
|
|
12
12
|
onPaste: (event: ClipboardEvent) => void;
|
|
13
|
+
onCopy: (event: ClipboardEvent) => void;
|
|
13
14
|
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
14
15
|
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
15
16
|
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -11,6 +11,7 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
11
11
|
onRemoteChanged(type: RemoteChangeType): void;
|
|
12
12
|
onCompositionStart(event: Event): void;
|
|
13
13
|
onUpdateCompositionText(event: Event, text: string, end: boolean): void;
|
|
14
|
+
onCopy(event: ClipboardEvent): void;
|
|
14
15
|
onPaste(event: ClipboardEvent): void;
|
|
15
16
|
onFocus(): void;
|
|
16
17
|
onBlur(): void;
|
|
@@ -22,5 +22,5 @@ import { editorMovePageUp } from './move-page-up';
|
|
|
22
22
|
import { editorMovePageDown } from './move-page-down';
|
|
23
23
|
import { editorSelectPageUp } from './select-page-up';
|
|
24
24
|
import { editorSelectPageDown } from './select-page-down';
|
|
25
|
-
import { editorSelectAll } from './select-all';
|
|
26
|
-
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, };
|
|
25
|
+
import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
|
|
26
|
+
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { OnesEditor } from '../../types';
|
|
1
|
+
import { ContainerElement, OnesEditor, SimpleSelectionRange } from '../../types';
|
|
2
|
+
export declare function isContainerSelectedAllChildBlocks(container: ContainerElement, range: SimpleSelectionRange): boolean;
|
|
2
3
|
export declare function editorSelectAll(editor: OnesEditor): boolean;
|
|
4
|
+
export declare function editorSelectContainer(editor: OnesEditor, container: ContainerElement): void;
|
|
@@ -61,6 +61,7 @@ export interface Box {
|
|
|
61
61
|
boxType: string;
|
|
62
62
|
updateBoxContent: (editor: OnesEditor, boxElement: BoxElement, boxContent: BoxContentElement, boxData: DocBox) => void;
|
|
63
63
|
convertFrom?: (editor: OnesEditor, text: string) => DocBox | null;
|
|
64
|
+
convertTo?: (editor: OnesEditor, boxData: DocBox, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
64
65
|
handleClickBox?: (editor: OnesEditor, box: BoxElement, event: MouseEvent) => void;
|
|
65
66
|
toStandardText?: (editor: OnesEditor, box: DocBox) => Promise<DocBlockText | undefined>;
|
|
66
67
|
getBoxProperties?: (editor: OnesEditor, boxElement: BoxElement) => BoxProperties;
|
|
@@ -131,8 +132,9 @@ export interface CommandItem {
|
|
|
131
132
|
manualShowChildren?: boolean;
|
|
132
133
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
133
134
|
childrenOffset?: [number, number];
|
|
134
|
-
|
|
135
|
+
subText?: string;
|
|
135
136
|
defaultCheckedChildren?: string[];
|
|
137
|
+
disableTooltip?: boolean;
|
|
136
138
|
setCloseable?: (closeable: Closeable) => void;
|
|
137
139
|
beforePopup?: (parent: unknown) => void;
|
|
138
140
|
}
|
|
@@ -215,7 +217,7 @@ export interface Block {
|
|
|
215
217
|
data?: DocBlockAttributes;
|
|
216
218
|
}) => ConvertBlockResult | null;
|
|
217
219
|
selectionToDoc?: (editor: OnesEditor, selectedBlock: SelectedBlock) => DocObject;
|
|
218
|
-
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
220
|
+
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown', path: BlockPath) => string;
|
|
219
221
|
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
|
|
220
222
|
getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
|
|
221
223
|
blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject) => DocObject;
|
|
@@ -579,6 +581,7 @@ export interface OnesEditorInputHandler {
|
|
|
579
581
|
handleAfterInsertText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => boolean;
|
|
580
582
|
handleBeforeKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
581
583
|
handleAfterKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
584
|
+
handleBeforeCopy?: (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
582
585
|
handleBeforePaste?: (editor: OnesEditor, event: ClipboardEvent, doc: OnesEditorDocs) => Promise<boolean>;
|
|
583
586
|
handleAfterPaste?: (editor: OnesEditor, event: ClipboardEvent, doc: OnesEditorDocs) => Promise<boolean>;
|
|
584
587
|
handleBeforePasteDoc?: (editor: OnesEditor, doc: DocObject) => Promise<boolean>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare function getScrollContainer(element: HTMLElement
|
|
1
|
+
export declare function getScrollContainer(element: HTMLElement, options?: {
|
|
2
|
+
horizontal?: boolean;
|
|
3
|
+
}): HTMLElement;
|
|
2
4
|
export declare function disablePageScroll(id: string): void;
|
|
3
5
|
export declare function enablePageScroll(id: string): void;
|
|
@@ -6,6 +6,7 @@ export default abstract class GraphBase {
|
|
|
6
6
|
private codeEmbedDataKey;
|
|
7
7
|
protected editor: OnesEditor;
|
|
8
8
|
logger: Logger;
|
|
9
|
+
editing: boolean;
|
|
9
10
|
constructor(editor: OnesEditor, graphType: GraphType, codeEmbedDataKey: string);
|
|
10
11
|
protected abstract code2ObjectUrl(code: string): Promise<string>;
|
|
11
12
|
protected abstract code2ResourceId(code: string): Promise<string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { DocListBlock, ListBlockType } from '../types';
|
|
3
|
+
type ConvertToListData = {
|
|
4
|
+
listType?: ListBlockType;
|
|
5
|
+
};
|
|
6
|
+
export declare function findNearestList(srcBlock: BlockElement, type: ListBlockType): BlockElement | null;
|
|
7
|
+
export declare function convertToList(editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
8
|
+
offset: number;
|
|
9
|
+
data?: ConvertToListData;
|
|
10
|
+
}): {
|
|
11
|
+
blockData: DocListBlock;
|
|
12
|
+
onConverted: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
|
+
} | null;
|
|
14
|
+
export {};
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type ConvertToListData = {
|
|
4
|
-
listType?: ListBlockType;
|
|
5
|
-
};
|
|
6
|
-
export declare function findNearestList(srcBlock: BlockElement, type: ListBlockType): BlockElement | null;
|
|
7
|
-
export declare function convertToList(editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
8
|
-
offset: number;
|
|
9
|
-
data?: ConvertToListData;
|
|
10
|
-
}): {
|
|
11
|
-
blockData: DocListBlock;
|
|
12
|
-
onConverted: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
|
-
} | null;
|
|
14
|
-
export {};
|
|
1
|
+
export * from './convert-to-list';
|
|
2
|
+
export * from './convert-list-to';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function canDecreaseListBlockLevel(editor: OnesEditor, block: BlockElement): boolean;
|
|
2
3
|
export declare function decreaseListBlockLevel(editor: OnesEditor, block: BlockElement): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, DocBlock, OnesEditor } from '../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, DocBlock, DocBlockText, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export interface DocListBlock extends DocBlock {
|
|
3
|
+
text: DocBlockText;
|
|
3
4
|
level: number;
|
|
4
5
|
start: number;
|
|
5
6
|
ordered: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InsertEmptyBlockOptions, DocEmbedBlock, DocEmbedData } from '../../../../@ones-editor/core';
|
|
1
|
+
import { InsertEmptyBlockOptions, DocEmbedBlock, DocEmbedData, DocObject } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { Embed, OnesEditor, BlockContentElement, BlockElement } from '../../../../@ones-editor/core';
|
|
3
3
|
import { MediaType } from '../constant';
|
|
4
4
|
import { Media } from './media';
|
|
@@ -20,10 +20,12 @@ export declare abstract class MediaEmbed implements Embed {
|
|
|
20
20
|
icon: string;
|
|
21
21
|
order: number;
|
|
22
22
|
group: string;
|
|
23
|
+
subText: string;
|
|
23
24
|
}[];
|
|
24
25
|
handleInsertEmptyEmbed: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<BlockElement | null>;
|
|
25
26
|
};
|
|
26
27
|
createEmbedContent(editor: OnesEditor, content: BlockContentElement, blockData: DocEmbedBlock<DocEmbedData>): void;
|
|
27
28
|
handleUpdateBlock(editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock<DocEmbedData>): boolean;
|
|
28
29
|
handleDeleteBlock(editor: OnesEditor, block: BlockElement): void;
|
|
30
|
+
convertTo(editor: OnesEditor, blockData: DocEmbedBlock, doc: DocObject, type: 'html' | 'text' | 'markdown'): string;
|
|
29
31
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
|
|
2
|
+
export declare function getElementScale(element: Element): number;
|
|
3
|
+
export declare function getSizeAsScale(element: HTMLElement, num: number): number;
|
|
2
4
|
export declare function getScrollWrapPaddingSize(scrollWrap: ScrollAreaElement): {
|
|
3
5
|
paddingBottom: number;
|
|
4
6
|
paddingTop: number;
|
|
5
7
|
paddingLeft: number;
|
|
6
8
|
paddingRight: number;
|
|
7
9
|
};
|
|
10
|
+
export declare function getElementScrollSize(scrollContainer: Element): {
|
|
11
|
+
scrollLeft: number;
|
|
12
|
+
scrollWidth: number;
|
|
13
|
+
clientWidth: number;
|
|
14
|
+
clientHeight: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function getElementOffset(element: HTMLElement, key: 'offsetLeft' | 'offsetTop' | 'offsetWidth' | 'offsetHeight'): number;
|
|
8
17
|
export declare function getOriginBoundaryData(scrollCore: ScrollCore, scrollContainer: ScrollContainerElement): {
|
|
9
18
|
originWidth: number;
|
|
10
19
|
maxLeft: number;
|
|
@@ -3,6 +3,7 @@ import { ScrollContainerOptions } from './types';
|
|
|
3
3
|
export * from './types';
|
|
4
4
|
export interface ChildEvents {
|
|
5
5
|
scroll: (scrollContainer: ScrollContainer) => void;
|
|
6
|
+
resize: (scrollContainer: ScrollContainer) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare class ScrollContainer extends TypedEmitter<ChildEvents> {
|
|
8
9
|
private scrollListener?;
|
|
@@ -13,6 +14,7 @@ export declare class ScrollContainer extends TypedEmitter<ChildEvents> {
|
|
|
13
14
|
get scrollOptions(): ScrollContainerOptions;
|
|
14
15
|
init: (options: ScrollContainerOptions) => void;
|
|
15
16
|
private handleContainerScroll;
|
|
17
|
+
private handleResize;
|
|
16
18
|
private handleBaseListenerDestroy;
|
|
17
19
|
destroy(): void;
|
|
18
20
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
2
|
export declare class ContainerResizeObserver {
|
|
3
3
|
private scrollCore;
|
|
4
|
+
private callback;
|
|
4
5
|
private resizeObserver;
|
|
5
|
-
constructor(scrollCore: ScrollCore);
|
|
6
|
+
constructor(scrollCore: ScrollCore, callback: (scrollContainer: ScrollContainerElement) => void);
|
|
6
7
|
private get containers();
|
|
7
8
|
private handleResizeEntry;
|
|
8
9
|
private handleContentResize;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
2
|
export declare class LocatingContainerResizeObserver {
|
|
3
3
|
private scrollCore;
|
|
4
|
+
private callback;
|
|
4
5
|
private resizeObserver;
|
|
5
6
|
private scrollContainersMap;
|
|
6
|
-
constructor(scrollCore: ScrollCore);
|
|
7
|
+
constructor(scrollCore: ScrollCore, callback: (scrollContainer: ScrollContainerElement) => void);
|
|
7
8
|
private handleResizeEntry;
|
|
8
9
|
private handleResize;
|
|
9
10
|
bind(scrollContainer: ScrollContainerElement): void;
|
|
@@ -4,6 +4,7 @@ import { ScrollContainerOptions } from './types';
|
|
|
4
4
|
import './ui/bar.scss';
|
|
5
5
|
interface ChildEvents {
|
|
6
6
|
scroll: (scrollCore: ScrollListener, scrollContainerElement: ScrollContainerElement) => void;
|
|
7
|
+
resize: (scrollCore: ScrollListener, scrollContainerElement: ScrollContainerElement) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare class ScrollListener extends TypedEmitter<ChildEvents> implements ScrollCore {
|
|
9
10
|
private parentContainer;
|
|
@@ -18,6 +19,7 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
18
19
|
constructor(parentContainer: ParentContainerElement);
|
|
19
20
|
private load;
|
|
20
21
|
private handleScrollContainerScroll;
|
|
22
|
+
private handleResize;
|
|
21
23
|
getParentScrollContainer(): Element;
|
|
22
24
|
private handleIntersection;
|
|
23
25
|
private handleWindowEffect;
|
|
@@ -6,6 +6,11 @@ declare const _default: {
|
|
|
6
6
|
mergeCell: string;
|
|
7
7
|
splitCell: string;
|
|
8
8
|
tableConfigKey: string;
|
|
9
|
+
deleteTable: string;
|
|
10
|
+
insertCol: string;
|
|
11
|
+
insertRow: string;
|
|
12
|
+
deleteCol: string;
|
|
13
|
+
deleteRow: string;
|
|
9
14
|
tableConfig: {
|
|
10
15
|
rowTitle: string;
|
|
11
16
|
colTitle: string;
|
|
@@ -6,6 +6,11 @@ declare const _default: {
|
|
|
6
6
|
mergeCell: string;
|
|
7
7
|
splitCell: string;
|
|
8
8
|
tableConfigKey: string;
|
|
9
|
+
deleteTable: string;
|
|
10
|
+
insertCol: string;
|
|
11
|
+
insertRow: string;
|
|
12
|
+
deleteCol: string;
|
|
13
|
+
deleteRow: string;
|
|
9
14
|
tableConfig: {
|
|
10
15
|
rowTitle: string;
|
|
11
16
|
colTitle: string;
|
|
@@ -14,6 +14,7 @@ export declare class TableScrollEvents {
|
|
|
14
14
|
setAutoScroll(dir: NonNullable<ScrollDirType>): void;
|
|
15
15
|
handleSelectionChanged: (editor: OnesEditor) => void;
|
|
16
16
|
handleScroll: (scrollContainer: ScrollContainer) => void;
|
|
17
|
+
handleReset: (scrollContainer: ScrollContainer) => void;
|
|
17
18
|
destroy(): void;
|
|
18
19
|
}
|
|
19
20
|
export declare function handleTableScrollEvents(editor: OnesEditor): TableScrollEvents;
|