@ones-editor/editor 0.0.3-beta.87 → 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 (40) hide show
  1. package/@ones-editor/code-block/src/code-block/code-block-content.d.ts +0 -1
  2. package/@ones-editor/code-block/src/code-block/types.d.ts +3 -0
  3. package/@ones-editor/code-block/src/index.d.ts +1 -0
  4. package/@ones-editor/column-block/package.json +8 -0
  5. package/@ones-editor/column-block/src/child-containers.d.ts +2 -0
  6. package/@ones-editor/column-block/src/columns-options.d.ts +2 -0
  7. package/@ones-editor/column-block/src/columns-properties.d.ts +15 -0
  8. package/@ones-editor/column-block/src/index.d.ts +4 -0
  9. package/@ones-editor/column-block/src/types.d.ts +11 -0
  10. package/@ones-editor/core/src/core/blocks/common/block-dom.d.ts +1 -0
  11. package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +7 -1
  12. package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +2 -2
  13. package/@ones-editor/core/src/core/types.d.ts +2 -2
  14. package/@ones-editor/core/src/helper/block-helper.d.ts +1 -1
  15. package/@ones-editor/core/src/helper/find-block.d.ts +3 -0
  16. package/@ones-editor/core/src/helper/index.d.ts +1 -0
  17. package/@ones-editor/details-block/package.json +8 -0
  18. package/@ones-editor/details-block/src/auto-expand.d.ts +7 -0
  19. package/@ones-editor/details-block/src/create-empty-details.d.ts +8 -0
  20. package/@ones-editor/details-block/src/details-dom.d.ts +3 -0
  21. package/@ones-editor/details-block/src/details-object.d.ts +11 -0
  22. package/@ones-editor/details-block/src/details-options.d.ts +2 -0
  23. package/@ones-editor/details-block/src/index.d.ts +4 -0
  24. package/@ones-editor/details-block/src/types.d.ts +5 -0
  25. package/@ones-editor/details-block/src/update-expand.d.ts +3 -0
  26. package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +0 -1
  27. package/@ones-editor/drop-target/src/handlers/patch-insert-file.d.ts +2 -0
  28. package/@ones-editor/drop-target/src/index.d.ts +2 -1
  29. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +1 -1
  30. package/@ones-editor/image-embed/src/image-file.d.ts +2 -1
  31. package/@ones-editor/image-embed/src/image-resizer.d.ts +3 -0
  32. package/@ones-editor/list-block/src/mindmap/to-mindmap/close-mindmap.d.ts +1 -0
  33. package/@ones-editor/media-embed/src/core/media.d.ts +7 -4
  34. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  35. package/@ones-editor/ui/src/index.d.ts +2 -1
  36. package/@ones-editor/ui/src/toolbar/object-commands.d.ts +5 -1
  37. package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +0 -1
  38. package/dist/index.js +130 -130
  39. package/dist/types.d.ts +5 -2
  40. 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,3 @@
1
+ export interface CodeBlockExternalOptions {
2
+ onCodeCopyComplete?: () => void;
3
+ }
@@ -1,3 +1,4 @@
1
1
  import { CodeBlock, CodeLineBlock, CodeTextDecorator } from './code-block';
2
2
  import './locale';
3
+ export * from './code-block/types';
3
4
  export { CodeBlock, CodeLineBlock, CodeTextDecorator };
@@ -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;
@@ -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
+ };
@@ -2,8 +2,8 @@ import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlock
2
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;
@@ -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;
@@ -1,4 +1,5 @@
1
1
  import { OnesEditor } from '../../../@ones-editor/core';
2
2
  export declare function getAccepts(editor: OnesEditor): string;
3
3
  export declare function getFileExt(file: File): string;
4
- export declare function verifyFile(file: File, editor: OnesEditor): void;
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,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>;
@@ -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;