@ones-editor/editor 1.1.8 → 1.1.9
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/standard-block-actions/hook.d.ts +2 -0
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -1
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +4 -3
- package/@ones-editor/core/src/core/editor/index.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/ensure-block-visible.d.ts +2 -0
- package/@ones-editor/core/src/core/types.d.ts +3 -0
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +4 -0
- package/@ones-editor/heading-collapse/src/doc-event/collapse-handler.d.ts +3 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/collapse-heading-block.d.ts +2 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/index.d.ts +3 -1
- package/@ones-editor/heading-collapse/src/heading-collapse-button/paste-handler.d.ts +8 -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/types.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +179 -179
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook } from '../../../../../@ones-editor/core';
|
|
2
2
|
export default class StandardBlockActionHook implements OnesEditorBlockHook {
|
|
3
3
|
commands(editor: OnesEditor, blockElement: BlockElement): BlockCommands;
|
|
4
|
+
deleteBlock(editor: OnesEditor, block: BlockElement): void;
|
|
5
|
+
copyBlock(editor: OnesEditor, block: BlockElement): void;
|
|
4
6
|
executeCommand: (editor: OnesEditor, bloockElement: BlockElement, item: CommandItem) => void;
|
|
5
7
|
}
|
|
@@ -4,7 +4,7 @@ export declare function complexBlockGetSelectedContainers(editor: OnesEditor, bl
|
|
|
4
4
|
export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
|
|
5
5
|
export declare function complexBlockGeFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
6
6
|
export declare function complexBlockGetLastSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
7
|
-
export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement): BlockElement | null;
|
|
7
|
+
export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
8
8
|
export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
9
9
|
export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
10
10
|
export declare function complexBlockFindNearestChildBlock(editor: OnesEditor, complexBlock: BlockElement, x: number, y: number): BlockElement;
|
|
@@ -4,5 +4,6 @@ export declare function injectDocToHtmlFragment(htmlFragment: string, doc: DocOb
|
|
|
4
4
|
export declare function addMetaToDoc(editor: OnesEditor, doc: DocObject): void;
|
|
5
5
|
export type BeforeCopyCallback = (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
6
6
|
export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent, beforeCopy?: BeforeCopyCallback): void;
|
|
7
|
+
export declare function editorCopyDoc(editor: OnesEditor, doc: DocObject): void;
|
|
7
8
|
export declare function editorCopyWithoutEvent(editor: OnesEditor, beforeCopy?: BeforeCopyCallback): void;
|
|
8
|
-
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<
|
|
9
|
+
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { editorCopyBlock, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
|
|
1
|
+
export { editorCopyBlock, editorCopyDoc, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
|
|
2
2
|
export { copyResourcesFromDoc } from './clipboard/resources/copy-resources';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { OnesEditor, SimpleBlockPosition
|
|
1
|
+
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
2
|
export declare function editorGetClientHeight(editor: OnesEditor): number;
|
|
3
3
|
export declare function editorGetClientTop(editor: OnesEditor): number;
|
|
4
4
|
export declare function editorGetClientBottom(editor: OnesEditor): number;
|
|
5
5
|
export declare function editorGetVisibleRect(editor: OnesEditor): DOMRect;
|
|
6
6
|
export declare function isBlockPositionVisible(editor: OnesEditor, pos: SimpleBlockPosition): boolean;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
|
|
8
|
+
animation?: boolean;
|
|
9
|
+
}): void;
|
|
8
10
|
export declare function editorScrollIntoView(editor: OnesEditor): void;
|
|
9
|
-
export declare function scrollIntoView(dom: Element, options?: any): void;
|
|
@@ -255,6 +255,8 @@ export interface ComplexKindBlock extends Block {
|
|
|
255
255
|
focus: ComplexBlockPosition;
|
|
256
256
|
};
|
|
257
257
|
getTextToolbarReferenceClient?: (editor: OnesEditor, complexBlock: BlockElement) => DOMRect | undefined;
|
|
258
|
+
isChildContainerVisible?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => boolean;
|
|
259
|
+
showChildContainer?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => void;
|
|
258
260
|
}
|
|
259
261
|
export interface SelectedBlock {
|
|
260
262
|
block: BlockElement;
|
|
@@ -476,6 +478,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
476
478
|
readonly options: OnesEditorOptions;
|
|
477
479
|
readonly domEvents: OnesEditorDomEvents;
|
|
478
480
|
readonly settingsProvider: OnesEditorSettingsProvider;
|
|
481
|
+
version: string;
|
|
479
482
|
readonly: boolean;
|
|
480
483
|
addCustom: <T extends OnesEditorCustom>(name: string, creator: OnesEditorCustomCreator) => T;
|
|
481
484
|
getCustom: <T extends OnesEditorCustom>(name: string) => T;
|
|
@@ -8,6 +8,8 @@ export interface IUserOptions {
|
|
|
8
8
|
minDuration?: number;
|
|
9
9
|
speed?: number;
|
|
10
10
|
verticalOffset?: number;
|
|
11
|
+
disableHorizontal?: boolean;
|
|
12
|
+
disableVertical?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export interface IOptions {
|
|
13
15
|
cancelOnUserAction: boolean;
|
|
@@ -18,6 +20,8 @@ export interface IOptions {
|
|
|
18
20
|
minDuration: number;
|
|
19
21
|
speed: number;
|
|
20
22
|
verticalOffset: number;
|
|
23
|
+
disableHorizontal?: boolean;
|
|
24
|
+
disableVertical?: boolean;
|
|
21
25
|
}
|
|
22
26
|
declare function animateScrollTo(y: number, userOptions?: IUserOptions): Promise<boolean>;
|
|
23
27
|
declare function animateScrollTo(coords: TCoords, userOptions?: IUserOptions): Promise<boolean>;
|
package/@ones-editor/heading-collapse/src/heading-collapse-button/collapse-heading-block.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function getHeadingBlockChildren(block: BlockElement): BlockElement[];
|
|
3
|
+
export declare function getNextHiddenBlocks(block: BlockElement): BlockElement[];
|
|
3
4
|
export declare function collapseHeadingBlock(editor: OnesEditor, block: BlockElement): void;
|
|
5
|
+
export declare function showBlocks(editor: OnesEditor, blocks: BlockElement[]): void;
|
|
4
6
|
export declare function expandHeadingBlock(editor: OnesEditor, block: BlockElement): void;
|
|
5
7
|
export declare function toggleHeadingBlock(editor: OnesEditor, block: BlockElement): void;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { getHeadingBlockChildren } from './collapse-heading-block';
|
|
1
2
|
import { HeadingBlockCollapseButton } from './heading-block-collapse-button-render';
|
|
2
|
-
export
|
|
3
|
+
export * from './heading-utils';
|
|
4
|
+
export { HeadingBlockCollapseButton, getHeadingBlockChildren };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocObject, OnesEditor, OnesEditorCustom, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class HeadingPasteHandler implements OnesEditorInputHandler, OnesEditorCustom {
|
|
3
|
+
private startIndex;
|
|
4
|
+
private containerId;
|
|
5
|
+
handleBeforePaste(editor: OnesEditor): Promise<boolean>;
|
|
6
|
+
handleAfterPasteDoc(editor: OnesEditor, doc: DocObject): Promise<boolean>;
|
|
7
|
+
destroy(): void;
|
|
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;
|