@ones-editor/editor 0.0.3-beta.88 → 0.0.3-beta.89

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 (54) hide show
  1. package/@ones-editor/code-block/src/code-block/code-block-content.d.ts +0 -1
  2. package/@ones-editor/column-block/package.json +8 -0
  3. package/@ones-editor/column-block/src/child-containers.d.ts +2 -0
  4. package/@ones-editor/column-block/src/columns-options.d.ts +2 -0
  5. package/@ones-editor/column-block/src/columns-properties.d.ts +15 -0
  6. package/@ones-editor/column-block/src/index.d.ts +4 -0
  7. package/@ones-editor/column-block/src/types.d.ts +11 -0
  8. package/@ones-editor/comments/src/comments/comments.d.ts +0 -1
  9. package/@ones-editor/comments/src/comments-list/mobile-comments-list/group-list.d.ts +1 -0
  10. package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +3 -1
  11. package/@ones-editor/core/src/core/blocks/common/block-dom.d.ts +1 -0
  12. package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +7 -1
  13. package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +4 -4
  14. package/@ones-editor/core/src/core/types.d.ts +6 -3
  15. package/@ones-editor/core/src/helper/block-helper.d.ts +1 -1
  16. package/@ones-editor/core/src/helper/find-block.d.ts +3 -0
  17. package/@ones-editor/core/src/helper/index.d.ts +1 -0
  18. package/@ones-editor/details-block/package.json +8 -0
  19. package/@ones-editor/details-block/src/auto-expand.d.ts +7 -0
  20. package/@ones-editor/details-block/src/create-empty-details.d.ts +8 -0
  21. package/@ones-editor/details-block/src/details-dom.d.ts +3 -0
  22. package/@ones-editor/details-block/src/details-object.d.ts +11 -0
  23. package/@ones-editor/details-block/src/details-options.d.ts +2 -0
  24. package/@ones-editor/details-block/src/index.d.ts +4 -0
  25. package/@ones-editor/details-block/src/types.d.ts +5 -0
  26. package/@ones-editor/details-block/src/update-expand.d.ts +3 -0
  27. package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +0 -1
  28. package/@ones-editor/drop-target/src/handlers/patch-insert-file.d.ts +2 -0
  29. package/@ones-editor/drop-target/src/index.d.ts +2 -1
  30. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +1 -1
  31. package/@ones-editor/image-embed/src/image-file.d.ts +5 -0
  32. package/@ones-editor/image-embed/src/image-resizer.d.ts +3 -0
  33. package/@ones-editor/image-embed/src/types.d.ts +6 -1
  34. package/@ones-editor/list-block/src/mindmap/to-mindmap/close-mindmap.d.ts +1 -0
  35. package/@ones-editor/media-embed/src/core/media-embed.d.ts +1 -1
  36. package/@ones-editor/media-embed/src/core/media.d.ts +7 -4
  37. package/@ones-editor/media-embed/src/utils/file.d.ts +1 -1
  38. package/@ones-editor/tabs-block/package.json +8 -0
  39. package/@ones-editor/tabs-block/src/active-tab.d.ts +2 -0
  40. package/@ones-editor/tabs-block/src/create-empty-tabs.d.ts +8 -0
  41. package/@ones-editor/tabs-block/src/index.d.ts +4 -0
  42. package/@ones-editor/tabs-block/src/tabs-dom.d.ts +4 -0
  43. package/@ones-editor/tabs-block/src/tabs-object.d.ts +14 -0
  44. package/@ones-editor/tabs-block/src/tabs-options.d.ts +2 -0
  45. package/@ones-editor/tabs-block/src/types.d.ts +8 -0
  46. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  47. package/@ones-editor/ui/src/toolbar/object-commands.d.ts +5 -1
  48. package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +0 -1
  49. package/@ones-editor/webpage-embed/src/types.d.ts +2 -0
  50. package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -16
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.js +145 -145
  53. package/dist/types.d.ts +2 -2
  54. package/package.json +1 -1
@@ -1,4 +1,3 @@
1
1
  import { BlockContentElement, BlockElement, BlockPath, OnesEditor } from '../../../../@ones-editor/core';
