@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.
@@ -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<boolean>;
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';
@@ -5,6 +5,7 @@ export declare class RootContainer {
5
5
  rootContainer: ContainerElement;
6
6
  resizeObserver: ResizeObserver;
7
7
  private isMoved;
8
+ private mouseDownEvent;
8
9
  constructor(editor: OnesEditor, rootContainer: ContainerElement);
9
10
  private bindEvents;
10
11
  private unbindEvents;
@@ -1,9 +1,10 @@
1
- import { OnesEditor, SimpleBlockPosition, ContainerElement } from '../../types';
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 isChildContainerVisible(editor: OnesEditor, container: ContainerElement): boolean;
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;
@@ -1,2 +1,3 @@
1
1
  export * from './editor';
2
2
  export * from './actions';
3
+ export { scrollIntoView } from './editor-dom';
@@ -0,0 +1,2 @@
1
+ import { BlockElement, OnesEditor } from '../types';
2
+ export declare function ensureBlockVisible(editor: OnesEditor, block: BlockElement): 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>;
@@ -0,0 +1,3 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare function getCollapsedHeading(editor: OnesEditor, blockId: string): boolean | undefined;
3
+ export declare function setCollapsedHeading(editor: OnesEditor, blockId: string, collapsed: boolean): void;
@@ -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 { HeadingBlockCollapseButton };
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 };
@@ -1,3 +1,4 @@
1
1
  import { ComplexKindBlock } from '../../../../@ones-editor/core';
2
+ export { includeBigTable } from './table-dom';
2
3
  declare const TableBlock: ComplexKindBlock;
3
4
  export default TableBlock;
@@ -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;
@@ -6,4 +6,5 @@ export interface TableOptions {
6
6
  allowScrollBarFixed?: boolean;
7
7
  hideCellMenu?: boolean;
8
8
  hideToolbar?: boolean;
9
+ bigTableBoundary?: number;
9
10
  }