@ones-editor/editor 1.1.17-beta.1 → 1.1.17-beta.10

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 (57) hide show
  1. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
  2. package/@ones-editor/code-block/src/code-block/languages.d.ts +1 -1
  3. package/@ones-editor/code-block/src/locale/en-us.d.ts +1 -0
  4. package/@ones-editor/code-block/src/locale/ja-jp.d.ts +1 -0
  5. package/@ones-editor/code-block/src/locale/zh-cn.d.ts +1 -0
  6. package/@ones-editor/comments/src/comments/comments.d.ts +1 -1
  7. package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
  8. package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -1
  9. package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
  10. package/@ones-editor/comments/src/comments-render/index.d.ts +1 -0
  11. package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -0
  12. package/@ones-editor/core/src/core/containers/container.d.ts +1 -1
  13. package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +1 -0
  14. package/@ones-editor/core/src/core/editor/actions/update-block-text.d.ts +3 -3
  15. package/@ones-editor/core/src/core/editor/actions/update-box-data.d.ts +2 -2
  16. package/@ones-editor/core/src/core/types.d.ts +3 -1
  17. package/@ones-editor/core/src/utils/dom.d.ts +1 -0
  18. package/@ones-editor/core/src/utils/file.d.ts +2 -1
  19. package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +2 -0
  20. package/@ones-editor/list-block/src/mindmap/to-mindmap/to-mindmap.d.ts +1 -1
  21. package/@ones-editor/list-block/src/mindmap/to-mindmap/types.d.ts +1 -1
  22. package/@ones-editor/status/package.json +7 -0
  23. package/@ones-editor/status/src/dom/input.d.ts +1 -0
  24. package/@ones-editor/status/src/dom/overflow-tooltip-tag.d.ts +10 -0
  25. package/@ones-editor/status/src/dom/status-palette.d.ts +6 -0
  26. package/@ones-editor/status/src/index.d.ts +4 -0
  27. package/@ones-editor/status/src/locale/en-us.d.ts +25 -0
  28. package/@ones-editor/status/src/locale/index.d.ts +1 -0
  29. package/@ones-editor/status/src/locale/ja-jp.d.ts +25 -0
  30. package/@ones-editor/status/src/locale/zh-cn.d.ts +25 -0
  31. package/@ones-editor/status/src/status-box-command.d.ts +7 -0
  32. package/@ones-editor/status/src/status-box-data.d.ts +5 -0
  33. package/@ones-editor/status/src/status-box-editor.d.ts +21 -0
  34. package/@ones-editor/status/src/status-box.d.ts +4 -0
  35. package/@ones-editor/status/src/types.d.ts +8 -0
  36. package/@ones-editor/table-block/package.json +1 -0
  37. package/@ones-editor/table-block/src/table-block/table-grid.d.ts +3 -0
  38. package/@ones-editor/templates/src/index.d.ts +2 -2
  39. package/@ones-editor/templates/src/templates/select-template.d.ts +4 -0
  40. package/@ones-editor/templates/src/templates/types.d.ts +1 -0
  41. package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -0
  42. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  43. package/@ones-editor/ui/src/index.d.ts +2 -2
  44. package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +2 -1
  45. package/@ones-editor/ui/src/quick-menu/types.d.ts +1 -1
  46. package/@ones-editor/ui-base/src/command-bar/manual-menu.d.ts +1 -1
  47. package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -0
  48. package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
  49. package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -2
  50. package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -0
  51. package/@ones-editor/versions/src/types.d.ts +3 -1
  52. package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -1
  53. package/@ones-editor/versions/src/version-dialog/version-list.d.ts +1 -0
  54. package/dist/index.d.ts +1 -1
  55. package/dist/index.js +210 -199
  56. package/dist/types.d.ts +5 -0
  57. package/package.json +4 -2
@@ -1,5 +1,5 @@
1
1
  import { BlockElement, OnesEditor } from '../../../../../../@ones-editor/core';
2
2
  import type { GetAllQuickMenuItemsOptions } from '../../../../../../@ones-editor/ui';
3
3
  import type { BlockMenuItem } from '../types';
4
- export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options?: GetAllQuickMenuItemsOptions): BlockMenuItem[];
4
+ export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options: GetAllQuickMenuItemsOptions): BlockMenuItem[];
5
5
  export declare function executeInsertBlockCommand(editor: OnesEditor, block: BlockElement, item: BlockMenuItem, insertAbove?: boolean): Promise<BlockElement | null> | undefined;
