@ones-editor/editor 2.0.4-beta.19 → 2.0.4-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 (66) hide show
  1. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
  2. package/@ones-editor/block-menu/src/block-menu-button/drag-preview/element-to-data-url.d.ts +1 -1
  3. package/@ones-editor/block-menu/src/block-menu-button/index.d.ts +4 -15
  4. package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +23 -0
  5. package/@ones-editor/core/src/core/blocks/common/block-wrapper.d.ts +2 -1
  6. package/@ones-editor/core/src/core/blocks/common/insert-empty-block.d.ts +3 -2
  7. package/@ones-editor/core/src/core/blocks/embed-blocks/embed-block/common.d.ts +1 -0
  8. package/@ones-editor/core/src/core/containers/children.d.ts +5 -2
  9. package/@ones-editor/core/src/core/doc/container.d.ts +2 -2
  10. package/@ones-editor/core/src/core/editor/actions/insert-doc/insert-doc.d.ts +1 -1
  11. package/@ones-editor/core/src/core/editor-doc/handle-block-data-changed.d.ts +2 -1
  12. package/@ones-editor/core/src/core/types.d.ts +54 -4
  13. package/@ones-editor/core/src/helper/hovering-block.d.ts +3 -1
  14. package/@ones-editor/drop-target/src/drop-indicator.d.ts +3 -2
  15. package/@ones-editor/drop-target/src/drop-target.d.ts +2 -1
  16. package/@ones-editor/drop-target/src/find-drop-target.d.ts +1 -1
  17. package/@ones-editor/drop-target/src/index.d.ts +2 -1
  18. package/@ones-editor/find-dialog/src/shortcuts.d.ts +0 -2
  19. package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-utils.d.ts +2 -1
  20. package/@ones-editor/heading-collapse/src/index.d.ts +1 -0
  21. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +1 -4
  22. package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -0
  23. package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +22 -0
  24. package/@ones-editor/image-embed/src/image-object.d.ts +3 -0
  25. package/@ones-editor/image-embed/src/index.d.ts +5 -1
  26. package/@ones-editor/image-embed/src/types.d.ts +1 -0
  27. package/@ones-editor/{column-block → layout-block}/package.json +1 -1
  28. package/@ones-editor/layout-block/src/block-drop.d.ts +3 -0
  29. package/@ones-editor/layout-block/src/caption.d.ts +8 -0
  30. package/@ones-editor/layout-block/src/child-containers.d.ts +3 -0
  31. package/@ones-editor/layout-block/src/column-resizer/index.d.ts +2 -0
  32. package/@ones-editor/layout-block/src/constants.d.ts +32 -0
  33. package/@ones-editor/layout-block/src/index.d.ts +6 -0
  34. package/@ones-editor/layout-block/src/layout-creator/index.d.ts +27 -0
  35. package/@ones-editor/layout-block/src/layout-operations.d.ts +11 -0
  36. package/@ones-editor/layout-block/src/locale/en-us.d.ts +10 -0
  37. package/@ones-editor/layout-block/src/locale/index.d.ts +1 -0
  38. package/@ones-editor/layout-block/src/locale/ja-jp.d.ts +10 -0
  39. package/@ones-editor/layout-block/src/locale/zh-cn.d.ts +10 -0
  40. package/@ones-editor/layout-block/src/options.d.ts +2 -0
  41. package/@ones-editor/layout-block/src/percent-bar.d.ts +3 -0
  42. package/@ones-editor/layout-block/src/selection.d.ts +5 -0
  43. package/@ones-editor/layout-block/src/toolbar.d.ts +33 -0
  44. package/@ones-editor/layout-block/src/types.d.ts +17 -0
  45. package/@ones-editor/layout-block/src/utils.d.ts +6 -0
  46. package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +22 -0
  47. package/@ones-editor/table-block/src/index.d.ts +1 -0
  48. package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
  49. package/@ones-editor/to-docx/src/doc2other/core.d.ts +2 -0
  50. package/@ones-editor/to-docx/src/doc2other/layout.d.ts +10 -0
  51. package/@ones-editor/toc/src/build-toc.d.ts +1 -0
  52. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  53. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +1 -1
  54. package/@ones-editor/ui/src/quick-menu/index.d.ts +6 -1
  55. package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +4 -2
  56. package/@ones-editor/ui/src/quick-menu/types.d.ts +1 -0
  57. package/@ones-editor/ui-base/src/icons/index.d.ts +3 -1
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.js +215 -204
  60. package/dist/types.d.ts +2 -0
  61. package/package.json +1 -1
  62. package/@ones-editor/column-block/src/child-containers.d.ts +0 -2
  63. package/@ones-editor/column-block/src/columns-options.d.ts +0 -2
  64. package/@ones-editor/column-block/src/columns-properties.d.ts +0 -15
  65. package/@ones-editor/column-block/src/index.d.ts +0 -4
  66. package/@ones-editor/column-block/src/types.d.ts +0 -11