2
2
  import { DocCodeBlockData } from './code-block-data';
3
3
  export declare function createCodeBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, codeData: DocCodeBlockData): BlockContentElement;
4
- export declare function updateCodeBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, codeData: DocCodeBlockData): boolean;
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ones-editor/columns-block",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "main": "./src/index.ts",
7
+ "types": "src/index.d.ts"
8
+ }
@@ -0,0 +1,2 @@
1
+ import { BlockElement, ContainerElement } from '../../../@ones-editor/core';
2
+ export declare function getColumnChildContainers(block: BlockElement): ContainerElement[];
@@ -0,0 +1,2 @@
1
+ import { BlockOptions, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function getColumnsOptions(editor: OnesEditor): BlockOptions;
@@ -0,0 +1,15 @@
1
+ import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare class ColumnsBlockCommands implements BlockCommands {
3
+ protected editor: OnesEditor;
4
+ protected block: BlockElement;
5
+ group: string;
6
+ constructor(editor: OnesEditor, block: BlockElement);
7
+ _commands: CommandItem[];
8
+ get commands(): CommandItem[];
9
+ executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
10
+ }
11
+ export declare function getColumnsBlockProperties(editor: OnesEditor, block: BlockElement): {
12
+ blockCommands: {
13
+ 'hovering-toolbar': ColumnsBlockCommands;
14
+ };
15
+ };
@@ -0,0 +1,4 @@
1
+ import { ComplexKindBlock } from '../../../@ones-editor/core';
2
+ import './columns-styles.scss';
3
+ declare const DetailsBlock: ComplexKindBlock;
4
+ export default DetailsBlock;
@@ -0,0 +1,11 @@
1
+ import { DocBlock } from '../../../@ones-editor/core';
2
+ export type ColumnData = {
3
+ type: string;
4
+ columns: 1 | 2 | 3 | 4;
5
+ };
6
+ export declare const COLUMNS: ColumnData[];
7
+ export interface DocColumnsBlock extends DocBlock {
8
+ columnType: string;
9
+ children: string[];
10
+ }
11
+ export declare function getColumnData(type: string): ColumnData;
@@ -7,7 +7,6 @@ export default class OnesEditorComments {
7
7
  private mobileCommentList;
8
8
  private miniCommentList;
9
9
  constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
10
- private get commentOptions();
11
10
  get commentProvider(): OnesEditorCommentsProvider;
12
11
  get isMobile(): boolean;
13
12
  destroy(): void;
@@ -9,6 +9,7 @@ interface MobileCommentGroupListEvents {
9
9
  export declare class MobileGroupList extends ListBase<CommentWithChildren, MobileGroupItem, unknown, MobileCommentGroupListEvents> {
10
10
  private scroller;
11
11
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement, scrollElement: HTMLElement);
12
+ refreshScroller: () => void;
12
13
  createItem(data: CommentWithChildren): MobileGroupItem;
13
14
  insertItem(data: CommentWithChildren): MobileGroupItem | null;
14
15
  deleteItem: (commonId: CommentWithChildren['id']) => boolean;
@@ -1,6 +1,7 @@
1
1
  import { OnesEditor } from '../../../../../@ones-editor/core';
2
2
  import { TypedEmitter } from 'tiny-typed-emitter';
3
3
  import type { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
4
+ import { MobileGroupList } from './group-list';
4
5
  interface MobileCommentsListEvents {
5
6
  onCommentListClose: () => void;
6
7
  }
@@ -8,13 +9,14 @@ export declare class MobileCommentsList extends TypedEmitter<MobileCommentsListE
8
9
  private editor;
9
10
  private commentsProvider;
10
11
  root: HTMLDivElement;
11
- private list;
12
+ list: MobileGroupList;
12
13
  private mask;
13
14
  private pullInfoContainer;
14
15
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider);
15
16
  onCreateComment(commentId: string, local: boolean): void;
16
17
  onDeleteComment(commentId: string, local: boolean): void;
17
18
  onUpdateComment(commentId: string, local: boolean): void;
19
+ private get commentOptions();
18
20
  private handleRootClick;
19
21
  private createPullInfo;
20
22
  private showPullInfo;
@@ -1,6 +1,7 @@
1
1
  import { DocBlock, DocBox } from '../../doc';
2
2
  import { BlockBackgroundElement, BlockContentElement, BlockElement, BlockPath, BlockToolsElement, BoxContentElement, BoxElement, ContainerElement, InsertionContentElement, InsertionElement, OnesEditor } from '../../types';
3
3
  export declare function isBlock(node: Node): node is BlockElement;
4
+ export declare function isBlockTools(node: Node): boolean;
4
5
  export declare function hideBlock(block: BlockElement): void;
5
6
  export declare function showBlock(block: BlockElement): void;
6
7
  export declare function isVisibleBlock(block: BlockElement): boolean;
@@ -1,4 +1,10 @@
1
1
  import { BlockCommands, BlockElement, OnesEditor } from '../../types';
2
2
  export declare function getBlockProperties(editor: OnesEditor, block: BlockElement): import("../../types").BlockProperties | undefined;
3
3
  export declare function getBlockCommandsWithHook(editor: OnesEditor, block: BlockElement): Record<string, BlockCommands>;
4
- export declare function getSpecialBlockCommands(editor: OnesEditor, block: BlockElement, group: string): import("../../types").CommandItem[];
4
+ export declare function getSpecialBlockCommands(editor: OnesEditor, blockElement: BlockElement, group: string): {
5
+ element: BlockElement;
6
+ commands: import("../../types").CommandItem[];
7
+ } | {
8
+ element: null;
9
+ commands: never[];
10
+ };
@@ -1,9 +1,9 @@
1
- import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlockPosition } from '../../types';
2
- export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement): ContainerElement[];
1
+ import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlockPosition, GetChildContainerOptions } from '../../types';
2
+ export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement, options?: GetChildContainerOptions): ContainerElement[];
3
3
  export declare function complexBlockGetSelectedContainers(editor: OnesEditor, block: BlockElement, start: BlockPosition, end: BlockPosition): ContainerElement[];