@@ -67,7 +67,7 @@ import 'prismjs/components/prism-vhdl';
67
67
  import 'prismjs/components/prism-visual-basic';
68
68
  import 'prismjs/components/prism-wasm';
69
69
  import 'prismjs/components/prism-yaml';
70
- declare const SUPPORTED_LANGUAGES: {
70
+ declare const SUPPORTED_LANGUAGES: () => {
71
71
  abap: {
72
72
  name: string;
73
73
  aliases: string[];
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  caption: string;
8
8
  search: string;
9
9
  copySuccess: string;
10
+ plainText: string;
10
11
  };
11
12
  };
12
13
  export default _default;
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  caption: string;
8
8
  search: string;
9
9
  copySuccess: string;
10
+ plainText: string;
10
11
  };
11
12
  };
12
13
  export default _default;
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  caption: string;
8
8
  search: string;
9
9
  copySuccess: string;
10
+ plainText: string;
10
11
  };
11
12
  };
12
13
  export default _default;
@@ -13,7 +13,7 @@ export default class OnesEditorComments {
13
13
  private showComment;
14
14
  showCommentList: (groupId?: string) => void;
15
15
  setFirstEditingCommentActive(): void;
16
- isEditing(): boolean;
16
+ isEditing(includeEmpty?: boolean): boolean;
17
17
  mount(containers: CommentRoot): void;
18
18
  private handleCommentListClose;
19
19
  private handleOnSelectComment;
@@ -18,7 +18,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
18
18
  onDeleteComment(commentId: string, local: boolean): void;
19
19
  onUpdateComment(commentId: string, local: boolean): void;
20
20
  createList(): CommentGroupList;
21
- isEditing(): boolean;
21
+ isEditing(includeEmpty?: boolean): boolean;
22
22
  setFirstEditingCommentActive(): void;
23
23
  handleSelectionOnComment: () => void;
24
24
  updateCommentCount: () => void;
@@ -22,7 +22,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
22
22
  active: boolean;
23
23
  }): CommentGroupItem | null;
24
24
  private findFirstEditingComment;
25
- isEditing(): boolean;
25
+ isEditing(includeEmpty?: boolean): boolean;
26
26
  closeEditing: (groupId: string) => void;
27
27
  setFirstEditingCommentActive: () => void;
28
28
  setActiveItem(index: number, direction?: 'prev' | 'next'): void;
@@ -1,6 +1,6 @@
1
1
  import { OnesEditor } from '../../../../../@ones-editor/core';
2
2
  import { TypedEmitter } from 'tiny-typed-emitter';
3
- import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../..';
3
+ import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
4
4
  import { MiniGroupList } from './group-list';