@@ -0,0 +1,17 @@
1
+ import { ComplexKindBlock, DocBlock, OnesEditor } from '../../../@ones-editor/core';
2
+ export interface LayoutDocBlock extends DocBlock {
3
+ children: string[];
4
+ colsWidth: number[];
5
+ }
6
+ export type LayoutKindBlock = ComplexKindBlock;
7
+ export type LayoutDropData = {
8
+ isValidColumnDragging: boolean;
9
+ position: number;
10
+ };
11
+ export interface CreateLayoutData {
12
+ colCount?: number;
13
+ }
14
+ export interface EditorConfigLayoutOptions {
15
+ onColumnCreated?: (editor: OnesEditor, count: number) => void;
16
+ onColumnWidthChange?: (editor: OnesEditor, count: number, index: number, colsWidth: number[]) => void;
17
+ }
@@ -0,0 +1,6 @@
1
+ import { BlockElement, ContainerElement, DocBlock, DocObject, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function isBlockElement(item: unknown): item is BlockElement;
3
+ export declare function isLayoutBlock(block: BlockElement): boolean;
4
+ export declare function flattenLayoutBlockIfExists(_docObject: DocObject, containerID?: string): DocBlock[];
5
+ export declare function currentCaptionInRootContainer(editor: OnesEditor): boolean;
6
+ export declare function getClosetLayoutContainer(block: BlockElement | undefined): ContainerElement | undefined;
@@ -0,0 +1,22 @@
1
+ import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
2
+ import type { CommandItemType } from '../../../../../@ones-editor/core';
3
+ export default class ImageHoveringToolbarCommands implements BlockCommands {
4
+ protected editor: OnesEditor;
5
+ protected block: BlockElement;
6
+ group: string;
7
+ constructor(editor: OnesEditor, block: BlockElement);
8
+ _commands: ({
9
+ id: string;
10
+ name: string;
11
+ icon: string;
12
+ type?: undefined;
13
+ } | {
14
+ id: string;
15
+ name: string;
16
+ type: CommandItemType;
17
+ icon?: undefined;
18
+ })[];
19
+ private createIconItem;
20
+ get commands(): CommandItem[];
21
+ executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
22
+ }
@@ -5,3 +5,4 @@ import './table-style.scss';
5
5
  import TableShortcuts from './table-block/table-shortcuts';
6
6
  export * from './types';
7
7
  export { TableBlock, TableBlockCommandProvider, TableShortcuts, includeBigTable };
8
+ export type { CreateTableData } from './table-block/table-creator';
@@ -1,5 +1,5 @@
1
1
  import { Closeable, CommandItem, InsertEmptyBlockOptions, OnesEditor } from '../../../../../@ones-editor/core';
2
- interface CreateTableData {
2
+ export interface CreateTableData {
3
3
  colCount?: number;
4
4
  rowCount?: number;
5
5
  }
@@ -1,5 +1,6 @@
1
1
  import { DocBlock, DocObject } from '../../../../@ones-editor/core';
2
2
  import { CalcCell } from './table';
3
+ import { CalcCol } from './layout';
3
4
  import { BlockObject, CodeObject, ExportState, GetDocByBlockFunc, GetTextsByBoxFunc, MD5Func } from './types';
4
5
  /**
5
6
  * 生成docx/html blocks的接口
@@ -20,6 +21,7 @@ export interface BlocksGenerator {
20
21
  addTableMatrix(colsWidth: number[], matrix: CalcCell[][], data: DocObject): Promise<void>;
21
22
  addVirtualBlock(blockId: string, data: DocObject, maxWidth: number): Promise<void>;
22
23
  addEmptyParagraph(): void;
24
+ addLayoutMatrix(colsWidth: number[], matrix: CalcCol[], data: DocObject): Promise<void>;
23
25
  }
24
26
  export declare function convertBlocksOfDoc(parent: string, // 父节点,暂时只有list block需要这个
25
27
  blocks: DocBlock[], data: DocObject, // 协作笔记里的block数组
@@ -0,0 +1,10 @@
1
+ import { DocBlock } from '../../../../@ones-editor/core';
2
+ export interface CalcCol {
3
+ cellId: string | undefined;
4
+ originalWidth: number;
5
+ width: number;
6
+ }
7
+ /**
8
+ * 处理分栏数据结构:实际就是一行多列的表格数据
9
+ */
10
+ export declare function buildLayoutMatrix(block: DocBlock, maxWidth: number): CalcCol[];
@@ -13,4 +13,5 @@ export declare class OnesEditorToc {
13
13
  private appendBlock;
14
14
  private findParent;
15
15
  static buildToc(editor: OnesEditor, doc: DocObject): OnesEditorToc;
16
+ static isTocContainer(editor: OnesEditor, containerID: string): boolean;
16
17
  }