4
4
  export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
5
- export declare function complexBlockGeFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement): BlockElement | null;
6
- export declare function complexBlockGetLastSimpleChild(editor: OnesEditor, complexBlock: BlockElement): BlockElement | null;
5
+ export declare function complexBlockGeFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
6
+ export declare function complexBlockGetLastSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
7
7
  export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement): BlockElement | null;
8
8
  export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
9
9
  export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
@@ -89,7 +89,7 @@ export interface Embed {
89
89
  getOptions?: (editor: OnesEditor) => EmbedOptions;
90
90
  handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
91
91
  handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock) => boolean;
92
- handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | null, x: number, y: number) => DropInsertPos | undefined;
92
+ handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | undefined;
93
93
  handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
94
94
  convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
95
95
  offset: number;
@@ -208,7 +208,7 @@ export interface Block {
208
208
  handleContainerResized?: (editor: OnesEditor, block: BlockElement) => void;
209
209
  handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
210
210
  handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => boolean;
211
- handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | null, x: number, y: number) => DropInsertPos | false | undefined;
211
+ handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | false | undefined;
212
212
  handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
213
213
  getClientRects?: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => DOMRect[];
214
214
  getMinWidth?: (editor: OnesEditor, block: BlockElement) => number | undefined;