5
5
  interface MiniCommentsListEvents {
6
6
  onMiniCommentClose: () => void;
@@ -1,6 +1,7 @@
1
1
  import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
2
2
  export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer {
3
3
  renderText(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
4
+ renderBox(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
4
5
  renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
5
6
  updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
6
7
  }
@@ -31,6 +31,7 @@ export declare class EditorInput implements OnesEditorInput {
31
31
  destroy(): void;
32
32
  getInput(): HTMLInputElement;
33
33
  focus(): void;
34
+ isInDisableScrollMask(target: HTMLElement): boolean;
34
35
  handleWindowBlur: () => void;
35
36
  handleDocumentClick: (event: MouseEvent) => void;
36
37
  handleDocumentSelectionChange: () => void;
@@ -1,6 +1,6 @@
1
1
  import { DocBlock, OnesEditorDoc } from '../doc/doc';
2
2
  import { ContainerElement } from '../types';
3
- export declare function isContainer(elem: Element): boolean;
3
+ export declare function isContainer(elem: Element): elem is ContainerElement;
4
4
  export declare function isRootContainer(container: ContainerElement): boolean;
5
5
  export declare function isChildContainer(container: ContainerElement): boolean;
6
6
  export declare function getContainerId(container: ContainerElement): string;
@@ -5,6 +5,7 @@ export declare const TEXT_STYLE_BACKGROUND_COLOR_PREFIX = "style-bg-color-";
5
5
  export declare function addAttribute(text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
6
6
  export declare function removeAttribute(text: DocBlockText, key: string, value: unknown, options?: {
7
7
  ignoreValue: boolean;
8
+ handleBox?: boolean;
8
9
  }): DocBlockText;
9
10
  export declare function rangeAddAttribute(offset: number, length: number, text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
10
11
  export declare function rangeRemoveAttribute(offset: number, length: number, text: DocBlockText, key: string, value: unknown, options?: {
@@ -1,4 +1,4 @@
1
- import { OnesEditor, BlockElement } from '../../types';
1
+ import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
2
2
  import { DocBlockText, DocBlockTextActions } from '../../doc';
3
- export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions): DocBlockText;
4
- export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText): void;
3
+ export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions, options?: InsertTextOptions): DocBlockText;
4
+ export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText, options?: InsertTextOptions): void;
@@ -1,3 +1,3 @@
1
- import { OnesEditor } from '../../types';
1
+ import { InsertTextOptions, OnesEditor } from '../../types';
2
2
  import { DocBox } from '../../doc';
3
- export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox): void;
3
+ export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox, options?: InsertTextOptions): void;
@@ -144,6 +144,7 @@ export interface CommandItem {
144
144
  ellipsisTooltip?: string;
145
145
  disableTooltip?: boolean;
146
146
  disableReason?: string;
147
+ hideGroupItem?: boolean;
147
148
  setCloseable?: (closeable: Closeable) => void;
148
149
  beforePopup?: (parent: unknown) => void;
149
150
  }
@@ -449,6 +450,7 @@ export type OnesEditorCustomCreator = (editor: OnesEditor) => OnesEditorCustom;
449
450
  export interface CloneBlockResultInfo {
450
451
  containerIdMap: Map<string, string>;
451
452
  blockIdMap: Map<string, string>;
453
+ boxIdMap: Map<string, string>;
452
454
  }
453
455
  export interface OnesEditorDomEvents extends OnesEditorCustom {
454
456
  addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
@@ -550,7 +552,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
550
552
  deleteChildContainers: (containerIds: string[]) => void;
551
553
  updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange) => DocBlock;
552
554
  updateEmbedData: (block: BlockElement, data: DocEmbedData, newRange?: SelectionRange) => DocBlock;
553
- updateBoxData: (boxData: DocBox) => void;
555
+ updateBoxData: (boxData: DocBox, options?: InsertTextOptions) => void;
554
556
  updateCompositionText: (text: string, end: boolean) => void;
555
557
  getColor: (index: number, type?: string) => string;
556
558
  }
@@ -33,6 +33,7 @@ export declare function findTarget(event: Event, cssSelector: string): Element |
33
33
  export declare function findEventTargetBlock(event: Event): Element | null;
34
34
  export declare function isElementVisible(element: Element | null): boolean;
35
35
  export declare function getElementScale(element: Element): number;
36
+ export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaElement, callback: (event: KeyboardEvent, composing: boolean) => void): () => void;
36
37
  export declare function getElementFromPoint(x: number, y: number, options?: {
37
38
  noFilter: boolean;
38
39
  }): Element;
@@ -1,9 +1,10 @@
1
1
  interface SelectFileOptions {
2
2
  multiple?: boolean;
3
+ container?: HTMLElement;
3
4
  }
4
5
  export declare function selectFile<T extends SelectFileOptions = SelectFileOptions>(accept: string, options?: T): Promise<T extends {
5
6
  multiple: true;
6
- } ? File[] : File>;
7
+ } ? (File[] | null) : (File | null)>;
7
8
  export declare function isDraggingFiles(v: unknown): v is File[];
8
9
  export declare function getFileExt(file: string): string;
9
10
  export declare function requestDownload(downloadUrl: string, fileName?: string): void;
