@ones-editor/editor 2.0.4-beta.2 → 2.0.4-beta.5

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,3 +1,3 @@
1
- import { DocBlock, OnesEditorDoc } from './doc';
2
- export declare function createContainer(doc: OnesEditorDoc, blocks: DocBlock[]): string;
1
+ import { DocBlock, DocObject, OnesEditorDoc } from './doc';
2
+ export declare function createContainer(doc: OnesEditorDoc, docsOrDocObject: DocBlock[] | DocObject): string;
3
3
  export declare function createEmptyContainer(doc: OnesEditorDoc, text?: string): string;
@@ -1,4 +1,4 @@
1
1
  import { DocObject } from '../../../doc';
2
2
  import { BlockElement, CloneBlockResultInfo, ContainerElement, OnesEditor } from '../../../types';
3
3
  export declare function editorInsertDoc(editor: OnesEditor, block: BlockElement, offset: number, insertedDoc: DocObject, cloneDocResult?: CloneBlockResultInfo): void;
4
- export declare function editorInsertDocAt(editor: OnesEditor, container: ContainerElement, blockIndex: number, insertedDoc: DocObject, cloneDocResult?: CloneBlockResultInfo): BlockElement[];
4
+ export declare function editorInsertDocAt(editor: OnesEditor, container: ContainerElement, blockIndex: number, _docToInsert: DocObject, cloneDocResult?: CloneBlockResultInfo): BlockElement[];
@@ -299,6 +299,7 @@ export interface ComplexKindBlock extends Block {
299
299
  getTextToolbarReferenceClient?: (editor: OnesEditor, complexBlock: BlockElement) => DOMRect | undefined;
300
300
  isChildContainerVisible?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => boolean;
301
301
  showChildContainer?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => void;
302
+ beforeInsertDoc?: (editor: OnesEditor, container: ContainerElement, insertDoc: DocObject) => DocObject | undefined;
302
303
  }
303
304
  export interface SelectedBlock {
304
305
  block: BlockElement;
@@ -1,8 +1,8 @@
1
1
  import { OnesEditorInputHandler, OnesEditorCustom, OnesEditor, OnesEditorDocs } from '../../../@ones-editor/core';
2
- export default class LayoutBlockCaptionInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
2
+ export declare class LayoutBlockCaptionInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
3
3
  private editor;
4
- constructor(editor: OnesEditor);
4
+ private skipForRootContainer;
5
+ constructor(editor: OnesEditor, skipForRootContainer?: boolean);
5
6
  destroy(): void;
6
7
  handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
7
- static init(editor: OnesEditor): void;
8
8
  }
@@ -1,3 +1,3 @@
1
- import { BlockElement, ContainerElement } from '../../../@ones-editor/core';
2
- export declare function getChildContainers(block: BlockElement, from?: string, to?: string): ContainerElement[];
1
+ import { BlockElement, ContainerElement, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function getChildContainers(editor: OnesEditor, block: BlockElement, from?: string, to?: string): ContainerElement[];
3
3
  export declare function getChildSeparators(block: BlockElement): HTMLElement[];
@@ -9,7 +9,7 @@ export declare const LAYOUT_SHORTCUT_ID = "insert-layout";
9
9
  /**
10
10
  * 快捷键提示
11
11
  */
12
- export declare const LAYOUT_SHORTCUT_SUBTEXT = "/layout";
12
+ export declare const LAYOUT_SHORTCUT_SUBTEXT = "/column";
13
13
  export declare const LAYOUT_BLOCK_TYPE = "layout";
14
14
  /**
15
15
  * 最大分栏数
@@ -2,4 +2,4 @@ import './locale';
2
2
  import './layout-styles.scss';
3
3
  import { LayoutKindBlock } from './types';
4
4
  export declare const LayoutBlock: LayoutKindBlock;
5
- export * from './paste';
5
+ export * from './caption';
@@ -1,4 +1,4 @@
1
- import { ComplexKindBlock, DocBlock } from '../../../@ones-editor/core';
1
+ import { ComplexKindBlock, DocBlock, OnesEditor } from '../../../@ones-editor/core';
2
2
  export interface LayoutDocBlock extends DocBlock {
3
3
  children: string[];
4
4
  colsWidth: number[];
@@ -11,3 +11,7 @@ export type LayoutDropData = {
11
11
  export interface CreateLayoutData {
12
12
  colCount?: number;
13
13
  }
14
+ export interface EditorConfigLayoutOptions {
15
+ onColumnCreated?: (editor: OnesEditor, count: number) => void;
16
+ onColumnWidthChange?: (editor: OnesEditor, count: number, index: number, colsWidth: number[]) => void;
17
+ }
@@ -1,2 +1,5 @@
1
- import { BlockElement } from '../../../@ones-editor/core';
1
+ import { BlockElement, ContainerElement, DocBlock, DocObject, OnesEditor } from '../../../@ones-editor/core';
2
2
  export declare function isBlockElement(item: unknown): item is BlockElement;
3
+ export declare function flattenLayoutBlockIfExists(_docObject: DocObject, containerID?: string): DocBlock[];
4
+ export declare function currentCaptionInRootContainer(editor: OnesEditor): boolean;
5
+ export declare function getClosetLayoutContainer(block: BlockElement | undefined): ContainerElement | undefined;