@ones-editor/editor 1.1.8-beta.2 → 1.1.8-beta.20

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.
Files changed (27) hide show
  1. package/@ones-editor/block-menu/src/block-menu/standard-block-actions/hook.d.ts +2 -0
  2. package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
  3. package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +1 -1
  4. package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +1 -1
  5. package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -1
  6. package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
  7. package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +3 -1
  8. package/@ones-editor/core/src/core/editor/index.d.ts +1 -0
  9. package/@ones-editor/core/src/core/types.d.ts +6 -2
  10. package/@ones-editor/heading-collapse/src/doc-event/collapse-handler.d.ts +3 -0
  11. package/@ones-editor/heading-collapse/src/heading-collapse-button/collapse-heading-block.d.ts +2 -0
  12. package/@ones-editor/heading-collapse/src/heading-collapse-button/index.d.ts +3 -1
  13. package/@ones-editor/heading-collapse/src/heading-collapse-button/paste-handler.d.ts +8 -0
  14. package/@ones-editor/table-block/src/index.d.ts +2 -2
  15. package/@ones-editor/table-block/src/table-block/index.d.ts +1 -0
  16. package/@ones-editor/table-block/src/table-block/table-dom.d.ts +1 -0
  17. package/@ones-editor/table-block/src/types.d.ts +1 -0
  18. package/@ones-editor/to-docx/src/doc2other/image.d.ts +1 -1
  19. package/@ones-editor/to-docx/src/doc2other/types.d.ts +1 -1
  20. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  21. package/@ones-editor/ui/src/index.d.ts +2 -2
  22. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +2 -2
  23. package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +2 -2
  24. package/@ones-editor/ui/src/quick-menu/types.d.ts +7 -2
  25. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +1 -0
  26. package/dist/index.js +830 -75933
  27. 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
  }
@@ -1,3 +1,3 @@
1
- import { BlockElement, CommandItem, OnesEditor } from '../../types';
1
+ import { BlockCommandItemWithSource, BlockElement, CommandItem, OnesEditor } from '../../types';
2
2
  export declare function executeEmbedBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItem): unknown;
3
- export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItem): unknown;
3
+ export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: BlockCommandItemWithSource): unknown;
@@ -1,5 +1,5 @@
1
1
  import { BlockCommandItemWithSource, CommandParams, CommandResult, SelectionRange } from '../../types';
2
- export declare function getRangeCommands(range: SelectionRange): BlockCommandItemWithSource[];
2
+ export declare function getRangeCommands(range: SelectionRange, source: string): BlockCommandItemWithSource[];
3
3
  export declare function executeRangeCommand(range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams): {
4
4
  [index: string]: CommandResult;
5
5
  };
@@ -7,7 +7,7 @@ export default class EditorCommandProviders implements OnesEditorCommandProvider
7
7
  registerCommandProvider(provider: OnesEditorCommandProvider): void;
8
8
  getCommandProviders(): OnesEditorCommandProvider[];
9
9
  getCommandProvider(id: string): OnesEditorCommandProvider;
10
- getCommands(range: SelectionRange): BlockCommandItemWithSource[];
10
+ getCommands(range: SelectionRange, source: string): BlockCommandItemWithSource[];
11
11
  executeCommand(range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams): {
12
12
  [index: string]: import("../types").CommandResult;
13
13
  };
@@ -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,5 +5,7 @@ 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
7
  export declare function isChildContainerVisible(editor: OnesEditor, container: ContainerElement): boolean;
8
+ export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
9
+ animation?: boolean;
10
+ }): void;
8
11
  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';
@@ -78,7 +78,7 @@ export interface InsertEmptyBlockOptions {
78
78
  containerId: string;
79
79
  blockIndex: number;
80
80
  data?: Record<string, unknown>;
81
- from?: 'block-menu' | 'quick-menu';
81
+ from?: 'block-menu' | 'quick-menu' | 'add-block-menu';
82
82
  }
83
83
  export interface EmbedOptions {
84
84
  name: string;
@@ -380,6 +380,9 @@ export interface OnesEditorEvents {
380
380
  'blur': (editor: OnesEditor) => void;
381
381
  'focus': (editor: OnesEditor) => void;
382
382
  'containerRemount': (editor: OnesEditor, containerId: string) => void;
383
+ 'beforeExecCommand': (editor: OnesEditor, command: CommandItem, option: {
384
+ source: string;
385
+ }) => void;
383
386
  }
384
387
  export interface OnesEditorSettingsProvider {
385
388
  getItem: (key: string) => string | null;
@@ -476,6 +479,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
476
479
  readonly options: OnesEditorOptions;
477
480
  readonly domEvents: OnesEditorDomEvents;
478
481
  readonly settingsProvider: OnesEditorSettingsProvider;
482
+ version: string;
479
483
  readonly: boolean;
480
484
  addCustom: <T extends OnesEditorCustom>(name: string, creator: OnesEditorCustomCreator) => T;
481
485
  getCustom: <T extends OnesEditorCustom>(name: string) => T;
@@ -667,7 +671,7 @@ export interface OnesEditorCommandProviders {
667
671
  registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
668
672
  getCommandProviders: () => OnesEditorCommandProvider[];
669
673
  getCommandProvider: (id: string) => OnesEditorCommandProvider;
670
- getCommands: (range: SelectionRange) => BlockCommandItemWithSource[];
674
+ getCommands: (range: SelectionRange, source: string) => BlockCommandItemWithSource[];
671
675
  executeCommand: (range: SelectionRange, item: BlockCommandItemWithSource, params: CommandParams) => {
672
676
  [index: string]: CommandResult;
673
677
  };
@@ -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
  }
@@ -8,7 +8,7 @@ export declare function getImageDim(obj: ImageObject, buffer: ArrayBuffer): Prom
8
8
  width: number;
9
9
  height: number;
10
10
  buffer: ArrayBuffer;
11
- }>;
11
+ } | undefined>;
12
12
  export declare function reCalculateImageDims(dims: (ImageDimWithBuffer | undefined)[], maxWidth: number): {
13
13
  width: number;
14
14
  height: number;
@@ -64,7 +64,7 @@ export type BlockObject = {
64
64
  border: boolean;
65
65
  };
66
66
  export type CodeObject = BlockObject[][];
67
- export type ReadImageFunc = (appId: string, docId: string, image: string) => Promise<ArrayBuffer | undefined>;
67
+ export type ReadImageFunc = (appId: string, docId: string, image: string) => Promise<[ArrayBuffer | undefined, string]>;
68
68
  export type GetDocByBlockFunc = (appId: string, docId: string, block: DocBlock) => Promise<DocObject | undefined>;
69
69
  export type GetTextsByBoxFunc = (box: DocBlockTextOp) => Promise<DocBlockText | undefined>;
70
70
  export type MD5Func = (s: string) => string;