@@ -1,3 +1,4 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
1
2
  export interface EnforceWithDocumentTitleHandlerOptions {
2
3
  hideTitle?: boolean;
3
4
  headingLevel?: number;
@@ -5,4 +6,5 @@ export interface EnforceWithDocumentTitleHandlerOptions {
5
6
  contentPlaceholder?: string | Element;
6
7
  readonlyTitlePlaceholder?: string;
7
8
  addPlaceholderToAllCurrentEmptyBlock?: boolean;
9
+ applyContentPlaceholder?: (editor: OnesEditor) => boolean;
8
10
  }
@@ -1,4 +1,4 @@
1
1
  import * as markmap from 'markmap-view';
2
2
  import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
3
3
  import { ToMindmapOptions } from './types';
4
- export declare function toMindmap(editor: OnesEditor, block: BlockElement, mindmapOptions: markmap.Markmap['options'], options: ToMindmapOptions): void;
4
+ export declare function toMindmap(editor: OnesEditor, block: BlockElement, mindmapOptions: Partial<markmap.Markmap['options']>, options: ToMindmapOptions): void;
@@ -7,7 +7,7 @@ export interface ToMindmapOptions {
7
7
  selectBlock?: boolean;
8
8
  }
9
9
  export interface MindmapTools {
10
- toMindmap: (editor: OnesEditor, block: BlockElement, mindmapOptions: Markmap['options'], options: ToMindmapOptions) => void;
10
+ toMindmap: (editor: OnesEditor, block: BlockElement, mindmapOptions: Partial<Markmap['options']>, options: ToMindmapOptions) => void;
11
11
  closeMindmap: (editor: OnesEditor, block: BlockElement) => void;
12
12
  fitMindmap: (editor: OnesEditor, block: BlockElement) => void;
13
13
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@ones-editor/status",
3
+ "version": "1.0.0",
4
+ "main": "./src/index.js",
5
+ "license": "MIT",
6
+ "types": "src/index.d.ts"
7
+ }
@@ -0,0 +1 @@
1
+ export declare function createStatusInput(parent: HTMLElement, defaultValue: string, onChange: ((e: Event) => void), onKeyDown: (e: KeyboardEvent, composing: boolean) => void): void;
@@ -0,0 +1,10 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare class OverflowTooltipTag {
3
+ private editor;
4
+ constructor(editor: OnesEditor);
5
+ private check;
6
+ private onMouseOver;
7
+ destroy(): void;
8
+ static create(classes: string[], title: string): HTMLAnchorElement;
9
+ static replaceTitleSpace(title: string): string;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { StatusColor } from '../types';
2
+ export declare function createPalette(): HTMLDivElement;
3
+ export declare class StatusPalette {
4
+ root: HTMLElement;
5
+ changeColor: (color: StatusColor) => void;
6
+ }
@@ -0,0 +1,4 @@
1
+ import StatusBox from './status-box';
2
+ import { StatusBoxCommand } from './status-box-command';
3
+ import './locale';
4
+ export { StatusBox, StatusBoxCommand, };
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ status: {
3
+ empty: string;
4
+ command: {
5
+ name: string;
6
+ };
7
+ color: {
8
+ red: string;
9
+ yellow: string;
10
+ green: string;
11
+ blue: string;
12
+ purple: string;
13
+ grey: string;
14
+ };
15
+ colorDefaultTitle: {
16
+ red: string;
17
+ yellow: string;
18
+ green: string;
19
+ blue: string;
20
+ purple: string;
21
+ grey: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ status: {
3
+ empty: string;
4
+ command: {
5
+ name: string;
6
+ };
7
+ color: {
8
+ red: string;
9
+ yellow: string;
10
+ green: string;
11
+ blue: string;
12
+ purple: string;
13
+ grey: string;
14
+ };
15
+ colorDefaultTitle: {
16
+ red: string;
17
+ yellow: string;
18
+ green: string;
19
+ blue: string;
20
+ purple: string;
21
+ grey: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ status: {
3
+ empty: string;
4
+ command: {
5
+ name: string;
6
+ };
7
+ color: {
8
+ red: string;
9
+ yellow: string;
10
+ green: string;
11
+ blue: string;
12
+ purple: string;
13
+ grey: string;
14
+ };
15
+ colorDefaultTitle: {
16
+ red: string;
17
+ yellow: string;
18
+ green: string;
19
+ blue: string;
20
+ purple: string;
21
+ grey: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare class StatusBoxCommand {
3
+ static id: string;
4
+ static get commands(): CommandItem[];
5
+ static insertStatus(editor: OnesEditor, containerId: string, blockIndex: number): void;
6
+ static insertEmptyBlockStatus(editor: OnesEditor, containerId: string, blockIndex: number): import("@ones-editor/core").BlockElement;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { DocBlockTextOp } from '../../../@ones-editor/core';
2
+ import { StatusBoxData, StatusColor } from './types';
3
+ export declare function recordLastStatusBoxData(box: StatusBoxData): void;
4
+ export declare function getLastStatusBoxTitle(color: StatusColor): string;
5
+ export declare function createEmptyStatusBox(): DocBlockTextOp;
@@ -0,0 +1,21 @@
1
+ import { BoxElement, OnesEditor } from '../../../@ones-editor/core';
2
+ import { Popup } from '../../../@ones-editor/ui-base';
3
+ import { StatusColor } from './types';
4
+ import { StatusPalette } from './dom/status-palette';
5
+ export declare class StatusBoxEditor {
6
+ private editor;
7
+ linkPopup: Popup | null;
8
+ boxElement?: BoxElement;
9
+ statusPalette: StatusPalette;
10
+ isEditing: boolean;
11
+ constructor(editor: OnesEditor);
12
+ editorStatus: (boxElement: BoxElement) => void;
13
+ focus(): void;
14
+ handleShow: () => void;
15
+ handClose: () => void;
16
+ handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
17
+ createPopupContent(title: string, color: StatusColor, subtle: boolean): HTMLDivElement;
18
+ onColorChange: (e: Event) => void;
19
+ onTitleChange: (e: Event) => void;
20
+ destroy(): void;
21
+ }
@@ -0,0 +1,4 @@
1
+ import { Box } from '../../../@ones-editor/core';
2
+ import './status-box.scss';
3
+ declare const StatusBox: Box;
4
+ export default StatusBox;
@@ -0,0 +1,8 @@
1
+ import { DocBox } from '../../../@ones-editor/core';
2
+ export declare const STATUS_COLORS: readonly ["Blue", "Grey", "Yellow", "Red", "Green", "Purple"];
3
+ export type StatusColor = typeof STATUS_COLORS[number];
4
+ export interface StatusBoxData extends DocBox {
5
+ title: string;
6
+ subtle: boolean;
7
+ color: StatusColor;
8
+ }
@@ -10,6 +10,7 @@
10
10
  "@types/lodash.debounce": "^4.0.7",
11
11
  "@types/lodash.merge": "^4.6.7",
12
12
  "@types/lodash.throttle": "^4.1.7",
13
+ "@types/lodash.uniqby": "^4.7.7",
13
14
  "sass": "^1.54.9"
14
15
  },
15
16
  "types": "src/index.d.ts"
@@ -48,6 +48,9 @@ export declare class TableGrid {
48
48
  map<T>(fn: (cell: TableCell) => T): T[][];
49
49
  getBottomCell(cellData: TableCell): TableCell | null;
50
50
  getTopCell(cellData: TableCell): TableCell | null;
51
+ getLeftCell(cellData: TableCell): TableCell | null;
52
+ getRightCell(cellData: TableCell): TableCell | null;
53
+ get uniqueCells(): TableCell[];
51
54
  get cells(): TableCell[];
52
55
  getVirtualCellContainersGrid(): string[][];
53
56
  static virtualCellContainersGridToChildren(virtualCellContainersGrid: string[][]): string[];
@@ -1,4 +1,4 @@
1
1
  import './locale';
2
- import { autoShowHideTemplates } from './templates/select-template';
2
+ import { autoShowHideTemplates, hideTemplates, showTemplates } from './templates/select-template';
3
3
  export * from './templates/types';
4
- export { autoShowHideTemplates };
4
+ export { autoShowHideTemplates, hideTemplates, showTemplates };
@@ -1,7 +1,11 @@
1
+ /// <reference types="lodash" />
1
2
  import { OnesEditor } from '../../../../@ones-editor/core';
2
3
  import './select-templates.scss';
3
4
  interface ShowTemplatesOptions {
4
5
  reset?: boolean;
5
6
  }
7
+ declare function showTemplatesCore(editor: OnesEditor, options?: ShowTemplatesOptions): void;
8
+ export declare const showTemplates: import("lodash").DebouncedFunc<typeof showTemplatesCore>;
9
+ export declare function hideTemplates(editor: OnesEditor): void;
6
10
  export declare function autoShowHideTemplates(editor: OnesEditor, options?: ShowTemplatesOptions): void;
7
11
  export {};
@@ -11,4 +11,5 @@ export interface TemplateOptions {
11
11
  onChooseTemplate?: (editor: OnesEditor) => void;
12
12
  onApplyTemplate?: (editor: OnesEditor, template: DocTemplate) => Promise<void>;
13
13
  onTemplateChooserStatusChanged?: (editor: OnesEditor, cardContainer: HTMLElement | null, status: 'visible' | 'hide') => void;
14
+ onBeforeTemplateShow?: (editor: OnesEditor) => boolean;
14
15
  }
@@ -18,6 +18,7 @@ export interface BlocksGenerator {
18
18
  addHyperlinkParagraph(link: string | undefined, title?: string): void;
19
19
  addOtherEmbedBlock(embedType: string, embedData: any): Promise<void>;
20
20
  addTableMatrix(colsWidth: number[], matrix: CalcCell[][], data: DocObject): Promise<void>;
21
+ addVirtualBlock(blockId: string, data: DocObject, maxWidth: number): Promise<void>;
21
22
  addEmptyParagraph(): void;
22
23
  }
23
24
  export declare function convertBlocksOfDoc(parent: string, // 父节点,暂时只有list block需要这个