@@ -233,9 +233,12 @@ export interface TextKindBlock extends Block {
233
233
  export interface NextContainerOptions {
234
234
  noWrap?: boolean;
235
235
  }
236
+ export interface GetChildContainerOptions {
237
+ visibleOnly?: boolean;
238
+ }
236
239
  export interface ComplexKindBlock extends Block {
237
240
  enableKeyboardSelect?: boolean;
238
- getChildContainers: (editor: OnesEditor, complexBlock: BlockElement) => ContainerElement[];
241
+ getChildContainers: (editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions) => ContainerElement[];
239
242
  getNextContainer: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement, type: MoveDirection, options?: NextContainerOptions) => ContainerElement | null;
240
243
  getSelectedContainers: (editor: OnesEditor, complexBlock: BlockElement, start: ComplexBlockPosition, end: ComplexBlockPosition) => ContainerElement[];
241
244
  adjustSelectionPos?: (editor: OnesEditor, complexBlock: BlockElement, anchor: ComplexBlockPosition, focus: ComplexBlockPosition) => {
@@ -1,2 +1,2 @@
1
- import { BlockElement } from '../core';
1
+ import { BlockElement } from '../core/types';
2
2
  export declare function isRootBlock(block: BlockElement): boolean;
@@ -0,0 +1,3 @@
1
+ import { BlockElement, OnesEditor } from '../core/types';
2
+ export declare function findPrevVisibleSimpleBlock(editor: OnesEditor, block: BlockElement): BlockElement | null;
3
+ export declare function findNextVisibleSimpleBlock(editor: OnesEditor, block: BlockElement): BlockElement | null;
@@ -3,3 +3,4 @@ import type { OnesEditorHoveringBlockFilter, OnesEditorHoveringBlockFinder } fro
3
3
  export { OnesEditorHoveringBlock, OnesEditorHoveringBlockFilter, OnesEditorHoveringBlockFinder };
4
4
  export * from './block-helper';
5
5
  export * from './run-once';
6
+ export * from './find-block';
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ones-editor/details-block",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "types": "src/index.d.ts"
8
+ }
@@ -0,0 +1,7 @@
1
+ import { OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
2
+ export default class AutoExpandDetails implements OnesEditorCustom {
3
+ private editor;
4
+ constructor(editor: OnesEditor);
5
+ destroy(): void;
6
+ handleSelectionChanged: () => void;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { OnesEditor } from '../../../@ones-editor/core';
2
+ import { DocDetailsBlock } from './types';
3
+ export declare function createEmptyDetailsData(editor: OnesEditor, options?: {
4
+ title?: string;
5
+ }): {
6
+ blockData: DocDetailsBlock;
7
+ focusBlockId: string;
8
+ };
@@ -0,0 +1,3 @@
1
+ import { BlockContentElement, BlockElement, BlockPath, ContainerElement, OnesEditor } from '../../../@ones-editor/core';
2
+ import { DocDetailsBlock } from './types';
3
+ export declare function createDetails(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocDetailsBlock): BlockContentElement;
@@ -0,0 +1,11 @@
1
+ import { BlockElement, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
2
+ export default class DetailsObject implements OnesEditorCustom {
3
+ private editor;
4
+ private blockId;
5
+ private _expanded;
6
+ constructor(editor: OnesEditor, blockId: string);
7
+ destroy(): void;
8
+ get expanded(): boolean;
9
+ set expanded(value: boolean);
10
+ static get(editor: OnesEditor, block: BlockElement | string): DetailsObject;
11
+ }
@@ -0,0 +1,2 @@
1
+ import { BlockOptions, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function getDetailsOptions(editor: OnesEditor): BlockOptions;
@@ -0,0 +1,4 @@
1
+ import { ComplexKindBlock } from '../../../@ones-editor/core';
2
+ import './details-styles.scss';
3
+ declare const DetailsBlock: ComplexKindBlock;
4
+ export default DetailsBlock;
@@ -0,0 +1,5 @@
1
+ import { DocBlock } from '../../../@ones-editor/core';
2
+ export interface DocDetailsBlock extends DocBlock {
3
+ title: string;
4
+ children: [string];
5
+ }
@@ -0,0 +1,3 @@
1
+ import { BlockElement, ContainerElement, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function getDetailsContainer(block: BlockElement): ContainerElement;
3
+ export declare function updateExpanded(editor: OnesEditor, block: BlockElement, expanded: boolean): void;
@@ -3,6 +3,5 @@ import type { DropHandler } from '../drop-target';
3
3
  export declare class DropFileHandler implements DropHandler {
4
4
  private editor;
5
5
  constructor(editor: OnesEditor);
6
- private getEmbedClassByFile;
7
6
  handleDrop: (editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number) => boolean;
8
7
  }
@@ -0,0 +1,2 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare function patchInsertFile(editor: OnesEditor, files: File[], containerId: string, blockIndex: number): Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import OnesEditorDropTarget from './drop-target';
2
2
  import type { DropHandler } from './drop-target';
3
+ import { patchInsertFile } from './handlers/patch-insert-file';
3
4
  export * from './drag-object';
4
- export { OnesEditorDropTarget, DropHandler };
5
+ export { OnesEditorDropTarget, DropHandler, patchInsertFile };
@@ -4,4 +4,4 @@ export declare function getDragInsertPos(editor: OnesEditor, block: BlockElement
4
4
  rect: DOMRect;
5
5
  data: number;
6
6
  };
7
- export declare function handleDropOver(editor: OnesEditor, block: BlockElement, dragObject: DragObject | null, x: number, y: number): ImageDragInsertPos | undefined;
7
+ export declare function handleDropOver(editor: OnesEditor, block: BlockElement, dragObject: DragObject | DataTransferItemList | null, x: number, y: number): ImageDragInsertPos | undefined;
@@ -0,0 +1,5 @@
1
+ import { OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function getAccepts(editor: OnesEditor): string;
3
+ export declare function getFileExt(file: File): string;
4
+ export declare function verifyFile(editor: OnesEditor, file: File): void;
5
+ export declare function isImageFile(fileType: string): boolean;
@@ -1,7 +1,10 @@
1
1
  import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
2
2
  export default class ImageResizer {
3
3
  private editor;
4
+ currentResizer: BlockElement | null;
4
5
  constructor(editor: OnesEditor);
5
6
  destroy(): void;
7
+ disable(block: BlockElement): void;
8
+ enable(block: BlockElement): void;
6
9
  handleHoveringBlockChange: (block: BlockElement | null, old: BlockElement | null) => void;
7
10
  }
@@ -1,6 +1,11 @@
1
- import { DocEmbedData, OnesEditorCustom, TextAlign } from '../../../@ones-editor/core';
1
+ import { DocEmbedData, OnesEditor, OnesEditorCustom, TextAlign } from '../../../@ones-editor/core';
2
2
  export interface ImageOptions {
3
3
  defaultAlign?: TextAlign;
4
+ allowedMedias?: string[];
5
+ maxSize?: number;
6
+ callbacks?: {
7
+ onError?: (editor: OnesEditor, error: Error) => void;
8
+ };
4
9
  }
5
10
  export interface ImageEmbedData extends DocEmbedData {
6
11
  src: string | string[];
@@ -1,2 +1,3 @@
1
1
  import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
2
+ export declare function clearMindmap(editor: OnesEditor, block: BlockElement): Promise<void>;
2
3
  export declare function closeMindmap(editor: OnesEditor, block: BlockElement): Promise<void>;
@@ -5,11 +5,11 @@ import { Media } from './media';
5
5
  import type { MediaAbstract, MediaBlockData } from '../types';
6
6
  export declare abstract class MediaEmbed implements Embed {
7
7
  abstract embedType: MediaType;
8
- abstract abstract: MediaAbstract;
9
8
  abstract createMediaElement(editor: OnesEditor, mediaElement: HTMLElement, blockData: MediaBlockData, url: string): HTMLMediaElement;
10
9
  abstract updateMediaElement(editor: OnesEditor, mediaElement: HTMLElement, blockData: MediaBlockData, url: string): HTMLMediaElement;
11
10
  abstract createProgressElement(parent: HTMLElement, val: number, file: File): void;
12
11
  abstract updateProgressElement(parent: HTMLElement, val: number): void;
12
+ abstract getAbstract(): MediaAbstract;
13
13
  getMedia(editor: OnesEditor, id: string): Media;
14
14
  handleInsertEmptyEmbed: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<BlockElement | null>;
15
15
  getOptions(): {
@@ -1,6 +1,10 @@
1
- import type { BlockContentElement } from '../../../../@ones-editor/core';
1
+ import type { OnesEditor, BlockContentElement } from '../../../../@ones-editor/core';
2
+ import { TypedEmitter } from 'tiny-typed-emitter';
2
3
  import type { MediaOptions, MediaBlockData, MediaAbstract } from '../types';
3
- export declare class Media {
4
+ export interface MediaEvent {
5
+ mediaError: (editor: OnesEditor, type: 'upload_error' | 'load_error' | 'empty', blockId: string) => void;
6
+ }
7
+ export declare class Media extends TypedEmitter<MediaEvent> {
4
8
  private options;
5
9
  private mediaContainer;
6
10
  private media;
@@ -14,9 +18,8 @@ export declare class Media {
14
18
  private renderRetry;
15
19
  private renderProgress;
16
20
  private renderMediaElement;
17
- private handleRetry;
18
21
  handleUploadFile: (file: File) => Promise<void>;
19
- renderEmpty(): void;
22
+ renderEmpty(blockData: MediaBlockData): void;
20
23
  getResourceUrl(url: string): string;
21
24
  render(blockData: MediaBlockData, content: BlockContentElement): void;
22
25
  setAbstract(abstract: MediaAbstract): void;
@@ -2,5 +2,5 @@ import type { OnesEditor } from '../../../../@ones-editor/core';
2
2
  import { MediaType } from '../constant';
3
3
  export declare function getFileExt(file: File): string;
4
4
  export declare function getAccepts(editor: OnesEditor, mediaType: MediaType): string;
5
- export declare function verifyFile(file: File, editor: OnesEditor, mediaType: MediaType): true | Error;
5
+ export declare function verifyFile(file: File, editor: OnesEditor, mediaType: MediaType): void;
6
6
  export declare function isReservedMediaSrc(src: string): boolean;
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ones-editor/tabs-block",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "types": "src/index.d.ts"
8
+ }
@@ -0,0 +1,2 @@
1
+ import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function activeTab(editor: OnesEditor, block: BlockElement, index: number): void;
@@ -0,0 +1,8 @@
1
+ import { OnesEditor } from '../../../@ones-editor/core';
2
+ import { DocTabsBlock } from './types';
3
+ export declare function createEmptyTabsData(editor: OnesEditor, options?: {
4
+ count?: number;
5
+ }): {
6
+ blockData: DocTabsBlock;
7
+ focusBlockId: string;
8
+ } | null;
@@ -0,0 +1,4 @@
1
+ import { ComplexKindBlock } from '../../../@ones-editor/core';
2
+ import './tabs-styles.scss';
3
+ declare const TabsBlock: ComplexKindBlock;
4
+ export default TabsBlock;
@@ -0,0 +1,4 @@
1
+ import { BlockContentElement, BlockElement, BlockPath, ContainerElement, OnesEditor } from '../../../@ones-editor/core';
2
+ import { DocTabsBlock } from './types';
3
+ export declare function createTabs(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocTabsBlock): BlockContentElement;
4
+ export declare function getTabsContainers(block: BlockElement): ContainerElement[];
@@ -0,0 +1,14 @@
1
+ import { BlockElement, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
2
+ export default class TabsObject implements OnesEditorCustom {
3
+ private editor;
4
+ private blockId;
5
+ private activeTabIndex;
6
+ constructor(editor: OnesEditor, blockId: string);
7
+ destroy(): void;
8
+ getTabs(): import("./types").TabData[];
9
+ getActiveTab(): import("./types").TabData;
10
+ getActiveTabIndex(): number;
11
+ indexOf(id: string): number;
12
+ setActiveTab(id: string): void;
13
+ static get(editor: OnesEditor, block: BlockElement | string): TabsObject;
14
+ }
@@ -0,0 +1,2 @@
1
+ import { BlockOptions, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function getTabsOptions(editor: OnesEditor): BlockOptions;
@@ -0,0 +1,8 @@
1
+ import { DocBlock } from '../../../@ones-editor/core';
2
+ export interface TabData {
3
+ name: string;
4
+ }
5
+ export interface DocTabsBlock extends DocBlock {
6
+ tabs: TabData[];
7
+ children: string[];
8
+ }