@ones-editor/editor 1.1.8-beta.9 → 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';
@@ -1,10 +1,9 @@
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;
8
7
  export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
9
8
  animation?: boolean;
10
9
  }): void;
@@ -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;
@@ -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
+ }